Skip to main content

Requirements to start the flow.

API key

Have an API key (Tutorial here).

Order flow

The process of selling stablecoins is done through the following steps:
1

Register the receiving bank account

Before creating an order, you need to register the bank account that will receive the funds. This only needs to be done once per bank account-currency pair, so you can skip this step if the account is already registered.Send the country and fiat of the account along with its details, which are bankName, accountHolderName and accountNumber, plus the identifier your country uses, such as CLABE in Mexico or CCI in Peru. Keep the id from the response, since that is what you pass as payoutBankAccountId when creating the order.

Go to create a new bank account

2

Create a quote

You can create as many quotes as necessary before creating an order. Specify what you are selling with the side, crypto, fiat and country fields, then specify the size with either amountCrypto, if you know how much crypto you want to sell, or amountFiat, if you know how much fiat you want to receive.For example, to sell $150,000 USDC (Solana) for MXN:
The response tells you what you would get. Check amountFiat for the fiat you will receive and netPrice for the all-in price including taxes and fees. 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, and the window is short, so read that field rather than assuming a fixed duration.

Go to create quote endpoint

Learn more about how quotes work

3

Create order

Once you are satisfied with a quote, you can create an order for the quoted amount. Pass the quote through the quoteId field, and make sure to pass the ID for the bank account to which you would like to receive the funds through the payoutBankAccountId field. The quote must not have expired.

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, and the intermediate statuses do not require any action. Remember to add the payoutBankAccountId field when creating the order in the previous step. Otherwise, the resulting status will be awaitingBankPayoutDetails, which means Rio has nowhere to send the fiat.

Go to check order status

5

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

Please send the amount specified in the amountCrypto field of the order object to the address specified in the blockchainAddress field of the paymentInstructions field of the order.The payment instructions are part of the order itself, so there is no separate endpoint to call. Get the order and read its paymentInstructions field. 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 selling USDC (Stellar), you must include the memo specified in the blockchainMemo field of the paymentInstructions field of the order. 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 final 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 funds to your bank account in the next few minutes. The order ends up in complete, and you can see the details of the transfer in its payoutsSent field.

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.