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

> This endpoint creates a new exchange rate.

# Create Rates

```json theme={null}
POST /exchange/rates
```

#### **Request**

* **Headers**:
  `Content-Type: application/json`
* **Body** (required):

```json theme={null}
{
  "buy": 100,
  "pair": "USD-NGN",
  "sell": 75000,
  "ttl": 60
}
```

* buy (integer): Buy amount in base currency.
* pair (string): Currency pair (e.g., "USD-NGN").
* sell (integer): Sell amount in quote currency.
* ttl (integer): Time-to-live for the rate, in seconds.

#### **Sample Response**

1. **201 Created**
   * **Media Type**: `application/json`

```json theme={null}
{
  "data": {
    "buy": 1200,
    "created_at": "2025-01-21T11:56:45Z",
    "entity": {
      "id": "397752fb-92e6-404a-b6e4-d9d72f1379f9",
      "type": "business"
    },
    "id": "83b16397-d524-4619-b30f-e5e77b1b8d17",
    "pair": "USD-NGN",
    "sell": 1100,
    "ttl": 60,
    "updated_at": "2025-01-21T11:56:46Z"
  }
}
```

1. **422 Unprocessable Entity**

* **Media Type**: `application/json`
* Indicates validation errors or invalid request parameters.
