Payments and allocations
Money received, and which invoices it paid.
This page as plain text: payments.md
POST/v1/payments
Post receipts in bulk
Posts through the ledger's receipt function: Dr bank, Cr receivables control, one balanced journal. The receipt number is minted here. A receipt with nothing allocated to it is a legitimate state — push it when the money arrives and allocate when you know what it paid.
Parameters
| Name | In | Required | What it is |
|---|---|---|---|
Idempotency-Key | header | yes | Required on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422. |
Body a JSON array of these, up to 1 000 per call
| Field | Type | Required | What it is |
|---|---|---|---|
external_ref | string | yes | |
customer_external_ref | string | ||
account_code | string | ||
doc_date | string (date) | yes | |
amount | number | yes | Positive. A refund is a credit note plus a payment out, never a negative receipt. |
bank_account_id | string (uuid) | Omit and the entity's active bank account is used. | |
reference | string | ||
source_system | string | Your system's name, the same on every call (for example shop). Identifies your references. |
Answers
201 | Created |
422 | Rejected by the ledger |
Example
curl -X POST 'https://api.reconsmith.com/v1/payments' \
-H 'Authorization: Bearer $RECONSMITH_KEY' \
-H 'Idempotency-Key: 7c1d0c2e-0b55-4f3a-9a51-1d2f4b6c8e90' \
-H 'Content-Type: application/json' \
-d '[
{
"external_ref": "string",
"doc_date": "2026-12-01",
"amount": 100
}
]'
POST/v1/allocations
Allocate payments to invoices
Line-granular settlement. One R20 000 receipt clearing four invoices is four allocations, and the statement shows all four under the receipt. Over-allocating is refused by the database, not by the caller's discipline.
Parameters
| Name | In | Required | What it is |
|---|---|---|---|
Idempotency-Key | header | yes | Required on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422. |
Body a JSON array of these, up to 1 000 per call
| Field | Type | Required | What it is |
|---|---|---|---|
payment_external_ref | string | yes | |
invoice_external_ref | string | yes | |
amount | number | yes |
Answers
201 | Allocated |
422 | Over-allocation or wrong direction |
Example
curl -X POST 'https://api.reconsmith.com/v1/allocations' \
-H 'Authorization: Bearer $RECONSMITH_KEY' \
-H 'Idempotency-Key: 7c1d0c2e-0b55-4f3a-9a51-1d2f4b6c8e90' \
-H 'Content-Type: application/json' \
-d '[
{
"payment_external_ref": "string",
"invoice_external_ref": "string",
"amount": 100
}
]'
GET/v1/customers/{externalRef}/credit
Customer credit — what the app shows
Credit the customer can spend on the next order, how much of it they asked to have refunded instead, and the documents behind the number so the app can say where each credit came from. Use it to apply a credit to the next order rather than refunding it.
Parameters
| Name | In | Required | What it is |
|---|---|---|---|
externalRef | path | yes | |
sourceSystem | query | Your system's name, the same on every call (for example shop). Identifies your references. |
Answers
200 | credit_available, marked_for_refund, spendable_on_next_order, documents |
404 | Unknown customer |
Example
curl -X GET 'https://api.reconsmith.com/v1/customers/EXTERNALREF/credit' \
-H 'Authorization: Bearer $RECONSMITH_KEY'
GET/v1/credits
Unused customer credit
Every credit still unused, for customers the caller knows. Scoped by the CUSTOMER's external reference, not the document's: a credit note a bookkeeper typed into the office for one of your customers is that customer's credit, and your app should show it alongside the ones you pushed. raised_via says which screen it came from (OFFICE, or your system, …).
A credit note that was applied to an invoice has done its job and does not appear.
Each row carries document_id and doc_no as well as external_ref, so an office-raised credit with no external_ref can still be addressed by the refund endpoints.
Per customer, use GET /v1/customers/{ref}/credit instead.
Parameters
| Name | In | Required | What it is |
|---|---|---|---|
sourceSystem | query | Your system's name, the same on every call (for example shop). Identifies your references. | |
refundOnly | query | Only credits the customer has asked to have refunded. | |
knownOnly | query | Default true: only customers that have an external reference in this source system. false returns every open credit, including customers you have never pushed. |
Answers
200 | total_unused, total_refund_requested, and the credits with unused, refund_requested, refund_requested_at, refund_note and raised_via |
Example
curl -X GET 'https://api.reconsmith.com/v1/credits' \
-H 'Authorization: Bearer $RECONSMITH_KEY'