# ReconSmiths API - complete guide and reference Base URL: https://api.reconsmith.com. Source: https://developer.reconsmith.com. Contract: https://developer.reconsmith.com/openapi.json # Getting started The ReconSmiths API connects your own system - a shop, an ordering app, a point of sale, a job system, a payroll tool - to a company's books. Your system keeps doing what it does; ReconSmiths keeps the ledger: tax invoice numbers, VAT, receivables, statements, reconciliation. ## What you can do - **Push** customers, sales orders, invoices, credit notes, receipts, supplier bills, employees, hours and leave. - **Read** whether an invoice is paid, a customer's statement and ageing, unused credit, and everything that changed since you last asked. - **Fetch** the issued documents - tax invoices, credit notes, statements, payslips - as PDF or as data. - **Be told** when something happens, by webhook: an invoice posted, paid, credited. ## Three things that hold everywhere 1. **Your own references.** You name everything with your own id (`external_ref`). You never need to store ours. 2. **Every write is safe to retry.** Send an `Idempotency-Key` header on writes. If the network drops and you send it again, you get the first answer back, not a second invoice. 3. **The books stay balanced.** Every posting goes through the ledger's own functions: one balanced journal, an open-period check, the next number in the sequence. Something the ledger refuses comes back as `422` with the reason in words. ## Your first call in five minutes 1. Sign in to the office and open **Connected systems**. Create a connection for your system and copy the key. It is shown once. To explore first, connect **Something else**: its key has only the `read` permission, so it can look at everything and change nothing (see [Keys and permissions](02-keys-and-permissions.md)). 2. Find a customer: ```bash curl 'https://api.reconsmith.com/v1/parties/search?q=northwind' \ -H 'Authorization: Bearer $RECONSMITH_KEY' ``` 3. Create one, under your own id: ```bash curl -X POST 'https://api.reconsmith.com/v1/parties' \ -H 'Authorization: Bearer $RECONSMITH_KEY' \ -H 'Idempotency-Key: 0f8e2c1a-first-customer' \ -H 'Content-Type: application/json' \ -d '[{"source_system": "shop", "external_ref": "CUST-1001", "name": "Northwind Trading (Pty) Ltd", "vat_number": "4123456789"}]' ``` 4. Invoice them: ```bash curl -X POST 'https://api.reconsmith.com/v1/invoices' \ -H 'Authorization: Bearer $RECONSMITH_KEY' \ -H 'Idempotency-Key: 5d1b7e90-first-invoice' \ -H 'Content-Type: application/json' \ -d '[{"source_system": "shop", "external_ref": "ORD-5001", "customer_external_ref": "CUST-1001", "doc_date": "2026-12-01", "reference": "ORD-5001", "lines": [{"description": "Consulting, November", "amount_excl_tax": 1000.00, "tax_amount": 150.00}]}]' ``` The answer carries our `document_id`. The invoice number is ReconSmiths' own (for example `INV-00042`): you never send one. 5. Fetch the PDF to send or store: `GET /v1/documents/ORD-5001/pdf?sourceSystem=shop`. ## Where to go next - [Requests, answers and errors](03-requests-answers-and-errors.md) - the rules every call follows. - [Invoices and credit notes](05-invoices-and-credit-notes.md) - the heart of it. - [Every endpoint](../reference/index.html) - the full list, what each does and what it is for. # Keys and permissions Every call (except `/health` and `/v1/openapi.json`) carries an API key: ``` Authorization: Bearer rs_live_... ``` A key belongs to one connection, and a connection belongs to one company. A key can only ever see that company's books. ## Getting a key 1. Sign in at [office.reconsmith.com](https://office.reconsmith.com). 2. Open **Connected systems**. 3. Choose what you are connecting. The kind sets its permissions and the webhook events it can receive: | Kind | Permissions | |---|---| | Online shop | `read`, `write` | | Point of sale | `write` | | Job or field system | `read`, `write` | | Payment provider | `write`, `money` | | Bank feed | `write`, `money` | | Something else | `read` | 4. Copy the key. **It is shown once.** ReconSmiths keeps only a fingerprint of it. ## Exploring safely A key with only the `read` permission can call every `GET` and change nothing. Connect **Something else** to get one, and learn the API against real data before you use a key that writes. ## Permissions (scopes) | Scope | Allows | |---|---| | `read` | Every `GET`. | | `write` | Every `POST`, `PUT` and `DELETE` that does not move money. | | `money` | Writes that move money: receipts (`/v1/payments`), allocations, gateway confirmations and settlements, refunds, accepting a bank match. | A call outside the key's permissions answers `403` and says which scope is missing. Give each system only what it needs: a point of sale that only issues invoices needs `write`, not `money`. ## Rotating a key In **Connected systems**, **Rotate key** issues a new key and keeps the old one working for an overlap (48 hours by default), so you can change your configuration without a gap. The page shows when the old key was last used and when it stops working. ## Usage **Connected systems** shows, for each connection: calls today, the last call, the last error, and the health of its webhooks. There is no daily call limit. ## Keeping keys safe - Keep the key on your server. Never put it in a mobile app or a web page. - One key per system, so you can switch one off without touching the others. - If a key may have leaked, rotate it with a zero overlap. # Requests, answers and errors The rules every endpoint follows. ## Base URL and format - Base URL: `https://api.reconsmith.com` - JSON in, JSON out, UTF-8. - Field names are `snake_case`: `external_ref`, `amount_excl_tax`, `doc_date`. - Path and query parameters are written as in the reference: `/v1/documents/{externalRef}/pdf?sourceSystem=shop`. ## Dates and amounts - Dates are `YYYY-MM-DD` (`2026-12-01`). Moments are ISO 8601 with an offset (`2026-12-01T10:00:00+02:00`). - Amounts are decimal numbers with two places: `1150.00`. Never cents as integers, never strings. - Currency is ISO 4217 (`ZAR`, `EUR`). Left out, it is the company's own currency. - A line sends its amount excluding VAT and its VAT separately (`amount_excl_tax`, `tax_amount`), as printed on the document. ReconSmiths does not recalculate your VAT; it checks the document balances. ## Your references Everything you push carries your own id, `external_ref`, unique per `source_system`. `source_system` names your system (for example `shop`): send the same name on every call - `source_system` in a body, `sourceSystem` in a query - so your references are read as yours. Changing a document (void, notes) also accepts our document number (`INV-00042`) or our id. ## Idempotency: retry without fear Writes that post or change documents and money require an `Idempotency-Key` header (the reference lists it on each one that does): any unique string up to 255 characters, typically a UUID made when you first try the request. A `PUT` that names its record (an employee, a period's hours) is safe to repeat without one. | You send | You get | |---|---| | A new key | The request is carried out. | | The same key and the same body again | The first answer again, word for word. Nothing is done twice. | | The same key with a different body | `422`: the key was already used for something else. | | The same key while the first is still running | `409`: wait and try again. | Keep the key with the thing you are sending, and reuse it on every retry of that thing. Pushes are also matched on your `external_ref`: an invoice you already sent comes back with `created: false` rather than a second copy. ## Batches Bulk endpoints (`/v1/parties`, `/v1/invoices`, `/v1/payments`, `/v1/allocations`, `/v1/credit-notes`, `/v1/purchase-invoices`) take a JSON array of up to 1 000 items. A batch is all or nothing: if one item is refused, nothing in it is posted, and the answer names the item. ## Answers | Code | Means | |---|---| | `200` | Done (reads, and updates that change something in place). | | `201` | Created. The body lists what was created, with our ids. | | `400` | The request is malformed, or the `Idempotency-Key` is missing. | | `401` | No key, or the key is unknown, switched off or expired. | | `403` | The key lacks the permission (scope) this call needs. | | `404` | Nothing matches the reference you gave. | | `409` | Conflicts with the current state (already in flight, already posted, period closed). | | `413` | More than 1 000 items in one call. | | `422` | The ledger refused it. The reason is in the body. | | `502`, `503` | A part behind the API (the document renderer) is unavailable. Try again. | ## Errors are written to be read Every error is an RFC 9457 problem document: ```json { "type": "about:blank", "title": "Unknown customer", "status": 422, "detail": "no party with external_ref 'CUST-1001'. Push it to /v1/parties first." } ``` `title` is the short form, `detail` says what to do about it. Show `detail` to the person who can fix it. ## Paging Lists take `limit` (default and maximum stated per endpoint). The change feed is cursor-paged: pass the `next_cursor` you were given as `since`, and stop when `has_more` is false. Cursors, not page numbers, because rows written while you read would shift a page and you would miss some. # Customers A customer (a "party") is who you invoice. Push them before you invoice them, under your own id. ## Create or update `POST /v1/parties` takes an array. Each party is keyed on your `external_ref`: send the same one again and it is updated, never duplicated. ```json [{ "external_ref": "CUST-1001", "name": "Northwind Trading (Pty) Ltd", "party_type": "ORGANISATION", "vat_number": "4123456789", "company_reg": "2015/123456/07", "email": "accounts@northwind.example", "phone": "+27 11 555 0100", "address": {"street_no": "12", "street": "Main Road", "suburb": "Marshalltown", "city": "Johannesburg", "postal_code": "2001", "country_code": "ZA"} }] ``` The address is sent whole or not at all: it replaces the stored one. **Null leaves it alone, an empty string clears it.** For every optional field, `null` (or leaving it out) keeps what is stored, and `""` clears it. So a sync that does not know a VAT number cannot wipe one somebody typed into the office. A changed name is kept as a rename: old documents keep the name they were issued under, and searches still find the customer by the old name. ## Branches A chain customer with branches: push the head office, then each branch with `parent_external_ref` set to the head office's id. Invoices go to the branch; the statement can be sent per branch or for the whole group. ## A company exists once Two customers with the same VAT number are the same company. Before creating one, search for it. ## Finding a customer `GET /v1/parties/search?q=...` searches names, former names, VAT and company numbers, your ids, our account codes, branch numbers, e-mail addresses and address text. Each hit says what it matched on (`matched_via`), so you can show why it appeared. ## Customers missing details `GET /v1/parties/incomplete` lists customers whose VAT number or address is missing, the ones you invoice most first. A tax invoice above the legal threshold must carry the customer's VAT number and address, so this is the list worth asking about. ## Credit on the account `GET /v1/customers/{externalRef}/credit` gives what the customer can spend on the next order, how much of it they asked to have refunded, and the documents behind the number. See [Payments and allocations](06-payments-and-allocations.md). # Invoices and credit notes ## Issuing an invoice `POST /v1/invoices` posts tax invoices: one balanced journal each, the customer's receivable raised, output VAT recorded. ```json [{ "external_ref": "ORD-5001", "customer_external_ref": "CUST-1001", "doc_date": "2026-12-01", "reference": "ORD-5001", "notes": "Delivered to the Sandton branch", "lines": [ {"description": "Consulting, November", "quantity": 10, "unit_price": 100.00, "amount_excl_tax": 1000.00, "tax_amount": 150.00, "item_code": "CONSULT"} ] }] ``` - **You never send the invoice number.** ReconSmiths takes the next number in the tax invoice sequence inside the posting, so a refused invoice returns its number and the sequence has no gaps. Your order number goes in `reference`: it prints on the invoice and is what the customer pays against. - **Due date** comes from the customer's terms unless you send `due_date`. - **Lines** carry the amount excluding VAT and the VAT, as you printed them. `tax_code` is optional (standard rate by default); send it for zero-rated or exempt lines. `item_code` names a product from [Items](../reference/items.html). `account_code` picks a revenue account other than the default. - **Billing address**: send `billing_address` to freeze the address this order was billed to; otherwise the invoice prints the customer's current address. The answer lists each invoice with our `document_id` and `created` (false when you had already sent it). ## Changing an invoice An issued tax invoice cannot change its amounts, date, customer or currency: that is the law and the ledger. What you can do: | You want to | Do this | |---|---| | Correct the notes line (for example, which site it was for) | `PUT /v1/invoices/{externalRef}/notes` with `{"notes": "..."}`. Number and amounts stay; the change is audited; the next PDF prints it. | | Cancel it entirely | `POST /v1/invoices/{externalRef}/void` with a `reason`. A mirror journal reverses it; the number stays used and shows as void. Refused while a payment or credit note is allocated to it. | | Reduce it, or reverse part of it | A credit note (below). | | Replace it | Void it and issue a new one under a new `external_ref`. | ## Credit notes `POST /v1/credit-notes`, always with a `reason`. Three shapes: 1. **The whole invoice:** `invoice_external_ref`, no lines. The ordinary cancelled-order case. 2. **Part of an invoice:** `invoice_external_ref` plus the lines being credited. 3. **On the account, tied to no invoice:** `customer_external_ref` plus lines. Goodwill, a price correction, a deposit refund. It sits on the account as credit and can be applied to a later invoice with an allocation. Set `mark_for_refund: true` if the customer wants the money back rather than credit; see [Payments and allocations](06-payments-and-allocations.md). A credit note raised in error is voided with `POST /v1/credit-notes/{externalRef}/void`. ## Is it paid? `GET /v1/documents?externalRefs=ORD-5001,ORD-5002` answers for many invoices in one call: outstanding, paid, credited, and what settled it. It is worked out from the allocations every time, so do not store it as a yes/no; ask again, or listen for the `invoice.paid` webhook. References that match nothing come back under `not_found`. ## The document itself `GET /v1/documents/{externalRef}/pdf` is the tax invoice exactly as issued, on the company's letterhead. `GET /v1/documents/{externalRef}/content` is the same as JSON or XML. Fetch the PDF once when the invoice is posted and keep it; fetch again after a credit note or a notes change. # 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. # Sales orders and card payments If your system takes orders and is paid online, let ReconSmiths raise the invoice at the right moment instead of posting invoices yourself. ## Orders come before invoices `POST /v1/sales-orders` records an order. An order is not in the ledger yet: no journal, no tax invoice number. That is why it can be deleted (`DELETE /v1/sales-orders/{externalRef}`) and why order numbers may have gaps. Send your own `order_no`, or leave it out and ReconSmiths numbers it. An order becomes an invoice on whichever happens first: 1. **It is paid.** `POST /v1/sales-orders/{externalRef}/payment-confirmation` when your payment provider says paid. The invoice is raised from the order's lines, the payment is posted and allocated. 2. **It is fulfilled.** `POST /v1/sales-orders/{externalRef}/fulfil` when the goods or service are delivered. The invoice is raised from the order's lines. Both are safe to repeat: an order that already has its invoice returns that invoice. Once an order is invoiced, it can no longer be deleted; a credit note is the answer. `GET /v1/sales-orders` lists orders with whether each is paid (`payment_status`, `amount_paid`, `outstanding`, `paid_at`, `invoice_no`). Filter by `status`, `paymentStatus` or `since`. ## Card money is in transit A payment provider saying "paid" is not money in the bank. ReconSmiths books a card confirmation into the provider's **clearing account**, not the bank, and moves it to the bank only when the provider pays out. This keeps the bank reconciliation exact. | Step | Call | In the books | |---|---|---| | Customer pays by card | `POST /v1/sales-orders/{ref}/payment-confirmation` | Invoice paid; money in the provider's clearing account | | Provider pays out, less its fee | `POST /v1/gateway-settlements` naming the payment refs | Bank receives the net; the fee is an expense; clearing goes to zero | `GET /v1/gateway-payments` lists what is confirmed but not yet in the bank, and what is overdue against the provider's settlement window. Its total equals the clearing account's balance. Instead of calling `/v1/gateway-settlements`, the company can upload the provider's settlement report in the office; it matches the payout's bank line to the payments in the file. ## Remittances A payment covering several orders or invoices at once, under one number: see [Payments and allocations](06-payments-and-allocations.md#one-payment-for-several-invoices). # Documents, statements and sending ## Issued documents | You want | Call | |---|---| | The tax invoice or credit note as a PDF | `GET /v1/documents/{externalRef}/pdf` | | The same document as data | `GET /v1/documents/{externalRef}/content?format=json` (or `xml`) | | Which of your invoices are still open | `GET /v1/documents?externalRefs=a,b,c` | There is one renderer, so the PDF you fetch is the one the office prints and e-mails: same layout, same numbers, the company's letterhead as it stood on the document's date. A draft has no PDF (`409`). ## Customer statements | You want | Call | |---|---| | The statement as data | `GET /v1/customers/{externalRef}/statement` | | The statement as a PDF | `GET /v1/customers/{externalRef}/statement/file` | | Send it now, by e-mail | `POST /v1/customers/{externalRef}/statement/send` | | How this customer receives statements | `GET` / `PUT /v1/customers/{externalRef}/statement-delivery` | | Which statement rule applies (monthly, weekly...) | `GET /v1/statement-rules`, `PUT /v1/customers/{externalRef}/statement-rule` | Each payment line on a statement carries its settlement trace: which invoices it paid, and how much of each. ## Who sends: ReconSmiths, or your system A company chooses how its documents leave: - **ReconSmiths sends** them by e-mail from the company's address. You do nothing. - **Your system sends** them (hand-back), for a company whose customers know your system's address. ReconSmiths prepares each message - the right template, the subject and text in the customer's language, the PDF - and puts it in the **outbox** for you: 1. `GET /v1/outbox` - what is waiting. Poll it. 2. `GET /v1/outbox/{id}/pdf` - the attachment. 3. `POST /v1/outbox/{id}/collected` - you have taken it. 4. `POST /v1/outbox/{id}/sent` (or `/failed` with a reason) - what happened. Report the outcome: "was this invoice sent, to whom and when" is a question the books must answer, whoever sent it. # Purchases Supplier bills from your system - a fleet system's fuel slips, a job system's materials - go straight into the payables. ## Supplier bills `POST /v1/purchase-invoices`: ```json [{ "external_ref": "SLIP-77812", "supplier_doc_no": "INV-3301", "supplier_external_ref": "SUP-12", "doc_date": "2026-12-02", "lines": [{"description": "Diesel 120 l", "amount_excl_tax": 2400.00, "tax_amount": 0, "dimensions": {"VEHICLE": "ND 123-456"}}], "attachments": [{"file_name": "slip.jpg", "content_type": "image/jpeg", "content_base64": "..."}] }] ``` - `supplier_doc_no` is required: it is the supplier's own number, what they will look for on the remittance. If a slip has none, send your `external_ref`. - Attach the supplier's document inline (PDF, PNG, JPEG or WebP), or later with `POST /v1/purchase-invoices/{externalRef}/attachments`. The same file is kept once. ## Supplier credit notes `POST /v1/purchase-credit-notes`, the same shape, with `purchase_invoice_external_ref` naming the bill it credits and a `reason`. It is applied to what is still open on that bill. ## Dimensions Lines can be tagged for reporting - a vehicle, a site, a project. Dimensions are checked on both the key and the value, so a new vehicle must exist before a bill carrying it will post: - `GET /v1/dimensions` - what this company accepts. - `POST /v1/dimensions` - add a dimension or new values. # Staff and payroll For a system that knows who works and when - rostering, time clocks, field apps - while ReconSmiths runs the payroll. ## Employees `PUT /v1/employees/{externalRef}` creates or updates one person under your id. It is a `PUT` because you name the person: sending it again is the same person. `null` leaves a field alone, so a system that does not hold salaries never zeroes them. ## Hours `PUT /v1/employees/{externalRef}/hours/{periodRef}` sends one person's hours for one pay period, day by day. Sending the same period again replaces it (a correction). Once a posted pay run covers any of its days, it is refused with `409`. ## Leave | You want | Call | |---|---| | The kinds of leave the company has | `GET /v1/leave-types` | | What a person has left | `GET /v1/employees/{externalRef}/leave` | | Record approved leave | `POST /v1/employees/{externalRef}/leave` | | Withdraw an approval | `POST /v1/employees/{externalRef}/leave/{leaveRef}/reverse` | You own the request and the approval; ReconSmiths records what was taken. Send the number of `days`: ReconSmiths does not know your working week or public holidays. Balances are worked out each time from accrual, adjustments and leave taken. ## Payslips `GET /v1/employees/{externalRef}/payslips` lists a person's issued payslips; `GET /v1/payslips/{id}/file` is the PDF. Only issued ones: a draft pay run has no payslip. # Webhooks Instead of asking again and again whether an invoice is paid, be told. ## Events | Event | When | |---|---| | `invoice.posted` | An invoice was issued, by you or in the office. | | `invoice.paid` | An invoice is fully paid **and the money is in the bank** (a card confirmation alone is not enough). | | `invoice.unpaid` | An invoice that was paid is no longer (a payment was undone). | | `invoice.credited` | A credit note was applied to an invoice. | | `credit.raised` | A credit note was issued. | | `quote.accepted` | A customer accepted a quotation. | Add the URL and the events on the connection in **Connected systems**. The signing secret is shown once, when you add it. The page shows each webhook's health and its recent deliveries. ## What arrives A `POST` with a JSON body: ```json { "event": "invoice.paid", "at": "2026-12-03T09:14:07+02:00", "document_id": "9a3c...", "doc_no": "INV-00042", "doc_type": "SALES_INVOICE", "external_ref": "ORD-5001", "source_system": "shop", "amount": 1150.00, "ccy": "ZAR", "doc_date": "2026-12-01", "due_date": "2026-12-31", "customer": "Northwind Trading (Pty) Ltd" } ``` Your own `external_ref` is in it, so you need no mapping table. Headers: `ReconSmith-Event`, `ReconSmith-Delivery` (unique per delivery: use it to ignore a repeat) and `ReconSmith-Signature`. ## Checking the signature `ReconSmith-Signature: t=1764745247,v1=5257a8...` 1. Take `t` and the raw body exactly as received. 2. Compute HMAC-SHA256 of `t + "." + body` with your webhook secret. 3. Compare it with `v1` in constant time. 4. Refuse a `t` more than five minutes old, so a captured delivery cannot be replayed. ```python import hmac, hashlib, time def verify(secret: str, header: str, body: bytes) -> bool: parts = dict(p.split("=", 1) for p in header.split(",")) if abs(time.time() - int(parts["t"])) > 300: return False mac = hmac.new(secret.encode(), parts["t"].encode() + b"." + body, hashlib.sha256).hexdigest() return hmac.compare_digest(mac, parts["v1"]) ``` ## Answering Answer `2xx` quickly and do the work afterwards. Anything else is retried, up to eight attempts, waiting longer each time (30 seconds, then 1.5 minutes, 4.5 minutes, and so on). A `4xx` other than `429` means "do not send me this" and is not retried. An endpoint that fails 20 deliveries in 24 hours is switched off; add it again in **Connected systems** once it is fixed. Deliveries can arrive more than once and out of order. Treat them as a nudge: when one arrives, read the current state (`GET /v1/documents`) if order matters. # Reading the books ## What changed `GET /v1/changes?since=0` returns everything that moved since a cursor - documents, allocations, customers - in one feed, instead of polling a dozen endpoints. 1. Start with `since=0`. 2. Process the `changes`. 3. Store `next_cursor` and pass it as `since` next time. 4. When `has_more` is false you are up to date. Up to 1 000 per call (`limit`, default 500). ## A customer account | You want | Call | |---|---| | The statement, with what each payment settled | `GET /v1/accounts/{code}/statement?from=&to=` | | Ageing (current, 30, 60, 90+ days) | `GET /v1/accounts/{code}/aged?asOf=` | | What is still open | `GET /v1/accounts/{code}/open-items` | `{code}` is ReconSmiths' account code (for example `C-01210`). Ageing runs from each document's due date, so it follows the customer's terms. ## Reconciliation The bank reconciliation is done in the office, but a system can help: - `GET /v1/recon/queue` - bank lines waiting for review. - `GET /v1/bank-transactions/{id}/suggestions` - the likely matches for one line, best first, with why each scored. - `POST /v1/match-candidates/{id}/accept` or `/reject` - decide. Accepting writes the match and teaches the matcher; it moves money, so it needs the `money` scope. # Endpoint reference # Customers Who you sell to: create, update and find customers. ## POST /v1/parties **Create or update parties in bulk** Keyed on (source_system, external_ref). Safe to replay: an existing party is returned, not duplicated. A changed name is recorded as a rename, so history is preserved. For every optional detail field, null means LEAVE THE STORED VALUE ALONE and the empty string means clear it — so re-upserting a customer whose VAT number is blank on your side will not wipe one somebody entered here. Parameters: - `Idempotency-Key` (header, required): 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): - `external_ref` string, required - `name` string, required - `source_system` string: Your system's name, the same on every call (for example shop). Identifies your references. - `party_type` string: ORGANISATION, PERSON - `role` string: CUSTOMER, SUPPLIER, EMPLOYEE - `email` string: Required when party_type is PERSON. - `ccy` string: Currency of the account provisioned for this party. One account per currency. Default "ZAR". - `parent_external_ref` string: Your reference for the HEAD account, when this one is a branch of it. The VAT number belongs to the legal entity, not to the account, so two accounts of one group may share one — but only when the relationship is declared here. Two levels only: a branch of a branch is refused. The parent must already exist, so send parents before branches; earlier in the same array is fine. - `vat_number` string: null leaves the stored value alone. The empty string clears it. A VAT number already held by a DIFFERENT legal entity is refused, and the error names who holds it — the usual cause is the same customer entered twice. Two accounts of one legal entity may share one: declare the relationship with parent_external_ref. - `company_reg` string: Same rules as vat_number. - `phone` string: Same rules as vat_number. - `address` object: The invoice address, structured. Sent as a whole or not at all: it replaces the current one rather than merging line by line, because an address half old and half new was never real. Omit it to leave the stored address alone. - `address.unit` string - `address.building` string - `address.street_no` string - `address.street` string - `address.suburb` string - `address.city` string - `address.province` string - `address.postal_code` string - `address.country_code` string ```json [ { "external_ref": "string", "name": "string" } ] ``` Answers: - `200` Parties upserted. Each result carries the account_code the party is invoiced against — provisioned here, by ReconSmith, because the caller has no way to keep a code unique within a ledger. Replaying returns the same code; no second account is created. - `422` Validation or idempotency conflict ## GET /v1/parties/incomplete **Customers whose VAT number or address is missing** The list worth asking about. A South African tax invoice over R5,000 must carry the customer's VAT number and address, and a prompt sent to every customer is a prompt most of them ignore — so this is who is actually missing something. Ordered by what they have been invoiced, because the customer you bill most is the one whose missing VAT number costs you soonest. Each row carries your own external_ref, so the list can be acted on without mapping names. Parameters: - `limit` (query) - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Answers: - `200` missing_vat and missing_address are counted separately because they are different asks: a customer with no address cannot be sent a compliant invoice at all, while one with no VAT number can, below R5,000. - `422` This API key has no default entity. ## GET /v1/parties/search **Smart customer lookup** Searches names, FORMER names, VAT and company numbers, external refs, account codes, branch numbers, e-mail and address text. Every hit carries matched_via so the caller can show why it appeared. Parameters: - `q` (query, required) - `limit` (query) Answers: - `200` Ranked matches # Invoices and credit notes Issue tax invoices and credit notes, change notes, void. ## POST /v1/invoices **Post sales invoices in bulk** Calls the ledger's own posting function: one balanced journal, an open-period check, terms taken from the billing party, and the receivable account resolved from the party. doc_no is NOT accepted. ReconSmith mints the tax invoice number from its own sequence, and takes the number inside the posting transaction, so a failed invoice returns it instead of burning it — the sequence has no gaps. A sales order number legitimately HAS gaps, because orders get cancelled, so passing one through as the invoice number would import those gaps into a sequence an auditor expects to be unbroken. Put the order number in external_ref, and in reference if it should print on the invoice. No settlement flag is returned: status is derived from allocations and never stored. Read it from GET /v1/documents. Parameters: - `Idempotency-Key` (header, required): 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): - `external_ref` string, required: Your identifier — typically the sales order number. The idempotency key for this document. - `customer_external_ref` string: Your customer id, as pushed to /v1/parties. Preferred: you never learn our codes. - `account_code` string: Alternative: the account_code returned by /v1/parties. - `doc_date` string (date), required - `due_date` string (date): Omit to let the billing party's terms derive it. - `ccy` string: Default "ZAR". - `reference` string: Printed on the invoice. The order number belongs here. - `notes` string - `source_system` string: Your system's name, the same on every call (for example shop). Identifies your references. - `lines` array of object, required - `lines[].description` string, required - `lines[].amount_excl_tax` number, required - `lines[].tax_amount` number, required - `lines[].account_code` string: Revenue account, e.g. "4010". Friendlier than carrying our UUIDs in your config. - `lines[].ledger_account_id` string (uuid): Alternative to account_code. - `lines[].quantity` number: Default 1. - `lines[].unit_price` number: Omit and it is derived from amount_excl_tax / quantity. - `lines[].branch_id` string (uuid): Chain customers: the branch that incurred the charge. Its branch_number prints on the statement line. - `lines[].site_id` string (uuid) - `lines[].dimensions` object: Analytic tags. Keys and values must already be registered or the line is refused. - `lines[].tax_code` string: Optional. SR (standard rate) by default; send ZR for zero-rated or EX for exempt supplies. - `lines[].item_code` string: Optional. The product, by its code in the product list (GET /v1/items). - `billing_address` object: Optional. The address this order was billed to, kept on the invoice so it prints that address whatever the customer's address becomes later. Left out, the invoice prints the customer's current invoice address. - `billing_address.unit` string - `billing_address.building` string - `billing_address.street_no` string - `billing_address.street` string - `billing_address.suburb` string - `billing_address.city` string - `billing_address.province` string - `billing_address.postal_code` string - `billing_address.country_code` string ```json [ { "external_ref": "string", "doc_date": "2026-12-01", "lines": [ { "description": "string", "amount_excl_tax": 100, "tax_amount": 100 } ] } ] ``` Answers: - `201` Posted. Each result carries document_id and the external_ref you sent; created:false means it was already posted under that ref. - `422` Rejected by the ledger — unknown customer, closed period, unregistered dimension, unbalanced journal. The detail carries the database's own message. ## POST /v1/credit-notes **Credit a customer — against an invoice, or on the account** Three shapes, because all three happen: 1. invoice_external_ref, no lines — credit the whole invoice. The ordinary cancelled-order case. 2. invoice_external_ref with lines — credit part of that invoice. 3. customer_external_ref with lines, no invoice — a credit note tied to no invoice at all: goodwill, a pricing correction, a deposit refund, a settlement. It is posted against the customer's account and sits there as money owed, and POST /v1/allocations applies it to any later invoice when they spend it. An invoice is never deleted and never renumbered. It keeps its number and a credit note cancels it out: that is what keeps the invoice sequence unbroken when an order falls away, and the audit trail append-only. Credit notes have their own gapless sequence (CRN-). applied: false means nothing was set against an invoice — either the invoice was already paid, or the credit note was never tied to one. Either way the value is credit the customer holds, and it shows in GET /v1/credits and GET /v1/customers/{ref}/credit. mark_for_refund records that the customer wants the money back rather than a credit against their next order. The credit note is raised either way; this only records which they chose. reason is never optional. It is the first thing anyone asks about a credit note, and the ledger refuses one without it. Parameters: - `Idempotency-Key` (header, required): 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): - `invoice_external_ref` string: The invoice being credited. Omit for a credit note on the account, and then lines are required. - `reason` string, required: Stored on the credit note. Say why — an auditor reads this. - `external_ref` string, required: Your identifier for the credit note itself. - `doc_date` string (date) - `lines` array of object: Required when no invoice is named; omit to credit a whole invoice. - `lines[].description` string, required - `lines[].amount_excl_tax` number, required - `lines[].tax_amount` number, required - `lines[].account_code` string: Revenue account, e.g. "4010". Friendlier than carrying our UUIDs in your config. - `lines[].ledger_account_id` string (uuid): Alternative to account_code. - `lines[].quantity` number: Default 1. - `lines[].unit_price` number: Omit and it is derived from amount_excl_tax / quantity. - `lines[].branch_id` string (uuid): Chain customers: the branch that incurred the charge. Its branch_number prints on the statement line. - `lines[].site_id` string (uuid) - `lines[].dimensions` object: Analytic tags. Keys and values must already be registered or the line is refused. - `source_system` string: Your system's name, the same on every call (for example shop). Identifies your references. - `mark_for_refund` boolean: The customer opted for a refund rather than keeping the credit on account. Default false. - `customer_external_ref` string: The customer, for a credit note not tied to an invoice. Your own id, as pushed to /v1/parties. - `account_code` string: Alternative to customer_external_ref. ```json [ { "reason": "string", "external_ref": "string" } ] ``` Answers: - `201` Credited - `422` Neither an invoice nor a customer with lines; unknown invoice or customer; no reason; or nothing left to credit on an invoice already settled. ## POST /v1/credit-notes/{externalRef}/refund-request **The customer asks for the money back** Flags an existing credit note as refund-requested. It is a flag, not a payment: nothing moves in the ledger and the customer can change their mind right up until the money leaves. Refused if the credit has already been used up. The flag shows as refund_requested in GET /v1/credits, and refundOnly=true filters to these. Parameters: - `externalRef` (path, required): Your own external_ref, our document number (CRN-00004) or our document id. GET /v1/credits returns all three, so an office-raised credit with no external_ref is still addressable. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `note` string: Why, or how they asked. Shown beside the credit. ```json { "note": "string" } ``` Answers: - `200` doc_no, unused, requested_at - `404` No such credit note - `422` Not a posted credit note, or nothing left to refund ## DELETE /v1/credit-notes/{externalRef}/refund-request **They changed their mind** Clears the flag. The credit itself is untouched and stays on the account. Parameters: - `externalRef` (path, required): Your own external_ref, our document number (CRN-00004) or our document id. GET /v1/credits returns all three, so an office-raised credit with no external_ref is still addressable. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Answers: - `200` refund_requested is now false - `404` No such credit note ## POST /v1/credit-notes/{externalRef}/refund **Pay a credit back in money** The money leaves: Dr trade receivables, Cr bank. The refund is a settleable document (CUSTOMER_REFUND, its own REF- sequence) and the credit note is allocated to it, exactly as a receipt settles an invoice — so over-refunding is refused by the allocation rather than by trusting the caller. Omit amount to refund whatever is unused. A partial refund leaves the rest on the customer's account, which is a thing customers ask for. Omit bank_account_id and the entity's primary bank account is used. Takes an Idempotency-Key like every write: a retried refund must not pay the customer twice. Once credit_left reaches zero the credit drops off GET /v1/credits. Parameters: - `Idempotency-Key` (header, required): 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, required): Your own external_ref, our document number (CRN-00004) or our document id. GET /v1/credits returns all three, so an office-raised credit with no external_ref is still addressable. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `amount` number: Omit to refund the full unused balance. - `bank_account_id` string (uuid) - `doc_date` string (date) - `reference` string: Yours — the EFT reference, say. ```json { "amount": 100, "bank_account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "doc_date": "2026-12-01", "reference": "string" } ``` Answers: - `201` refund_no, amount, credit_left - `404` No such credit note - `422` Nothing left to refund, more than is unused, or a closed period ## POST /v1/credit-notes/{externalRef}/void **Void a credit note** For a credit note raised in error. Posts the mirror journal, keeps the number and marks it VOIDED with the reason. A credit note that has already been used or refunded is refused. Voiding one already voided answers again with already_voided true, so a retry is harmless. Parameters: - `Idempotency-Key` (header, required): 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, required): Your own external_ref, our document number or our document id. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `reason` string, required: Kept on the document's notes. ```json { "reason": "string" } ``` Answers: - `201` credit_note_external_ref, document_id, doc_no, voided, already_voided - `400` Idempotency-Key header missing - `404` No such document - `409` A request with this Idempotency-Key is already in flight - `422` No reason given, not a customer credit note, already used or refunded, or Idempotency-Key reused with a different body ## POST /v1/invoices/{externalRef}/void **Void an invoice** For an invoice billed wrong: void it, then issue the correct one under a new external_ref. Posts the mirror journal, keeps the number and marks it VOIDED with the reason. An invoice with a receipt or credit note allocated against it is refused, naming them, because un-allocating money is a decision for a person; un-allocate first, then void. Voiding one already voided answers again with already_voided true. Parameters: - `Idempotency-Key` (header, required): 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, required): Your own external_ref, our document number or our document id. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `reason` string, required: Kept on the document's notes. ```json { "reason": "string" } ``` Answers: - `201` invoice_external_ref, document_id, doc_no, voided, already_voided - `400` Idempotency-Key header missing - `404` No such document - `409` A request with this Idempotency-Key is already in flight - `422` No reason given, not a sales invoice, paid or credited, or Idempotency-Key reused with a different body ## PUT /v1/invoices/{externalRef}/notes **Change an invoice's notes** Replaces the notes line on an invoice and nothing else: same number, same amounts. Works on a draft, posted or paid invoice; a voided one is refused. The PDF is drawn from the document, so fetch it again afterwards to get the new notes. The audit log keeps the old and new notes and the API client that changed them. Parameters: - `Idempotency-Key` (header, required): 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, required): Your own external_ref, our document number or our document id. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `notes` string or null: The new notes; null clears them. ```json { "notes": "string" } ``` Answers: - `200` invoice_external_ref, document_id, doc_no, status, notes, changed - `400` No body, or Idempotency-Key header missing - `404` Unknown invoice - `409` A request with this Idempotency-Key is already in flight - `422` Notes not changed (e.g. the invoice is voided), or Idempotency-Key reused with a different body # Payments and allocations Money received, and which invoices it paid. ## 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: - `Idempotency-Key` (header, required): 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): - `external_ref` string, required - `customer_external_ref` string - `account_code` string - `doc_date` string (date), required - `amount` number, required: 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. ```json [ { "external_ref": "string", "doc_date": "2026-12-01", "amount": 100 } ] ``` Answers: - `201` Created - `422` Rejected by the ledger ## 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: - `Idempotency-Key` (header, required): 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): - `payment_external_ref` string, required - `invoice_external_ref` string, required - `amount` number, required ```json [ { "payment_external_ref": "string", "invoice_external_ref": "string", "amount": 100 } ] ``` Answers: - `201` Allocated - `422` Over-allocation or wrong direction ## 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: - `externalRef` (path, required) - `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 ## 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: - `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 # Sales orders Orders before they are invoiced, and the two events that invoice them. ## 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: - `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 ## 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: - `Idempotency-Key` (header, required): 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): - `external_ref` string, required: 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, required - `lines[].description` string, required - `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 ```json [ { "external_ref": "string", "lines": [ { "description": "string" } ] } ] ``` Answers: - `201` Created; each result carries sales_order_id and order_no ## 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: - `Idempotency-Key` (header, required): 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, required) - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `doc_date` string (date) - `due_date` string (date) ```json { "doc_date": "2026-12-01", "due_date": "2026-12-01" } ``` Answers: - `201` invoice_id, invoice_no, invoiced_on_event - `404` Unknown order ## 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: - `Idempotency-Key` (header, required): 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, required) - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `gateway_code` string, required: 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, required: Gross, as the customer paid it. Fees are handled at settlement. - `gateway_ref` string, required: The gateway's own transaction id. The idempotency key for this payment. - `confirmed_at` string (date-time) ```json { "gateway_code": "string", "amount": 100, "gateway_ref": "string" } ``` Answers: - `201` invoice_no, receipt_id, status IN_TRANSIT - `404` Unknown order - `422` Unknown or inactive gateway ## 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: - `externalRef` (path, required) - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Answers: - `200` The order - `404` Unknown order ## 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: - `externalRef` (path, required) - `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 # Card payments Card and online payments: confirmed, in transit, settled. ## POST /v1/gateway-settlements **The money landed in the bank, net of the gateway's cut** Dr bank what landed, Dr merchant fees the difference, Cr clearing the gross that was confirmed. Batched, because gateways settle in batches: name the gateway refs in the payout. Parameters: - `Idempotency-Key` (header, required): 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: - `gateway_code` string, required - `gateway_refs` array of string, required - `amount_received` number, required: Net, as it appears on the bank statement. The difference from the gross becomes the fee. - `bank_account_id` string (uuid) - `settled_on` string (date) ```json { "gateway_code": "string", "gateway_refs": [ "string" ], "amount_received": 100 } ``` Answers: - `201` journal_id, gross, fee, payments_settled - `422` Refs not in transit, or a settlement larger than the gross confirmed ## GET /v1/gateway-payments **In transit — the list that needs handling** Confirmed by a gateway, not yet in the bank. overdue is anything past that gateway's own settlement window (7 days by default). The total ties to the clearing account on the trial balance. Parameters: - `overdueOnly` (query) Answers: - `200` total_in_transit, overdue_count, and the payments with days_in_transit # Documents The issued documents: status, PDF and data. ## GET /v1/documents **Bulk settlement status by your own identifiers** Which of the invoices you pushed are still open. Derived from allocations and never stored, so it is always current — do not cache it as a boolean, it is wrong the moment a receipt is allocated. Refs that match nothing come back under not_found, so a syncing caller sees what never landed instead of inferring it from a short list. Each row splits the settling side, because 'settled' is not one fact: paid_amount is receipts, credited_amount is credit notes, and state is derived from the two — OPEN, PART_PAID, PAID, PART_CREDITED, CREDITED, PAID_AND_CREDITED or VOIDED. An invoice paid and an invoice cancelled-and-credited both show settlement_status SETTLED, and an app that renders them the same way is lying to the customer. credit_note_nos lists the credit notes against the document, marked_for_refund says the customer asked for the money back, and last_movement_at is when an allocation last touched it. Everything is derived from the allocation rows, so it cannot disagree with the ledger — learn that something moved from GET /v1/changes (ALLOCATED) and re-read rather than caching a flag. Parameters: - `externalRefs` (query, required): Comma-separated, up to 1000. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Answers: - `200` document_id, doc_no, doc_type, total_incl_tax, allocated, outstanding, settlement_status, status, reference — plus not_found ## GET /v1/documents/{externalRef}/pdf **The issued document as a PDF** The tax invoice or credit note on the ReconSmith letterhead, exactly as posted: our invoice number, the date and due date, our company details and VAT number as the letterhead stood on that date, the customer's name, address and VAT number, every line, the totals, and the reference (your order or work-order number). Fetch it once when the invoice is posted and store it; fetch again if a credit note is raised against it. Your app then serves its stored copy, so a customer can still get their invoice when ReconSmith is slow or unreachable. Drawn by one renderer from the template's render_spec, and reissued on the branding of the document's own date — a copy fetched next year matches the one that was sent. The service does not draw PDFs itself: a second implementation would mean two versions of the same tax invoice, with no way to say which one the customer received. Only a POSTED document has an issued PDF; anything else is a 409. Parameters: - `externalRef` (path, required): Your identifier for the document — the order number you invoiced under. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Answers: - `200` application/pdf, named for our document number, e.g. "Tax invoice INV-00041.pdf" - `404` Unknown document - `409` The document is not POSTED, so no PDF was ever issued - `502` The renderer is unreachable or refused - `503` No renderer is configured ## GET /v1/documents/{externalRef}/content **The issued document as JSON or XML** The same document as data: our invoice number, date and due date; our company details and VAT number from the letterhead for that date; the customer's name, address and VAT number; every line with description, quantity, unit price, amount excluding VAT and VAT; the totals, a tax summary by rate, and the reference. Built from the ledger rather than from what the caller pushed, so if your copy and ours ever disagree, ours is right by construction. Not needed when you store the PDF, but it is what you want to render the invoice natively in an app or to keep an archival XML copy. Bank account number is masked to the last four: the full number belongs on the PDF the supplier issues, not in a payload that gets cached. format=xml, or an Accept header asking for XML, returns the XML rendering of the same facts. Parameters: - `externalRef` (path, required) - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. - `format` (query) Answers: - `200` The document - `404` Unknown document # Statements Customer statements and how they are delivered. ## GET /v1/customers/{externalRef}/statement **Customer statement as data** The customer's statement for a period: opening balance, every line, closing balance and ageing. A payment appears once for the full amount received, with the invoices it was applied to nested beneath it and any unused balance shown. The office screen, the PDF and the e-mailed statement are built from the same data, so they always agree. Parameters: - `externalRef` (path, required): Your own reference for the customer, as pushed to /v1/parties. - `from` (query): First day of the period. Omit for the statement's default period. - `to` (query): Last day of the period. Omit for today. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Answers: - `200` The statement - `404` Unknown customer - `409` No company is set on this key ## GET /v1/customers/{externalRef}/statement/file **Customer statement as a PDF** The same statement drawn as a PDF on the company letterhead, ready to show or attach. The file is named for the period's end date, e.g. "Statement 2026-11-30.pdf". Parameters: - `externalRef` (path, required): Your own reference for the customer, as pushed to /v1/parties. - `from` (query): First day of the period. Omit for the statement's default period. - `to` (query): Last day of the period. Omit for today. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Answers: - `200` application/pdf - `404` Unknown customer - `409` No company is set on this key - `502` The renderer is unreachable or refused - `503` No renderer is configured ## POST /v1/customers/{externalRef}/statement/send **E-mail a statement now** Queues the customer's statement for the period to be e-mailed. It is queued, not sent inside the request: the sender retries on failure, and the message shows in the outbox and in sent mail. Omit to_address to send to the customer's own e-mail address. Parameters: - `externalRef` (path, required): Your own reference for the customer, as pushed to /v1/parties. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `from` string (date) - `to` string (date) - `to_address` string: Send here instead of the customer's own address. ```json { "from": "2026-12-01", "to": "2026-12-01", "to_address": "string" } ``` Answers: - `200` queued: the message id - `403` The key is read-only - `404` Unknown customer - `409` No company is set on this key - `422` Refused, e.g. no address to send to ## GET /v1/customers/{externalRef}/statement-delivery **The customer's automatic statement setting** Whether the customer receives statements automatically, how often, to which address, and when the next one goes. A customer who has never chosen is OFF. Parameters: - `externalRef` (path, required): Your own reference for the customer, as pushed to /v1/parties. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Answers: - `200` The setting - `404` Unknown customer - `409` No company is set on this key ## PUT /v1/customers/{externalRef}/statement-delivery **Turn automatic statements on or off** Sets how the customer receives statements: OFF, MONTHLY or WEEKLY, on which day, to which address, and whether to send when nothing is owed. Lets a customer switch automatic statements on for themselves from your app. The choice is recorded with the source system that made it, so it can be told apart from one made in the office. Parameters: - `externalRef` (path, required): Your own reference for the customer, as pushed to /v1/parties. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `mode` string: OFF, MONTHLY, WEEKLY, required - `send_on` integer: Monthly: day of the month, 31 = month-end. Weekly: 1 Monday to 7 Sunday. - `to_address` string: Omit to leave it unchanged; an empty string clears it back to the customer's own address. - `send_when_nil` boolean: Send even when nothing is owed. ```json { "mode": "OFF" } ``` Answers: - `200` mode, send_on, to_address, send_when_nil, next_send - `403` The key is read-only - `404` Unknown customer - `409` No company is set on this key - `422` Refused, e.g. an unknown mode or a day out of range ## PUT /v1/customers/{externalRef}/statement-rule **Put the customer on a statement rule** Puts the customer on one of the company's named statement schedules from GET /v1/statement-rules, exactly as ticking them onto it in the office does. rule_id null takes them off. The choice is recorded with the source system that made it. Parameters: - `externalRef` (path, required): Your own reference for the customer, as pushed to /v1/parties. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `rule_id` string or null (uuid): The rule's id; null takes the customer off any rule. ```json { "rule_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } ``` Answers: - `200` The customer's statement setting after the change - `403` The key is read-only - `404` Unknown customer - `409` No company is set on this key - `422` Refused, e.g. an unknown rule ## GET /v1/statement-rules **The company's statement rules** The named statement schedules the company has set up, for a customer to choose from. Put a customer on one with PUT /v1/customers/{externalRef}/statement-rule. Answers: - `200` rules - `409` No company is set on this key # Outbox Documents ReconSmiths prepared for your system to send. ## GET /v1/outbox **What is waiting for you to send** For a company whose sending mode is HANDBACK: its invoices are raised in your system, so they go out from your domain, which is the one its customers already know. ReconSmith picks the template, writes the subject and body in the customer's own language and renders the PDF; you send it. Poll this. Parameters: - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. - `limit` (query) - `includeCollected` (query): Also return ones you have already marked collected but not yet sent. Answers: - `200` count, messages: [{ messageId, kind, to, cc, bcc, subject, body, language, attachmentName, documentRef, customerRef, customer, status, createdAt, attachment }]. attachment is the path to fetch the PDF from; it is not inlined, because it is often several hundred KB and you may already hold it. - `409` This API key has no default company ## POST /v1/outbox/{id}/collected **You have taken it** Separate from sent, deliberately: marking it sent at the moment it was collected would record an outcome nobody knows yet. Safe to repeat. Parameters: - `id` (path, required) - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Answers: - `200` collected: true, or false if it was already taken ## POST /v1/outbox/{id}/sent **You sent it** This is what makes Sent mail true. "Was that invoice sent, to whom, and when" is a question the books have to answer whoever pressed the button; one that went out through your system and is invisible here is one nobody can prove was sent. Parameters: - `id` (path, required) - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `providerId` string: Your mail provider's message id, if you have one. It is what a later bounce is matched on. - `sentAt` string (date-time): Defaults to now. ```json { "providerId": "string", "sentAt": "2026-12-01T10:00:00+02:00" } ``` Answers: - `200` recorded: true ## POST /v1/outbox/{id}/failed **You could not send it** Parameters: - `id` (path, required) - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `reason` string, required: Somebody will read this when they ask why the customer never got their invoice. ```json { "reason": "string" } ``` Answers: - `200` recorded: true - `400` No reason given ## GET /v1/outbox/{id}/pdf **The PDF attached to an outbox message** The message's own attachment, drawn exactly as the built-in sender would attach it. Works for every kind of message, including ones with no document or customer reference, such as a remittance advice. GET /v1/outbox gives this path in a message's attachment field when it is the way to fetch the file. Parameters: - `id` (path, required): The message_id from GET /v1/outbox. Answers: - `200` application/pdf, named as the message's attachment - `404` Unknown message - `409` No company is set on this key - `502` The renderer is unreachable or refused - `503` No renderer is configured # Purchases Supplier bills, supplier credit notes and dimensions. ## POST /v1/purchase-invoices **Post supplier bills in bulk** Calls rs.post_purchase_invoice: one balanced journal, an open-period check, and the payable account resolved from the party. Unlike /v1/invoices, supplier_doc_no IS required. A supplier's invoice number is theirs, not ours — we neither mint it nor control it, and it is what goes on the remittance so they can find the payment. Where a slip has no number of its own, send your external_ref. Idempotent on (source_system, external_ref): a repeat returns the existing document with created = false and posts nothing. Tax: leave tax_code off a line and the posting function defaults to SRI, standard rated inputs, VAT201 box 14. For a purchase that carries no VAT — fuel in South Africa being the usual case — a zero-tax line is stamped with the entity's zero-rated input code instead (ZRI in South Africa, VOOR0 in the Netherlands). Send tax_code explicitly to override. Dimensions are validated on BOTH the key and the value, and keys are case-sensitive. An unknown dimension or an unregistered value is refused and the whole bill fails. Create them with POST /v1/dimensions first. attachments (135): the supplier's own invoice can ride along on the bill. On a repeat (created = false) the attachments are still kept, so a file sent with a retry is not lost. Parameters: - `Idempotency-Key` (header, required): 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): - `external_ref` string, required: Your identifier, e.g. APP-FUEL-1234. The idempotency key for this document. - `supplier_doc_no` string, required: The supplier's own invoice or slip number. Send external_ref where there is none. - `supplier_external_ref` string: Your supplier id, as pushed to /v1/parties with role = SUPPLIER. - `account_code` string: Alternative: the account_code returned by /v1/parties. - `doc_date` string (date), required - `due_date` string (date): Omit to let the supplier's terms derive it. - `ccy` string: Default "ZAR". - `reference` string: Printed on the bill and shown on the supplier statement. For fuel, the vehicle registration. - `notes` string - `source_system` string: Your system's name, the same on every call (for example shop). Identifies your references. - `lines` array of object, required - `lines[].description` string, required - `lines[].amount_excl_tax` number, required: The net amount, as it appears on the supplier's document. - `lines[].tax_amount` number: Default 0. - `lines[].account_code` string: The expense account, e.g. 6070 for fuel. - `lines[].tax_code` string: Optional. Defaults to SRI, or to the zero-rated input code when tax_amount is 0. - `lines[].dimensions` object: e.g. {"VEHICLE": "JF 24 PV GP"}. Keys are case-sensitive and both key and value must already exist. - `attachments` array of object: The supplier's own document as it arrived. PDF, PNG, JPEG or WebP; the type is read from the bytes. Up to 8 MB per file, and keep the whole request under 12 MB; send larger files one at a time to /v1/purchase-invoices/{external_ref}/attachments. The same file sent again is kept once. - `attachments[].file_name` string, required - `attachments[].content_type` string: Optional; not trusted. - `attachments[].content_base64` string, required: The file, base64. A data: URL prefix is accepted. ```json [ { "external_ref": "string", "supplier_doc_no": "string", "doc_date": "2026-12-01", "lines": [ { "description": "string", "amount_excl_tax": 100 } ] } ] ``` Answers: - `201` Posted - `422` Unknown supplier, a party with no SUPPLIER account, or an unknown dimension key or value. ## GET /v1/dimensions **List the dimensions and values this entity accepts** What a line may be tagged with. Worth reading before posting: a line carrying an unknown key or value is refused and the whole document fails. Answers: - `200` OK ## POST /v1/dimensions **Create dimensions and their values** Needed because dimensions are validated on both the key and the value. A new vehicle registration must exist here before a fuel bill carrying it will post. Codes are upper-cased: VEHICLE and vehicle are not the same dimension, and only the first exists. Parameters: - `Idempotency-Key` (header, required): 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): - `code` string, required - `name` string, required - `required` boolean: true refuses any line of the applicable type that does not carry it. Default false. - `applies_to` array of string: Default ["INCOME", "EXPENSE"]. - `values` array of object, required - `values[].code` string, required - `values[].name` string ```json [ { "code": "VEHICLE", "name": "Vehicle", "values": [ { "code": "JF 24 PV GP" } ] } ] ``` Answers: - `201` Created ## POST /v1/purchase-credit-notes **Post supplier credit notes in bulk** A supplier's credit note: the same line shape as a purchase invoice (net amount and tax as the supplier printed them). The expense and input VAT are credited back and the supplier's payable is reduced. Name the bill it credits with purchase_invoice_external_ref (your external_ref for that bill, same source_system, same supplier). It is applied to what is still open on that bill; anything over stays on the supplier's account as credit. Leave it out for a credit that is not against one bill. Idempotent on (source_system, external_ref): a repeat returns the existing credit note with created = false and posts nothing. supplier_doc_no is required: the supplier's own credit-note number. Parameters: - `Idempotency-Key` (header, required): 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): - `external_ref` string, required: Your identifier, e.g. APP-SUPCRN-17. The idempotency key for this document. - `supplier_doc_no` string, required: The supplier's own credit-note number. - `supplier_external_ref` string: Your supplier id, as pushed to /v1/parties with role = SUPPLIER. - `account_code` string: Alternative: the account_code returned by /v1/parties. - `doc_date` string (date), required - `ccy` string: Default "ZAR". - `reference` string: Printed on the bill and shown on the supplier statement. For fuel, the vehicle registration. - `notes` string - `source_system` string: Your system's name, the same on every call (for example shop). Identifies your references. - `lines` array of object, required - `lines[].description` string, required - `lines[].amount_excl_tax` number, required: The net amount, as it appears on the supplier's document. - `lines[].tax_amount` number: Default 0. - `lines[].account_code` string: The expense account, e.g. 6070 for fuel. - `lines[].tax_code` string: Optional. Defaults to SRI, or to the zero-rated input code when tax_amount is 0. - `lines[].dimensions` object: e.g. {"VEHICLE": "JF 24 PV GP"}. Keys are case-sensitive and both key and value must already exist. - `attachments` array of object: The supplier's own document as it arrived. PDF, PNG, JPEG or WebP; the type is read from the bytes. Up to 8 MB per file, and keep the whole request under 12 MB; send larger files one at a time to /v1/purchase-invoices/{external_ref}/attachments. The same file sent again is kept once. - `attachments[].file_name` string, required - `attachments[].content_type` string: Optional; not trusted. - `attachments[].content_base64` string, required: The file, base64. A data: URL prefix is accepted. - `purchase_invoice_external_ref` string: Optional. Your external_ref of the bill this credits, e.g. APP-SUPBILL-42. - `reason` string: Why the supplier credited us, e.g. 'Empties returned on GRN-12'. Defaults to notes, then to 'Supplier credit note '. ```json [ { "external_ref": "string", "supplier_doc_no": "string", "doc_date": "2026-12-01", "lines": [ { "description": "string", "amount_excl_tax": 100 } ] } ] ``` Answers: - `201` Posted - `422` Unknown supplier, a party with no SUPPLIER account, or an unknown dimension key or value. ## POST /v1/purchase-invoices/{externalRef}/attachments **Add the supplier's own document to a bill already sent** For a file that arrives after the bill, e.g. a photo taken later. Names the bill (or supplier credit note) by your external_ref. Same rules as inline attachments: PDF, PNG, JPEG or WebP, 8 MB per file, the same file kept once. Parameters: - `Idempotency-Key` (header, required): 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, required) - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body (a JSON array of these): - `file_name` string, required - `content_type` string: Optional; not trusted. - `content_base64` string, required: The file, base64. A data: URL prefix is accepted. ```json [ { "file_name": "string", "content_base64": "string" } ] ``` Answers: - `201` Kept - `400` Idempotency-Key header missing, or an empty list - `404` Nothing was posted under that external_ref - `409` A request with this Idempotency-Key is already in flight - `413` A file over 8 MB, or more than 1000 files - `422` Not a PDF, PNG, JPEG or WebP, not valid base64, or Idempotency-Key reused with a different body # Remittances One customer payment for several invoices, under one number. ## POST /v1/remittances **Record remittances: one payment for several invoices** Records a payment the customer is about to make for several invoices under one remittance number of yours. That number is what the payer uses as the card payment's merchant reference or the EFT reference, so when the bank line or the gateway confirmation arrives it finds the remittance waiting and settles every invoice in it. An EFT needs no further call. The lines must add up to the total; with on_account the lines may add up to less (or be none), and the rest settles the customer's open invoices oldest due first. Recording a remittance number that already exists returns it with created false. Parameters: - `Idempotency-Key` (header, required): 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): - `remittance_no` string, required - `total` number, required: What the payer was asked to pay. Positive. - `lines` array of object, required - `lines[].invoice_external_ref` string, required - `lines[].amount` number, required: Positive. - `customer_external_ref` string - `account_code` string: Our account code, when customer_external_ref is not sent. - `method` string: EFT, CARD, OZOW, GOOGLE_PAY, APPLE_PAY, OTHER: How the payer said they would pay. Either route still settles it. Default "EFT". - `on_account` boolean: What the lines do not take is a payment on account. Default false. - `source_system` string: Your system's name, the same on every call (for example shop). Identifies your references. ```json [ { "remittance_no": "string", "total": 100, "lines": [ { "invoice_external_ref": "string", "amount": 100 } ] } ] ``` Answers: - `201` count, and remittances with remittance_id, remittance_no and created - `400` Idempotency-Key header missing, or an empty list - `409` A request with this Idempotency-Key is already in flight - `413` More than 1000 remittances in one request - `422` Incomplete remittance, lines that do not add up to the total, an unknown customer or account, or Idempotency-Key reused with a different body ## GET /v1/remittances/{remittanceNo} **Where a remittance stands** The remittance's status (OPEN, PAID or CANCELLED), method, total, when it was paid, and how many of its invoices are settled and how many are still waiting. Parameters: - `remittanceNo` (path, required): Your remittance number, as sent when it was recorded. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Answers: - `200` remittance_no, status, method, total, paid_at, invoices_settled, invoices_waiting - `404` Unknown remittance ## POST /v1/remittances/{remittanceNo}/cancel **Cancel an open remittance** The payer gave up. Marks an OPEN remittance CANCELLED with the reason, so a payment that later arrives under its number is not matched to it. A remittance already paid or cancelled cannot be cancelled. Parameters: - `Idempotency-Key` (header, required): 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. - `remittanceNo` (path, required): Your remittance number, as sent when it was recorded. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `reason` string, required ```json { "reason": "string" } ``` Answers: - `201` remittance_no, status CANCELLED, reason - `400` Idempotency-Key header missing - `409` Unknown, already paid or already cancelled; or a request with this Idempotency-Key is already in flight - `422` No reason given, or Idempotency-Key reused with a different body ## POST /v1/remittances/{remittanceNo}/payment-confirmation **Gateway says the remittance is paid** The gateway's word, not the bank's. Posts the receipt into that gateway's clearing account and spreads it across the remittance's invoices; the bank is untouched until the settlement arrives under the same reference. Idempotent on the gateway reference, so a retried webhook pays nothing twice. Needs a key with the money scope. Parameters: - `Idempotency-Key` (header, required): 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. - `remittanceNo` (path, required): Your remittance number, as sent when it was recorded. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Body: - `gateway_code` string, required: The payment gateway, as set up for the company. - `amount` number, required: Gross, as the customer paid it. Fees are handled at settlement. - `gateway_ref` string: The gateway's reference for the payment. Omit and the remittance number is used. - `method` string: Default "CARD". - `paid_with` string: The gateway's payment type, e.g. Visa, Mastercard, MasterPass, EFT_OZOW. Payments the gateway pays out one at a time wait for their own bank line. - `confirmed_at` string (date-time): Omit for now. - `merchant_reference` string: The gateway's merchant reference, kept on the payment for matching the settlement report. ```json { "gateway_code": "string", "amount": 100 } ``` Answers: - `201` remittance_no, gateway_payment_id, status, invoices_settled, invoices_waiting - `400` Idempotency-Key header missing - `403` The key may not move money - `404` Unknown remittance - `409` A request with this Idempotency-Key is already in flight - `422` Not confirmed (e.g. unknown gateway, wrong amount, remittance cancelled), or Idempotency-Key reused with a different body # Items Products and services. ## GET /v1/items **Products and services** Answers: - `200` { items: [...] } ## POST /v1/items **Create or update products** A list. Matched by external_ref (your id) when sent, else by code. Keys: code, name, description, unit, sells, sales_price, sales_account_code, sales_tax_code, buys, purchase_price, purchase_account_code, purchase_tax_code, is_active, external_ref. A key not sent leaves the field alone. An invoice line names a product with item_code. Body (a JSON array of these): ```json [ {} ] ``` Answers: - `200` { items: [{ id, code }] } - `422` Refused, with the reason # Staff and payroll Employees, hours, leave and payslips. ## PUT /v1/employees/{externalRef} **Create or update an employee** PUT, not POST: you name the person, so the same call repeated is the same person and no Idempotency-Key is needed. null leaves a field alone — a caller that does not hold salaries sends a null gross on every sync, and a null that overwrote would zero the payroll. Parameters: - `externalRef` (path, required): Your own id for this person, e.g. TM-4471. Body: - `name` string: Required on first push. A later change is recorded as a dated rename, so a payslip already issued keeps the name it was issued in. - `email` string - `employeeNo` string: A label, printed on the payslip. Not the key: companies renumber staff. - `startedOn` string (date): Leave cycles run from this date, not from January. - `endedOn` string (date) - `gross` number: Per period. Omit if you do not hold salaries. - `periods` integer: 12, 13, 26, 52: Default 12. - `employmentType` string: EMPLOYEE, DIRECTOR, CONTRACTOR - `sourceSystem` string: Your system's name, the same on every call (for example shop). Identifies your references. ```json { "name": "string", "email": "string", "employeeNo": "string", "startedOn": "2026-12-01" } ``` Answers: - `200` employeeId, partyId, accountCode, created - `409` This API key has no default company - `422` Refused, with the reason in words ## GET /v1/leave-types **The kinds of leave this company has** ReconSmith's codes, not yours. Seeded from the company's country — for South Africa, the BCEA minimums — and editable, because a contract may give more and never less. Answers: - `200` leaveTypes: [{ code, name, unit, daysPerCycle, cycleMonths, accrues, minServiceMonths, tracksBalance, isPaid, basis }] ## GET /v1/employees/{externalRef}/leave **What this person has left** Worked out every time from accrual, adjustments and leave taken. Never a stored number. Cycles run from the person's start date: somebody who started in March has an annual cycle ending in February. Parameters: - `externalRef` (path, required) - `asAt` (query): Defaults to today in the company's own time zone. - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Answers: - `200` employeeRef, asAt, balances: [{ code, name, unit, cycleStart, cycleEnd, entitlement, accrued, adjustments, taken, balance, availableFrom, basis }]. balance is null where the type tracks none, such as unpaid leave. - `404` Nobody here is known by that reference ## POST /v1/employees/{externalRef}/leave **Record approved leave** You own the request and the approval; this records what was taken. Idempotent on externalRef, so a retry after a timeout cannot deduct the same week twice — the second post returns the same leaveId with created = false. days is sent, never derived: ReconSmith does not know your working week, shift patterns or public holidays. unpaid_days (136): with code ANNUAL, days - unpaid_days come off the annual balance and unpaid_days are recorded as unpaid leave (external_ref + '-UNPAID'). The answer carries annual_days, unpaid_days, recounted and recount_note. Parameters: - `externalRef` (path, required) Body: - `externalRef` string, required: Your id for the leave request, e.g. APP-LR-9912. The idempotency key. - `code` string, required: From GET /v1/leave-types. - `firstDay` string (date), required - `lastDay` string (date), required - `days` number, required: Working days, as you count them. - `halfDay` boolean: Default false. - `note` string - `sourceSystem` string: Your system's name, the same on every call (for example shop). Identifies your references. - `unpaid_days` number: Annual leave only (136). How many of days went over the annual balance when the person applied; recorded as unpaid leave and taken off the pay. The balance is counted again when the leave is posted, and if it allows a different split the answer says so (recounted, recount_note). ```json { "externalRef": "string", "code": "string", "firstDay": "2026-12-01", "lastDay": "2026-12-01", "days": 100 } ``` Answers: - `200` leaveId, created, balanceAfter - `404` Nobody here is known by that reference - `422` Refused: no such leave type, service not yet served, or the balance would go negative ## POST /v1/employees/{externalRef}/leave/{leaveRef}/reverse **An approval that was withdrawn** Reversed, never deleted. The person asked, it was approved, and then it was cancelled — all three happened and all three stay on the record. Safe to repeat. Parameters: - `externalRef` (path, required) - `leaveRef` (path, required): The externalRef you posted the leave under. Body: - `reason` string, required - `sourceSystem` string: Your system's name, the same on every call (for example shop). Identifies your references. ```json { "reason": "string" } ``` Answers: - `200` leaveId, reversed, balanceAfter. reversed is false if it was already reversed. - `422` No reason given, or no leave recorded under that reference ## GET /v1/employees/{externalRef}/payslips **Which payslips this person has** Only issued ones. A draft pay run has no payslip, deliberately: it would put a figure in somebody's hands that the ledger has never seen. Parameters: - `externalRef` (path, required) - `limit` (query) - `sourceSystem` (query): Your system's name, the same on every call (for example shop). Identifies your references. Answers: - `200` employeeRef, payslips: [{ id, periodStart, periodEnd, payDate, period, ccy, gross, deductions, net }] - `404` Nobody here is known by that reference ## GET /v1/payslips/{id}/file **The payslip as a PDF** The official one, on the company's letterhead, carrying the leave balances as they stood at the end of that period. Proxied to the single renderer for the same reason the tax invoice is: a payslip somebody may have to show a bank or a landlord must not have two appearances. Parameters: - `id` (path, required): The id from GET /v1/employees/{externalRef}/payslips. Answers: - `200` application/pdf - `404` Not an issued payslip here - `502` The renderer is unreachable or refused - `503` No renderer configured ## PUT /v1/employees/{externalRef}/hours/{periodRef} **One person's hours for one pay period** PUT, so idempotent: the same period sent again replaces it (an office correction). Once a posted pay run covers any of its dates, it is refused with 409. How the pay run uses the days (South Africa, BCEA): the standing pay covers the ordinary hours of rostered days. On top of it: hours over the ordinary day (9) on a rostered day at 1.5x, or the day's multiplier if higher; the ordinary hours of a rostered Sunday or public holiday carry the extra (multiplier - 1); every hour of a rest day worked (rostered = false or rest_day_worked = true) at 1.5x or the multiplier if higher. Hourly rate = standing pay x periods a year / 52 / 45. Unknown fields on a day are kept, not refused. Parameters: - `externalRef` (path, required): TM-{team member id} - `periodRef` (path, required): APP-HOURS-{from}-{to} Body: - `period_from` string (date), required - `period_to` string (date), required - `total_hours` number - `on_truck_hours` number - `off_truck_hours` number - `source_system` string: Your system's name, the same on every call (for example shop). Identifies your references. - `days` array of object, required - `days[].date` string (date), required - `days[].hours` number, required: Decimal hours, 0 to 16. - `days[].on_truck_hours` number - `days[].off_truck_hours` number - `days[].corrected` boolean: Default false. - `days[].day_type` string: ORDINARY, SATURDAY, SUNDAY, PUBLIC_HOLIDAY: Default "ORDINARY". - `days[].rate_multiplier` number: 1.0 to 3.0. Sunday 1.5, public holiday 2.0. Default 1.0. - `days[].rostered` boolean: Default true. - `days[].rest_day_worked` boolean: Not rostered and worked anyway: every hour is overtime. Default false. ```json { "period_from": "2026-12-01", "period_to": "2026-12-01", "days": [ { "date": "2026-12-01", "hours": 100 } ] } ``` Answers: - `201` Stored for the first time - `200` Replaced - `404` Employee not known: PUT /v1/employees/{externalRef} first - `409` A posted pay run covers this period - `422` A day outside the period, hours over 16, or an unknown day_type # Reconciliation Bank lines and the matches suggested for them. ## GET /v1/bank-transactions/{id}/suggestions **Reconciliation suggestions** Ranked candidates with the features that produced each score. Layers: exact reference, exact amount, learned memory, fuzzy name. Nothing here posts anything. Parameters: - `id` (path, required) Answers: - `200` Suggestions with confidence bands ## GET /v1/recon/queue **Bank lines awaiting review** Answers: - `200` Queue ## POST /v1/match-candidates/{id}/accept **Accept a suggestion** Writes the match and teaches the matcher. Every other candidate on that line is recorded as rejected — the negative training signal. Answers: - `200` Accepted ## POST /v1/match-candidates/{id}/reject **Reject a suggestion** Answers: - `200` Rejected # Reading the books Statements, ageing, open items and the change feed. ## GET /v1/accounts/{code}/statement **Statement with settlement trace** Each payment line carries settlement_trace: which invoices it settled, for how much, and the branch number for chain customers. Parameters: - `code` (path, required) - `from` (query) - `to` (query) Answers: - `200` Statement lines - `404` Unknown account ## GET /v1/accounts/{code}/aged **Aged analysis** Ages off due_date, which honours the billing party's terms basis. Statement-terms customers age as one block. Parameters: - `code` (path, required) - `asOf` (query) Answers: - `200` Buckets ## GET /v1/accounts/{code}/open-items **Unsettled documents** Parameters: - `code` (path, required) Answers: - `200` Open items ## GET /v1/changes **Change feed** Everything that moved since a cursor. One call instead of polling six endpoints. Cursor-paged, because offsets shift under concurrent writes and a syncing client silently skips rows. Parameters: - `since` (query) - `limit` (query) Answers: - `200` Changes plus next_cursor # Service Health and the contract itself. ## GET /health **Liveness and database reachability** Answers: - `200` ok ## GET /v1/openapi.json **This API description** The OpenAPI document for this API. Needs no key, so an integrator can read it before being issued one. Answers: - `200` The OpenAPI 3.1 document