> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rio.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Placing a T+n order

### Requirements to start the flow.

> [card] API key
>
> Have an API key ([Tutorial here](https://docs.rio.trade/quickstart.md#api-key-generation)).

### &#x20;Order flow

The process of placing a T+n order is very similar to the process of placing a regular order, but with the addition of a few steps. In this guide, we will go through the process of placing a T+1 buy order.

> [!NOTE]
>
> **Disclaimer**: Settlement does not imply custody or receipt of funds before
> the order is executed on the date specified in the settlement details.

**1. Register the deposit 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-currency pair, so you can skip this step if the address is already registered.

Send the wallet address in the `address` field and the stablecoin it holds as `asset` and `network`. Keep the `id` from the response, since that is what you pass as `settlement.payout.addressId` when creating the order.

> [card] [Go to create a new crypto address](https://docs.rio.trade/api-reference/address/create-address.md)

**2. Create a quote**

When creating a T+n order, you need to specify the number of days until the order is settled. This is done with the `settlement` object of the request: set `settlement.timing` to `TPlusOffset` and `settlement.valueDateOffset` to the number of business days until the order is settled.
For example, if you want to place a T+0 buy order, set `settlement.valueDateOffset` to 0. If you want to place a T+1 buy order, set it to 1, etc.

A T+1 buy order of USDC (Ethereum) with MXN looks like this:

```json theme={null}
{
  "origin": { "asset": "MXN", "amount": 1000000, "country": "MX" },
  "destination": { "asset": "USDC", "network": "ethereum", "country": "MX" },
  "settlement": { "timing": "TPlusOffset", "valueDateOffset": 1 }
}
```

The quote echoes these under `settlement`, and `settlement.valueDate` is the date the order will settle on.

Keep in mind that banking hours and holidays may cause the effective settlement date to be different than what you expected. Please always confirm the `settlement.valueDate` field of the quote and make sure it matches your expectation before creating an order. The `settlement.effectiveValueDateOffset` field tells you how many billable days that works out to, which can differ from the offset you asked for.

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.

> [card] [Go to create quote endpoint](https://docs.rio.trade/api-reference/quotes/create-quote.md)

> [card] [Learn more about how quotes work](https://docs.rio.trade/quotes.md)

**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 the crypto address that should receive the funds through the `settlement.payout.addressId` field. The quote must not have expired.

> [card] [Go to create order](https://docs.rio.trade/api-reference/orders/create-order.md)

**4. Wait for the order to be ready to accept payment.**

Poll the order or subscribe to our webhooks. Wait for the order to have a status of `awaitingPayment`. After this, you have until the payment due date, specified in `settlement.payment.dueDate` on the order, to pay for the order.

> [card] [Go to check order status](https://docs.rio.trade/api-reference/orders/get-order.md)

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

Please send the amount specified in `settlement.payment.amount` on the order to the bank account described in `settlement.payment.instructions`. Do not forget to send the reference.

The payment instructions are part of the order itself, so there is no separate endpoint to call. Get the order and read its `settlement.payment.instructions` field, which holds `bankName`, `companyName`, `accountNumber`, the `reference` you must include with the transfer, and the country specific identifiers that apply, such as `CLABE` in Mexico or `CCI` in Peru. A transfer that arrives without the reference cannot be matched to your order.

**6. Confirm payment (optional)**

This final step is only necessary if the payment is made in USD in Mexico or COP in Colombia, or if the order was placed in our sandbox environment and you want to simulate a successful payment. Everywhere else Rio detects the incoming transfer on its own.

> [card] [Go to confirm payment](https://docs.rio.trade/api-reference/bank-payments/check-bank-payment.md)

**7. Wait for funds**

Rio will send the funds to your wallet 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`.

#### &#x20;Poll order status or subscribe to webhooks

> [card] [Go to check order status](https://docs.rio.trade/api-reference/orders/get-order.md)

> [card] [Go to register a webhook](https://docs.rio.trade/workflows/register-webhook.md)
>
> Subscribe to `orders` webhooks to get order updates pushed to you instead of
> polling.

> [!NOTE]
>
> **Settlement dates beyond T+4**: any offset up to T+4 is available by default.
> Going further out is a separate permission, so please contact support to
> enable it for your account or for your broker's account if you trade under
> one.

> [!WARNING]
>
> **Geographic restriction**: T+n orders cannot be placed in the United States.

> [!NOTE]
>
> **Disclaimer**: All technical documentation is subject to the terms and
> conditions, which apply supplementarily and take precedence over the
> documentation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.