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

# Get quote

> Get a priced off-ramp quote with source and destination amounts

**POST `/offramp/quote`** endpoint returns a quote for converting a supported stablecoin to local currency, including the applied rate, how much the user sends and receives, settlement timing, and when the quote expires.

## Example Request

<CodeGroup>
  ```bash cURL theme={"dark"}
  curl -L \
    --request POST \
    --url 'https://api.onswitch.xyz/offramp/quote' \
    --header 'x-service-key: YOUR_SERVICE_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "amount": 100,
      "country": "NG",
      "asset": "base:usdc",
      "currency": "NGN",
      "channel": "BANK",
      "exact_output": false,
      "developer_fee": 0.5
    }'
  ```

  ```javascript Node.js theme={"dark"}
  const res = await fetch('https://api.onswitch.xyz/offramp/quote', {
    method: 'POST',
    headers: {
      'x-service-key': process.env.YOUR_SERVICE_KEY,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      amount: 100,
      country: 'NG',
      asset: 'base:usdc',
      currency: 'NGN',
      channel: 'BANK',
      exact_output: false,
      developer_fee: 0.5,
      developer_recipient: '0x1234567890123456789012345678901234567890',
    }),
  });

  const body = await res.json();
  const { data } = body;
  console.log(
    `${data.source.amount} ${data.source.currency} → ${data.destination.amount} ${data.destination.currency} (rate ${data.rate}, expires ${data.expiry})`
  );
  ```

  ```python Python theme={"dark"}
  import os, json, urllib.request

  payload = {
      "amount": 100,
      "country": "NG",
      "asset": "base:usdc",
      "currency": "NGN",
      "channel": "BANK",
      "exact_output": False,
      "developer_fee": 0.5,
      "developer_recipient": "0x1234567890123456789012345678901234567890",
  }

  req = urllib.request.Request(
      "https://api.onswitch.xyz/offramp/quote",
      data=json.dumps(payload).encode(),
      method="POST",
      headers={
          "x-service-key": os.environ["YOUR_SERVICE_KEY"],
          "Content-Type": "application/json",
      },
  )

  with urllib.request.urlopen(req, timeout=30) as r:
      body = json.load(r)
      d = body["data"]
      print(
          f"{d['source']['amount']} {d['source']['currency']} → "
          f"{d['destination']['amount']} {d['destination']['currency']} "
          f"(rate {d['rate']}, expires {d['expiry']})"
      )
  ```
</CodeGroup>

<Note>
  `exact_output` (optional, default `false`) controls how `amount` is interpreted. <br /><br /> With `false`, `amount` is the stablecoin you send (`asset`); i.e. the quote computes how much local currency (`currency`) the user receives. <br /><br /> With `true`, `amount` is the local currency to deliver; i.e. the quote computes how much stablecoin must be sent.
</Note>

<Note>
  `developer_fee` (optional) is a percentage between 0 and 100 taken as your fee from the payment amount. <br /><br /> Omit the fee or set it to 0 if you are not charging your own fee.
</Note>

### Example Response

```json theme={"dark"}
{
  "success": true,
  "message": "Offramp quote fetched successfully",
  "timestamp": "2026-03-31T03:05:43.257Z",
  "data": {
    "expiry": "2026-03-31T04:10:43+01:00",
    "settlement": "5-10 minutes",
    "channel": "BANK",
    "rate": 1409.758,
    "source": {
      "amount": 100,
      "currency": "USDC",
      "network": "BASE"
    },
    "destination": {
      "amount": 140975.8,
      "currency": "NGN",
      "network": "FIAT"
    }
  }
}
```

<Note>
  Quotes expire at `data.expiry`. Market conditions can change; create the transaction promptly after fetching a quote, or request a fresh quote if it has expired.
</Note>

## Need Help?

<CardGroup cols={2}>
  <Card title="Email Support" icon="mail" href="mailto:contact@onswitch.xyz">
    Send us a message.
  </Card>

  <Card title="Book a call" icon="calendar" href="https://calendly.com/contact-onswitch/30min">
    Hop on a call with us.
  </Card>
</CardGroup>
