# Record a payment received against an invoice (a bank transfer, cash)

`POST /invoices/{id}/payments` · Rivier · shop

Record a payment received against an invoice (a bank transfer, cash); idempotent on the key. Marking an invoice paid is a person's decision.

- Scope: shop:write
- Sdk: shop.invoice.recordPayment
- Cli: shop invoice record payment

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "amountMinor": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 99999999999
    },
    "method": {
      "type": "string",
      "enum": [
        "manual",
        "provider"
      ],
      "default": "manual"
    },
    "paymentId": {
      "type": "string",
      "format": "uuid"
    },
    "receivedAt": {
      "type": "string",
      "format": "date-time"
    },
    "ref": {
      "type": "string",
      "maxLength": 120,
      "default": ""
    },
    "note": {
      "type": "string",
      "maxLength": 300,
      "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/invoices/{id}/payments' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "amountMinor": 0,
  "idempotencyKey": "string"
}'
```
