ReconSmiths Developers Your API keys

Reference

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

NameInRequiredWhat it is
statusquery
originquery
paymentStatusquery
sincequeryOrders changed or paid after this moment (ISO 8601). A plain date means its midnight.
limitquery

Answers

200count, 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

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_refstringyesYour identifier for the order.
customer_external_refstringYour customer id. Preferred.
account_codestring
order_nostringYours, or omit it and one is minted.
order_datestring (date)
originstring: MANUAL, TELEMETRY, ACO, API, PORTALHow the order arrived, so a human can see which were raised by a device. Default "API".
referencestring
notesstring
source_systemstringYour system's name, the same on every call (for example shop). Identifies your references.
linesarray of objectyes
lines[].descriptionstringyes
lines[].quantitynumberDefault 1.
lines[].unit_pricenumber
lines[].tax_amountnumber
lines[].account_codestring
lines[].branch_idstring (uuid)
lines[].site_idstring (uuid)
lines[].dimensionsobject

Answers

201Created; 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

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.
externalRefpathyes
sourceSystemqueryYour system's name, the same on every call (for example shop). Identifies your references.

Body

FieldTypeRequiredWhat it is
doc_datestring (date)
due_datestring (date)

Answers

201invoice_id, invoice_no, invoiced_on_event
404Unknown 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

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.
externalRefpathyes
sourceSystemqueryYour system's name, the same on every call (for example shop). Identifies your references.

Body

FieldTypeRequiredWhat it is
gateway_codestringyese.g. LESAKA
paid_withstringThe 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.
amountnumberyesGross, as the customer paid it. Fees are handled at settlement.
gateway_refstringyesThe gateway's own transaction id. The idempotency key for this payment.
confirmed_atstring (date-time)

Answers

201invoice_no, receipt_id, status IN_TRANSIT
404Unknown order
422Unknown 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

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

Answers

200The order
404Unknown 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

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

Answers

200Deleted or cancelled
404Unknown order
422The order was invoiced; credit it instead

Example

curl -X DELETE 'https://api.reconsmith.com/v1/sales-orders/EXTERNALREF' \
  -H 'Authorization: Bearer $RECONSMITH_KEY'