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

# Quotes

> Price a transfer. A quote is stored on the server and used once.

`POST /v1/quotes`

<ParamField body="route" type="string" required>
  The route ID. See [Routes](/api-reference/routes).
</ParamField>

<ParamField body="amount_in" type="string" required>
  Amount to send, in source base units.
</ParamField>

<ParamField body="source_chain" type="string" required>
  CAIP-2 ID of the source chain.
</ParamField>

<ParamField body="source_address" type="string" required>
  Deposits: the EVM address that funds the transfer. Withdrawals and sends: the owner's Stellar address.
</ParamField>

<ParamField body="dest_address" type="string" required>
  Deposits: must equal the owner. Withdrawals: an address valid on `dest_chain`. Sends: a Stellar address.
</ParamField>

<ParamField body="dest_chain" type="string">
  Withdrawals: CAIP-2 ID of the destination chain.
</ParamField>

<ParamField body="funding_mode" type="string">
  Deposits: `deposit_address` or `direct`.
</ParamField>

## Response

SEP-38 fields.

<ResponseField name="id" type="string">The quote ID. Pass it to `POST /v1/transfers`.</ResponseField>
<ResponseField name="expires_at" type="string">After this, the quote cannot be used.</ResponseField>
<ResponseField name="sell_asset" type="string">What the user sends.</ResponseField>
<ResponseField name="buy_asset" type="string">What the user receives.</ResponseField>
<ResponseField name="sell_amount" type="string">Base units of `sell_asset`.</ResponseField>
<ResponseField name="buy_amount" type="string">Minimum base units of `buy_asset`.</ResponseField>
<ResponseField name="price" type="string">`buy_amount` per unit of `sell_amount`.</ResponseField>

<ResponseField name="fee" type="object">
  <Expandable title="fields">
    <ResponseField name="total" type="string">User-paid fees, in `asset` base units.</ResponseField>
    <ResponseField name="asset" type="string">The fee asset.</ResponseField>
    <ResponseField name="details" type="object[]">Each fee by `name` and `amount`. Pesa-paid fees are listed separately from user fees.</ResponseField>
  </Expandable>
</ResponseField>

```bash theme={null}
curl -X POST https://api.pesapay.xyz/v1/quotes \
  -H "authorization: Bearer $TOKEN" -H "content-type: application/json" \
  -d '{
    "route": "cctp-deposit",
    "amount_in": "20000000",
    "source_chain": "eip155:8453",
    "source_address": "0x1234...abcd",
    "dest_address": "GABC...XYZ",
    "funding_mode": "direct"
  }'
```

## Errors

| Status | When |
| - | - |
| `400` | A field is missing, an address is invalid for its chain, the chain is not enabled, the amount is outside the route's limits, or `deposit_address` was asked for on a chain with no sponsored deposit address |
| `403` | A deposit's `dest_address` is not the signed-in owner |
| `503` | The chain is enabled but its relayer is not available right now |


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