# Record a bank-transfer (or other offline) payment

`POST /api/v1/invoices/{id}/record-payment`

Requires an `Idempotency-Key` header and the `invoices.write` capability. Settles the invoice like a card payment: a past_due subscription with nothing else owed returns to active, and reminders stop. No partial payments.

Needs the `invoices:write` scope, or a full-access key.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | required |  |

## Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | required | Required. A unique value for this operation, chosen by you. A retry with the same key and the same body returns the first response instead of running again. The same key with a different body answers 409 `idempotency_key_reused`; a key whose first request is still running answers 409 `idempotency_in_progress`. |

## Request body

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "method": {
      "type": "string",
      "enum": [
        "bank_transfer",
        "cash",
        "cheque",
        "other"
      ],
      "default": "bank_transfer"
    },
    "reference": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "The bank reference (or receipt / cheque number). Repeating it is a no-op."
    },
    "amount_cents": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "description": "A JSON integer in minor units (not a string). Defaults to the amount due; anything else is refused."
    },
    "received_on": {
      "type": "string",
      "format": "date"
    }
  },
  "required": [
    "reference"
  ]
}
```

## Responses

### 200

The invoice is paid. Emits `invoice.paid` and `payment.succeeded` (method = the recorded method) once per invoice; a repeat with the same reference changes nothing and returns the recorded payment.

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "invoice_id": {
          "type": "string",
          "format": "uuid",
          "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
        },
        "status": {
          "type": "string",
          "enum": [
            "paid"
          ]
        },
        "manual_payment": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "format": "uuid",
              "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
            },
            "method": {
              "type": "string",
              "enum": [
                "bank_transfer",
                "cash",
                "cheque",
                "other"
              ]
            },
            "reference": {
              "type": "string"
            },
            "amount_cents": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "The amount recorded (the amount due).",
              "example": "1999"
            },
            "received_on": {
              "type": "string",
              "format": "date"
            }
          },
          "required": [
            "id",
            "method",
            "reference",
            "amount_cents",
            "received_on"
          ]
        }
      },
      "required": [
        "invoice_id",
        "status",
        "manual_payment"
      ]
    },
    "_agent": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "ok"
          ]
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "summary",
        "status",
        "next_actions",
        "warnings"
      ]
    },
    "api_version": {
      "type": "string",
      "example": "2026-07-01"
    }
  },
  "required": [
    "data",
    "_agent",
    "api_version"
  ]
}
```

### 400

No `Idempotency-Key` header (required).

### 409

`invoice_already_paid` (paid by a card, or a transfer with another reference), or `invalid_transition` (draft, void or uncollectible).

### 422

`amount_mismatch` (not exactly the amount due), or a malformed body (`amount_cents` must be a positive JSON integer).
