# Create a quote

> Lock a conversion rate for 15 minutes.

`POST https://api.camelpayment.com/v1/fx/quotes`

Create a payment for target_amount in target_currency, with fx_quote_id set to the quote id, before expires_at.

## Body parameters

- `amount` (integer, required): The price, in the source currency's minor units.
- `source_currency` (string, required): The pricing currency.
- `target_currency` (string, required): The currency to charge in. Must differ from source_currency.

## Request

**cURL**

```bash
curl -X POST https://api.camelpayment.com/v1/fx/quotes \
  -H "Authorization: Bearer $CAMEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 10000,
    "source_currency": "USD",
    "target_currency": "ARS"
  }'
```

**Node.js**

```javascript
const response = await fetch('https://api.camelpayment.com/v1/fx/quotes', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CAMEL_API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "amount": 10000,
    "source_currency": "USD",
    "target_currency": "ARS"
  })
});
const data = await response.json();
```

**Python**

```python
import os
import requests

response = requests.post(
    "https://api.camelpayment.com/v1/fx/quotes",
    headers={
        "Authorization": f"Bearer {os.environ['CAMEL_API_KEY']}",
    },
    json={
        "amount": 10000,
        "source_currency": "USD",
        "target_currency": "ARS"
    },
)
data = response.json()
```

## Response

**201**

```json
{
  "id": "fxq_01JBXA7K2M4N6P8R0T2V4X6Z8B",
  "object": "fx_quote",
  "source_amount": 10000,
  "source_currency": "USD",
  "target_amount": 15400000,
  "target_currency": "ARS",
  "rate": "1540.0000000000",
  "market_rate": "1540.0000000000",
  "spread_bps": 0,
  "rates_as_of": "2026-11-12T15:00:00Z",
  "expires_at": "2026-11-12T15:19:05Z",
  "created_at": "2026-11-12T15:04:05Z"
}
```

## Errors

| Status | When |
| --- | --- |
| `401` | The API key is missing, malformed, or revoked. |
| `422` | A currency is not supported, or both currencies are the same. |
| `429` | Too many requests. Wait for Retry-After seconds. |
| `503` | Exchange rates are temporarily unavailable. |
