# Record an expense (a person's is booked at once

`POST /accounting/expenses` · Rivier · accounting

Record an expense (a person's is booked at once; a key's is a proposal a person confirms).

- Scope: accounting:write
- Mcp: rivier_accounting_expense_propose
- Graphql: Mutation.accountingProposeExpense
- Sdk: accounting.expense.create
- Cli: accounting expense create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "spentOn": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "merchant": {
      "type": "string",
      "maxLength": 200,
      "default": ""
    },
    "description": {
      "type": "string",
      "maxLength": 300,
      "default": ""
    },
    "account": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
    },
    "paidFrom": {
      "type": "string",
      "maxLength": 40,
      "description": "bank, card or cash account code; default the main bank account"
    },
    "currency": {
      "type": "string",
      "pattern": "^[a-z]{3}$"
    },
    "grossMinor": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 99999999999
    },
    "taxRateBp": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000,
      "default": 0
    },
    "taxCategory": {
      "type": "string",
      "enum": [
        "S",
        "Z",
        "E",
        "AE",
        "K",
        "G",
        "O",
        "L",
        "M"
      ],
      "default": "S"
    },
    "receiptId": {
      "type": "string",
      "format": "uuid"
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    }
  },
  "required": [
    "spentOn",
    "account",
    "grossMinor",
    "idempotencyKey"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: 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/expenses' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "spentOn": "string",
  "account": "string",
  "grossMinor": 0,
  "idempotencyKey": "string"
}'
```
