# Pay a bill

`POST /accounting/bills/{id}/pay` · Rivier · accounting

Pay a bill.

- Scope: accounting:write
- Sdk: accounting.bill.pay
- Cli: accounting bill pay

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "amountMinor": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 99999999999
    },
    "paidOn": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "fromAccount": {
      "type": "string",
      "maxLength": 40,
      "description": "bank or cash account code; default the main bank account"
    },
    "ref": {
      "type": "string",
      "maxLength": 120,
      "default": ""
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    }
  },
  "required": [
    "amountMinor",
    "idempotencyKey"
  ],
  "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 POST 'https://api.rivier.ai/accounting/bills/{id}/pay' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "amountMinor": 0,
  "idempotencyKey": "string"
}'
```
