Skip to main content

Requirements to start the flow.

API key

Have an API key (Tutorial here).

Order flow

A swap is a cryptoToCrypto order. You send one stablecoin to Rio and receive a different stablecoin, or the same stablecoin on a different network, at the address you registered. The process is done through the following steps:
1

Register the receiving crypto address

Before creating an order, you need to register the crypto address that will receive the funds. This only needs to be done once per address and stablecoin, so you can skip this step if the address is already registered.Send the wallet address in the address field and the stablecoin it will receive as asset and network. Keep the id from the response, since that is what you pass as payoutAddressId when creating the order.

Go to create a new crypto address

2

Create a quote

A quote has two legs: origin is what you pay and destination is what you receive. Both legs of a swap are stablecoins, so each one needs an asset and a network. Set amount on the leg you want to fix: on origin if you know how much you want to send, or on destination if you know how much you want to receive.For example, to swap $150,000 USDC (Ethereum) into USDC (Solana):
Or to convert USDT (Tron) into exactly 100,000 USDC (Base):
The country field is required. Both stablecoins must be enabled for trading on their networks, see supported currencies.The response has flow set to cryptoToCrypto. Check destination.amount for the stablecoin you will receive, pricingDetails.fees for the fee breakdown and netPrice for the all-in rate. Keep the id, since that is the quoteId you pass when creating the order.Quotes expire. The expiresAt field is the date and time after which the quote can no longer be used to create an order, so read that field rather than assuming a fixed duration.
Swap quotes do not accept orderType, limitNetPrice, the timeInForce fields, settlement.timing or settlement.valueDateOffset.

Go to create quote endpoint

Learn more about how quotes work

3

Create order

Once you are satisfied with a quote, create an order for the quoted amount. Pass the quote through the quoteId field and the address that should receive the funds through the payoutAddressId field. The address must hold the same asset and network as the quote’s destination, and the quote must not have expired.Swap orders do not accept payoutBankAccountId, wireMessage or the bulk payment ids.

Go to create order

4

Wait for the order to be ready to accept your payment

Poll the order or subscribe to our webhooks. Wait for the order to have a status of awaitingPayment. Until then there is nothing for you to do.

Go to check order status

5

Pay for the order (skip if placing the order in our sandbox environment)

Everything about the leg you pay lives under settlement.payment on the order. Send the amount in settlement.payment.amount, on the network in settlement.payment.network, to the address in settlement.payment.instructions.blockchainAddress.Read the address from each order rather than reusing one you saved earlier, since the address you are given can differ between orders.
If you are sending USDC (Stellar), you must include the memo specified in settlement.payment.instructions.blockchainMemo. Failure to include the memo will result in the payment not being credited to your order and your funds may be permanently lost.
6

Confirm payment (optional)

This step is only necessary to simulate a successful payment in our sandbox environment. In production Rio detects the incoming transfer on its own.

Go to confirm payment

7

Wait for funds

Rio will send the stablecoin to the address you registered in the next few minutes. The order ends up in complete, settlement.payout.status becomes settled, and you can see the transaction hash in settlement.payout.transactions.

Poll order status or subscribe to webhooks

Go to check order status

Go to register a webhook

Subscribe to orders webhooks to get order updates pushed to you instead of polling.
Disclaimer: All technical documentation is subject to the terms and conditions, which apply supplementarily and take precedence over the documentation.