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
  • Pay
  • View payment history

Was this helpful?

  1. Raiden API
  2. API Tutorial

Make a Payment

When your node is connected to a token network, has channels open with one or more peers and have tokens deposited in the channels you're all set to start making payments.

PreviousDeposit TokensNextWithdraw Tokens

Last updated 4 years ago

Was this helpful?

A powerful feature of Raiden is the ability to let you pay anyone in the network by using a path of connected payment channels to mediate the payment and not only directly connected nodes. These payments are called mediated transfers.

Pay

Payments are made from the endpoint via a POST request that needs to include:

  1. The address of the token you want to pay with as a path parameter.

  2. The address of the node receiving your payment as a path parameter.

  3. The amount you would like to pay as a body parameter.

curl -i -X POST \
http://localhost:5001/api/v1/payments/0x9aBa529db3FF2D8409A1da4C9eB148879b046700/0x61C808D82A3Ac53231750daDc13c777b59310bD9 \
-H 'Content-Type: application/json' \
--data-raw '{"amount": "42"}'

You can provide the body parameter with an additional identifier key with a value of your choice. This value can be a number ("identifier": 42) or the stringified number ("identifier": "42").

This is optional and the purpose of the identifier is to give dApps built on Raiden a way to tag payments.

Your payment will most likely succeed if:

  • The path of channels leading from your node to the node receiving your payment has enough capacity.

  • All nodes needed to mediate the payment are online.

  • You have enough tokens in the channel from which you intend to pay out the amount specified in the request body.

To get your tokens out of a channel and back on-chain you either have to withdraw the tokens or close the channel.

View payment history

curl -i \
http://localhost:5001/api/v1/payments/0x9aBa529db3FF2D8409A1da4C9eB148879b046700/0x61C808D82A3Ac53231750daDc13c777b59310bD9

In the response you will be able to see all successful payments, all failed payments and all payments you have received.

You can view all transactions you've made with a partner node by querying the endpoint in a GET request, using the same path parameters as when .

Withdraw Tokens
Settle Payments and Close Channels
making a payment
payments
payments