ReconSmiths Developers Your API keys

Reference

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

NameInRequiredWhat it is
Idempotency-KeyheaderyesRequired 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

FieldTypeRequiredWhat it is
external_refstringyes
customer_external_refstring
account_codestring
doc_datestring (date)yes
amountnumberyesPositive. A refund is a credit note plus a payment out, never a negative receipt.
bank_account_idstring (uuid)Omit and the entity's active bank account is used.
referencestring
source_systemstringYour system's name, the same on every call (for example shop). Identifies your references.

Answers

201Created
422Rejected 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

NameInRequiredWhat it is
Idempotency-KeyheaderyesRequired 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

FieldTypeRequiredWhat it is
payment_external_refstringyes
invoice_external_refstringyes
amountnumberyes

Answers

201Allocated
422Over-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

NameInRequiredWhat it is
externalRefpathyes
sourceSystemqueryYour system's name, the same on every call (for example shop). Identifies your references.

Answers

200credit_available, marked_for_refund, spendable_on_next_order, documents
404Unknown 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

NameInRequiredWhat it is
sourceSystemqueryYour system's name, the same on every call (for example shop). Identifies your references.
refundOnlyqueryOnly credits the customer has asked to have refunded.
knownOnlyqueryDefault true: only customers that have an external reference in this source system. false returns every open credit, including customers you have never pushed.

Answers

200total_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'