Raiden Network
  • What is Raiden?
  • Installation
    • Quick Start
      • Get MetaMask
      • Get an Infura ID
      • Download and run the Raiden Wizard
      • Handle Limitations
    • Starting Raiden Manually
  • Using Raiden on Mainnet
    • Overview
    • Get Whitelisted Tokens
    • Deposit Tokens to the UDC
    • Open a Channel
    • Make a Payment
    • Deposit Tokens
    • View Channel Status
    • Mediation Fees
  • The Raiden Web Interface
    • Overview
    • Navigate the WebUI
    • Join a Token Network
    • Make a Payment
    • Add More Tokens
    • Settle Payments and Close Channels
  • Using Raiden on testnet
    • Quick Start on Görli Testnet
    • Use Custom Token
      • Get Goerli Testnet ETH (GÖETH)
      • Import Custom Token
      • Compile Imported Token Code
      • Deploy Custom Token
  • Raiden API
    • Introduction
    • Resources
      • Address
      • Version
      • Settings
      • Contracts Information
      • Tokens
      • Channels
      • Payments
      • Connections
      • Pending Transfers
      • Shutdown
      • Testing
    • API Tutorial
      • Create a Token Network
      • Open a Channel
      • Deposit Tokens
      • Make a Payment
      • Withdraw Tokens
      • Settle Payments and Close Channels
  • Other
    • Safe Usage
    • Known Issues
    • Glossary
    • v1.0 Documentation
    • Trademark Attributions
Powered by GitBook
On this page
  • Payments Resource Overview
  • Payment Resource Details
  • Payment History
  • Initiate a Payment

Was this helpful?

  1. Raiden API
  2. Resources

Payments

The payment endpoint is used for transferring tokens to another node. You can send the desired amount of tokens by providing the address of the token and the address of the receiving node.

Payments Resource Overview

HTTP Method

Resource

Description

GET

Payment history

POST

Initiate a payment

Payment Resource Details

Payment History

GET http://localhost:5001/api/v1/payments/0x0f11...b1ED/0x8264...5ba7

When querying the payment history the response will include: - "EventPaymentSentSuccess" for successful payments - "EventPaymentSentFailed" for failed payments - "EventPaymentReceivedSuccess" for received payments

Path Parameters

Name
Type
Description

version

string

Version of the API

token_address

string

Address of a token, will filter response list according to token_address

partner_address

string

Address of either the payment initiator or target, will filter response list according to the address

Query Parameters

Name
Type
Description

?limit=

integer

Limits the payment history result to the amount specified after =

&offset=

integer

Offsets the payment history result by the amount specified after =

[
    {
        "event": "EventPaymentSentSuccess",
        "amount": "20",
        "target": "0x82641569b2062B545431cF6D7F0A418582865ba7",
        "identifier": "3",
        "log_time": "2018-10-30T07:10:13.122",
        "token_address": "0x62083c80353Df771426D209eF578619EE68D5C7A"
    },
    {
        "target": "0x82641569b2062B545431cF6D7F0A418582865ba7",
        "event": "EventPaymentSentFailed",
        "log_time": "2018-10-30T07:04:22.293",
        "reason": "there is no route available",
        "token_address": "0x62083c80353Df771426D209eF578619EE68D5C7A"
    },
    {
        "event": "EventPaymentReceivedSuccess",
        "amount": "5",
        "initiator": "0x82641569b2062B545431cF6D7F0A418582865ba7",
        "identifier": "1",
        "log_time": "2018-10-30T07:03:52.193",
        "token_address": "0x62083c80353Df771426D209eF578619EE68D5C7A"
    }
]
The token address is not a valid EIP55-encoded Ethereum address
The target address is not a valid EIP55-encoded Ethereum address
An invalid token address has been provided
Internal Raiden node error

Initiate a Payment

POST http://localhost:5001/api/v1/payments/0x2a65...8226/0x61C8...0bD9

The request might take some time and will only return once the payment either succeeds or fails.

Path Parameters

Name
Type
Description

version

string

Version of the API

token_address

string

Address of a token

target_address

string

Address of the receiving node

Request Body

Name
Type
Description

amount

string

Amount of tokens to be sent

identifier

string

Integer for identifying the payment

{
    "initiator_address": "0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8",
    "target_address": "0x61C808D82A3Ac53231750daDc13c777b59310bD9",
    "token_address": "0x2a65Aca4D5fC5B5C859090a6c34d164135398226",
    "amount": "200",
    "identifier": "42"
}
The provided JSON is in some way incorrect
The payment can't start due to insufficient balande
The token address is not a valid EIP55-encoded Ethereum address
The target address is not a valid EIP55-encoded Ethereum address
A timeout happened during the payment
An invalid token and/or target address has been provided
An invalid token amount has been provided
There is no path to the receiving node
The identifier is already in use for a different payment
Internal Raiden node error

Example request body:

{
    "amount": "200",
    "identifier" "42"
}

Failing Payments

A payment can fail due to:

  • The secret for opening the hashlock not being revealed in time and the lock expires

  • The target node being offline

  • The channels leading to the target node not having enough settle timeout and reveal_timeout

  • The funds not being enough

PreviousChannelsNextConnections

Last updated 4 years ago

Was this helpful?

/api/<version>/payments/<token_address>
/<target_address>
/api/<version>/payments/<token_address>
/<target_address>