---
search:
  tags:
    - Currency
    - POST
seo:
  description: >-
    Admin only. Files a rate for one ordered pair. Rates are append only, so a…
    Reference for the POST /api/v1/currency/rates endpoint in the PharmaFlow
    API.
sidebar:
  label: File an exchange rate
  badge: POST
title: File an exchange rate
type: openapi-operation
---
Admin only. Files a rate for one ordered pair. Rates are append only, so a correction is another POST and a frozen sale keeps its rate.

`POST /api/v1/currency/rates`

**Request body** (`application/json`, required)

- `base_code` (string, required)
- `quote_code` (string, required)
- `rate` (number, required)
- `effective_at` (string)
- `source` (string)

Request body example:

```json
{
  "base_code": "string",
  "quote_code": "string",
  "rate": 1,
  "effective_at": "string",
  "source": "string"
}
```

**Responses**

- `201` — Rate filed
- `400` — base\_code or quote\_code is missing, the pair is a currency against itself, a currency is unknown or inactive, or the rate is not positive
- `403` — Caller is not an admin

Response example, 201:

```json
{
  "id": "string",
  "base_code": "string",
  "quote_code": "string",
  "rate": 0,
  "source": "string",
  "effective_at": "string",
  "created_at": "string"
}
```
