ReconSmiths Developers Your API keys

Reference

Documents

The issued documents: status, PDF and data.

This page as plain text: documents.md

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

NameInRequiredWhat it is
externalRefsqueryyesComma-separated, up to 1000.
sourceSystemqueryYour system's name, the same on every call (for example shop). Identifies your references.

Answers

200document_id, doc_no, doc_type, total_incl_tax, allocated, outstanding, settlement_status, status, reference — plus not_found

Example

curl -X GET 'https://api.reconsmith.com/v1/documents' \
  -H 'Authorization: Bearer $RECONSMITH_KEY'

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

NameInRequiredWhat it is
externalRefpathyesYour identifier for the document — the order number you invoiced under.
sourceSystemqueryYour system's name, the same on every call (for example shop). Identifies your references.

Answers

200application/pdf, named for our document number, e.g. "Tax invoice INV-00041.pdf"
404Unknown document
409The document is not POSTED, so no PDF was ever issued
502The renderer is unreachable or refused
503No renderer is configured

Example

curl -X GET 'https://api.reconsmith.com/v1/documents/EXTERNALREF/pdf' \
  -H 'Authorization: Bearer $RECONSMITH_KEY'

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

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

Answers

200The document
404Unknown document

Example

curl -X GET 'https://api.reconsmith.com/v1/documents/EXTERNALREF/content' \
  -H 'Authorization: Bearer $RECONSMITH_KEY'