# Payments and allocations

Money received is two separate facts: **the receipt** (money arrived) and **the allocation** (which invoices it paid). Keeping them apart is what lets one payment clear four invoices, or sit on the account until somebody knows what it was for.

These calls move money, so the key needs the `money` scope.

## Recording money received

`POST /v1/payments`:

```json
[{"external_ref": "PAY-9001", "customer_external_ref": "CUST-1001", "doc_date": "2026-12-03",
  "amount": 1150.00, "reference": "ORD-5001"}]
```

The bank account is the company's default unless you send `bank_account_id`. A receipt with nothing allocated is a valid state: post it when the money arrives, allocate when you know what it paid. A refund is never a negative receipt; it is a credit note and a refund (below).

> Most companies do not need to post receipts at all: the bank statement comes into ReconSmiths, and the reconcile screen matches each bank line to its invoices by the reference. Post receipts only when your system is where the money is first known.

## Saying what it paid

`POST /v1/allocations`, one row per invoice:

```json
[{"payment_external_ref": "PAY-9001", "invoice_external_ref": "ORD-5001", "amount": 1150.00}]
```

Over-allocating - more than the receipt has left or more than the invoice owes - is refused by the ledger. A credit note is allocated to an invoice the same way, with the credit note's ref as `payment_external_ref`.

## One payment for several invoices

When a customer pays several invoices in one go under one number (a remittance), record it first with `POST /v1/remittances` - its number, total and the invoices it covers. When the money comes, the bank line or the gateway confirmation carrying that number settles every invoice in it. See the [Remittances reference](../reference/remittances.html).

## Credit, and paying it back

- `GET /v1/credits` lists every unused credit for your customers. `GET /v1/customers/{externalRef}/credit` is one customer's, ready to show in an app.
- The customer wants the money instead: `POST /v1/credit-notes/{externalRef}/refund-request` flags it (a flag, nothing moves; `DELETE` the same path if they change their mind).
- The money leaves: `POST /v1/credit-notes/{externalRef}/refund` records the refund paid from the bank. Leave out `amount` to refund all that is unused.
