Sales orders
Orders before they are invoiced, and the two events that invoice them.
This page as plain text: sales-orders.md
GET/v1/sales-orders
Pull sales orders out
Orders with their lines, in one call. Filter by status, origin, payment status, or what changed since a moment.
Each order says whether it is paid: payment_status (UNPAID, PART_PAID, PAID), amount_paid, outstanding, paid_at (the date of the bank line that paid it), bank_reference, invoice_no and invoice_external_ref. A bank line carrying the order number and its total to the cent invoices the order (invoiced_on_event PAYMENT) and pays it with no person; anything less certain waits on the reconcile screen.
Polling: send the reply's as_of back as since. Orders changed or paid after it come back, oldest change first.
Parameters
| Name | In | Required | What it is |
|---|---|---|---|
status | query | ||
origin | query | ||
paymentStatus | query | ||
since | query | Orders changed or paid after this moment (ISO 8601). A plain date means its midnight. | |
limit | query |
Answers
200 | count, as_of, and sales_orders: each with its lines, invoice_no and invoice_external_ref when invoiced, invoiced_on_event, total_incl_tax, amount_paid, outstanding, payment_status, paid_at, bank_reference, updated_at |
Example
curl -X GET 'https://api.reconsmith.com/v1/sales-orders' \
-H 'Authorization: Bearer $RECONSMITH_KEY'
POST/v1/sales-orders
Push sales orders in
An order is PRE-LEDGER: no journal, no control account, no number an auditor will ask about. That is why it can be deleted outright, and why its numbering may gap freely.
order_no is optional. Supply your own and ReconSmith keeps it; omit it and ReconSmith mints one (SO-000001). Both are correct — a system with its own order numbering should keep it, and a company with no upstream system needs ReconSmith to number its own. The same freedom is deliberately NOT given to invoice numbers.
An order raises no invoice. That happens on exactly two events: payment confirmed, or fulfilment.
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 | Your identifier for the order. |
customer_external_ref | string | Your customer id. Preferred. | |
account_code | string | ||
order_no | string | Yours, or omit it and one is minted. | |
order_date | string (date) | ||
origin | string: MANUAL, TELEMETRY, ACO, API, PORTAL | How the order arrived, so a human can see which were raised by a device. Default "API". | |
reference | string | ||
notes | string | ||
source_system | string | Your system's name, the same on every call (for example shop). Identifies your references. | |
lines | array of object | yes | |
lines[].description | string | yes | |
lines[].quantity | number | Default 1. | |
lines[].unit_price | number | ||
lines[].tax_amount | number | ||
lines[].account_code | string | ||
lines[].branch_id | string (uuid) | ||
lines[].site_id | string (uuid) | ||
lines[].dimensions | object |
Answers
201 | Created; each result carries sales_order_id and order_no |
Example
curl -X POST 'https://api.reconsmith.com/v1/sales-orders' \
-H 'Authorization: Bearer $RECONSMITH_KEY' \
-H 'Idempotency-Key: 7c1d0c2e-0b55-4f3a-9a51-1d2f4b6c8e90' \
-H 'Content-Type: application/json' \
-d '[
{
"external_ref": "string",
"lines": [
{
"description": "string"
}
]
}
]'
POST/v1/sales-orders/{externalRef}/fulfil
Fulfilment — event two of the two that raise an invoice
Your system says the order was fulfilled; ReconSmith raises the invoice from the order's own lines and takes the next tax invoice number. Idempotent: an order already invoiced (because it was paid up front) returns the invoice it has rather than a second one.
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. |
externalRef | path | yes | |
sourceSystem | query | Your system's name, the same on every call (for example shop). Identifies your references. |
Body
| Field | Type | Required | What it is |
|---|---|---|---|
doc_date | string (date) | ||
due_date | string (date) |
Answers
201 | invoice_id, invoice_no, invoiced_on_event |
404 | Unknown order |
Example
curl -X POST 'https://api.reconsmith.com/v1/sales-orders/EXTERNALREF/fulfil' \
-H 'Authorization: Bearer $RECONSMITH_KEY' \
-H 'Idempotency-Key: 7c1d0c2e-0b55-4f3a-9a51-1d2f4b6c8e90' \
-H 'Content-Type: application/json' \
-d '{
"doc_date": "2026-12-01",
"due_date": "2026-12-01"
}'
POST/v1/sales-orders/{externalRef}/payment-confirmation
Gateway says paid — event one of the two
The gateway's word, NOT the bank's. Raises the invoice if the order has none, posts the receipt into that gateway's CLEARING account, and allocates it. The bank is untouched: no cash is claimed until the settlement actually lands, so the bank reconciliation is never out by money in transit.
Idempotent on (gateway, gateway_ref): a retried webhook returns the same invoice and receipt rather than paying twice. A later fulfilment of the same order raises nothing new.
The clearing balance is 'money the gateway owes us'. Anything past the gateway's settlement window shows as overdue in GET /v1/gateway-payments, and that total ties to the clearing account on the trial balance — so the exceptions list cannot quietly disagree with the books.
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. |
externalRef | path | yes | |
sourceSystem | query | Your system's name, the same on every call (for example shop). Identifies your references. |
Body
| Field | Type | Required | What it is |
|---|---|---|---|
gateway_code | string | yes | e.g. LESAKA |
paid_with | string | The gateway's payment type: Visa, Mastercard, MasterPass, EFT_OZOW. Ozow and Masterpass are paid out one payment at a time, so such a payment waits for its own bank line. | |
amount | number | yes | Gross, as the customer paid it. Fees are handled at settlement. |
gateway_ref | string | yes | The gateway's own transaction id. The idempotency key for this payment. |
confirmed_at | string (date-time) |
Answers
201 | invoice_no, receipt_id, status IN_TRANSIT |
404 | Unknown order |
422 | Unknown or inactive gateway |
Example
curl -X POST 'https://api.reconsmith.com/v1/sales-orders/EXTERNALREF/payment-confirmation' \
-H 'Authorization: Bearer $RECONSMITH_KEY' \
-H 'Idempotency-Key: 7c1d0c2e-0b55-4f3a-9a51-1d2f4b6c8e90' \
-H 'Content-Type: application/json' \
-d '{
"gateway_code": "string",
"amount": 100,
"gateway_ref": "string"
}'
GET/v1/sales-orders/{externalRef}
One sales order, and whether it is paid
The same shape as one entry of GET /v1/sales-orders.
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 | The order |
404 | Unknown order |
Example
curl -X GET 'https://api.reconsmith.com/v1/sales-orders/EXTERNALREF' \
-H 'Authorization: Bearer $RECONSMITH_KEY'
DELETE/v1/sales-orders/{externalRef}
Delete or cancel an un-invoiced order
An order with no invoice simply goes — lines cascade with it. Nothing downstream ever saw it.
Pass cancelOnly=true to keep the row with status CANCELLED instead.
Once the order has an invoice this refuses: at that point it is part of a document trail, and a credit note is the only correct answer. POST /v1/credit-notes.
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. | |
cancelOnly | query | ||
reason | query |
Answers
200 | Deleted or cancelled |
404 | Unknown order |
422 | The order was invoiced; credit it instead |
Example
curl -X DELETE 'https://api.reconsmith.com/v1/sales-orders/EXTERNALREF' \
-H 'Authorization: Bearer $RECONSMITH_KEY'