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

# Preview an onramp or offramp payout

> Calculate the net NGN or stablecoin payout from a total source amount before starting a payment

Preview the amount a customer receives after Daya fees and an optional developer fee.
Supports **NGN → USDC/USDT** and **USDC/USDT → NGN** on supported networks.
The request does not create a funding account, initiate a payout, reserve funds or move money.

> [!WARNING]
>
> The result is an estimate (`is_estimate: true`), not a guaranteed payout.
> `expires_at` is the rate expiry. Fee changes can invalidate the preview earlier.

## Authentication

**X-API-Key** `string` *required*

Your merchant API key. Scoped API keys require `business:read`.

Send `Content-Type: application/json`. Keep API keys on your server.

## Request body

**source\_currency** `string` *required*

Currency the customer sends: `NGN`, `USDC` or `USDT`.

**destination\_currency** `string` *required*

Currency the customer receives: `NGN`, `USDC` or `USDT`.
One side must be NGN and the other must be USDC or USDT.

**source\_amount** `string` *required*

Total amount received by Daya, including applicable fees. Send a positive
decimal string with at most two decimal places for NGN or six for crypto.
JSON numbers and exponent notation are not accepted.

**chain** `string` *required*

The destination crypto network for onramp or the source crypto network for
offramp. Use the asset/network combinations available in your environment:
[supported chains](https://docs.daya.co/api-reference/supported-chains/list-supported-chains.md).

**developer\_fee** `object`

Optional object with a `percentage` decimal string from `0` to `50`, with up
to four decimal places. For example, `{"percentage": "1.5"}` means 1.5%.
Omission means zero. Send the same percentage you will use for the funding
account; the preview does not read an existing account's fee configuration.

## Request examples

```bash Onramp: NGN to USDC theme={"dark"}
curl --request POST \
  --url https://api.daya.co/v1/quotes \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "source_currency": "NGN",
    "destination_currency": "USDC",
    "source_amount": "150000.00",
    "chain": "BASE"
  }'
```

```bash Offramp: USDT to NGN theme={"dark"}
curl --request POST \
  --url https://api.daya.co/v1/quotes \
  --header 'X-API-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "source_currency": "USDT",
    "destination_currency": "NGN",
    "source_amount": "100.000000",
    "chain": "TRON",
    "developer_fee": { "percentage": "1.5" }
  }'
```

`source_amount` is the input budget; `destination_amount` is the net output.
Do not subtract the returned fees from `destination_amount` again.

## Response

Returns HTTP `200` with a quote object, without a `data` wrapper.
This onramp example assumes a rate of 1,500 NGN per USD, a 100 NGN deposit fee
and a 0.1 USDC payout fee. These values are illustrative; use your response's
current rate, fees and expiry.

```json 200 OK theme={"dark"}
{
  "source_currency": "NGN",
  "destination_currency": "USDC",
  "source_amount": "150000.00",
  "destination_amount": "99.833333",
  "chain": "BASE",
  "side": "BUY",
  "rate": "1500.00000000",
  "rate_unit": "NGN_PER_USD",
  "rate_id": "550e8400-e29b-41d4-a716-446655440000",
  "fees": [
    { "type": "DEPOSIT", "amount": "100.00", "currency": "NGN" },
    { "type": "CRYPTO_PAYOUT", "amount": "0.100000", "currency": "USDC" }
  ],
  "is_estimate": true,
  "expires_at": "2026-10-27T12:05:00Z"
}
```

| Field | Meaning |
| - | - |
| `source_currency`, `source_amount` | Normalized input currency and total source budget. |
| `destination_currency`, `destination_amount` | Output currency and net customer payout after the included fees. |
| `chain` | Crypto network used for this preview. |
| `side` | `BUY` for NGN to crypto; `SELL` for crypto to NGN. Selected automatically. |
| `rate` | Effective merchant FX rate as a decimal string. Includes the FX spread. |
| `rate_unit` | Always `NGN_PER_USD`, for either token and direction. |
| `rate_id` | Merchant-owned rate snapshot ID. Use only where the funding-account contract accepts it. |
| `fees` | Itemized fee objects with `type`, decimal-string `amount` and `currency`. |
| `is_estimate` | Always `true`. The quote does not lock the final payout. |
| `expires_at` | Rate expiry in RFC 3339 format. |

Amounts are decimal strings: NGN uses two decimal places and crypto/USD uses six.
The rate uses eight decimal places.

### Rates and fee currencies

The preview uses **NGN/USD BUY** for onramp and **USD/NGN SELL** for offramp,
matching funding settlement without a locked rate. USDC and USDT follow the
existing USD settlement accounting. A token-specific rate from `GET /v1/rates`
can differ from the USD rate used here.

| Fee type | Currency |
| - | - |
| `DEPOSIT` | NGN |
| `CRYPTO_PAYOUT` | Destination token, USDC or USDT |
| `BANK_PAYOUT` | NGN |
| `DEVELOPER` | USD |

Do not sum fees with different currencies. The FX spread is already included
in `rate`. Sender bank fees and wallet gas paid outside Daya are excluded.
The final NGN bank payout must be at least NGN 100.

## Use the preview in a payment flow

1. Request a preview for the intended source amount, currencies, chain and developer fee.
2. Show `destination_amount`, the fee breakdown and rate expiry to the customer.
3. Create the [funding account](https://docs.daya.co/api-reference/funding-accounts/create-funding-account.md)
   using the existing transaction contract. For temporary flows that accept a
   rate ID, pass the returned `rate_id` in `settlement_destination.rate_id`.
4. Follow the funding-account response for the exact amount and payment deadline.
   Track the actual result through [deposits](https://docs.daya.co/api-reference/deposits/list-deposits.md)
   and [deposit webhooks](https://docs.daya.co/api-reference/webhooks/events.md).

Permanent funding accounts reject `rate_id` and use the current USD-pair rate
at settlement. A temporary rate lock does not freeze all fees or guarantee
settlement. Refresh the preview when inputs change or the rate expires.

The endpoint does not accept `rate_id` or `quote_id`, calculate a source amount
from a desired destination amount, or preview internal merchant/customer balance
settlement. Use it for NGN-to-wallet and crypto-to-NGN-bank payout previews.

## Errors

| Status | Meaning |
| - | - |
| `400` | Invalid JSON, unknown fields, unsupported pair/network, invalid amount or developer fee, or an amount outside settlement limits. Includes amounts too small after fees. |
| `401` | Missing or invalid API key. |
| `403` | Inactive merchant or insufficient API-key permissions. |
| `503` | Pricing is paused, unavailable or expired, or the quote fee configuration is invalid. |
| `500` | A pricing dependency or fee schedule could not be loaded. |

Errors use the standard `error` envelope. No partial quote is returned.

## Related endpoints

* [Retrieve exchange rates](https://docs.daya.co/api-reference/rates/get-rates.md)
* [Get the fee schedule](https://docs.daya.co/api-reference/fees/get-fees.md)
* [Create a funding account](https://docs.daya.co/api-reference/funding-accounts/create-funding-account.md)


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