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
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
?limit=
integer
Limits the payment history result to the amount specified after =
&offset=
integer
Offsets the payment history result by the amount specified after =
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
version
string
Version of the API
token_address
string
Address of a token
target_address
string
Address of the receiving node
Request Body
amount
string
Amount of tokens to be sent
identifier
string
Integer for identifying the payment
Example request body:
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
andreveal_timeout
The funds not being enough
Last updated
Was this helpful?