# Set an exchange rate for a day

`PUT /accounting/rates` · Rivier · accounting

Set an exchange rate for a day.

- Scope: accounting:admin
- Sdk: accounting.rate.set
- Cli: accounting rate set

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "currency": {
      "type": "string",
      "pattern": "^[a-z]{3}$"
    },
    "onDate": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "rate": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 1000000
    }
  },
  "required": [
    "currency",
    "onDate",
    "rate"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PUT 'https://api.rivier.ai/accounting/rates' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "currency": "string",
  "onDate": "string",
  "rate": 0
}'
```
