ReconSmiths Developers Your API keys

Reference

Purchases

Supplier bills, supplier credit notes and dimensions.

This page as plain text: purchases.md

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

NameInRequiredWhat it is
Idempotency-KeyheaderyesRequired on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422.

Body a JSON array of these, up to 1 000 per call

FieldTypeRequiredWhat it is
external_refstringyesYour identifier, e.g. APP-FUEL-1234. The idempotency key for this document.
supplier_doc_nostringyesThe supplier's own invoice or slip number. Send external_ref where there is none.
supplier_external_refstringYour supplier id, as pushed to /v1/parties with role = SUPPLIER.
account_codestringAlternative: the account_code returned by /v1/parties.
doc_datestring (date)yes
due_datestring (date)Omit to let the supplier's terms derive it.
ccystringDefault "ZAR".
referencestringPrinted on the bill and shown on the supplier statement. For fuel, the vehicle registration.
notesstring
source_systemstringYour system's name, the same on every call (for example shop). Identifies your references.
linesarray of objectyes
lines[].descriptionstringyes
lines[].amount_excl_taxnumberyesThe net amount, as it appears on the supplier's document.
lines[].tax_amountnumberDefault 0.
lines[].account_codestringThe expense account, e.g. 6070 for fuel.
lines[].tax_codestringOptional. Defaults to SRI, or to the zero-rated input code when tax_amount is 0.
lines[].dimensionsobjecte.g. {"VEHICLE": "JF 24 PV GP"}. Keys are case-sensitive and both key and value must already exist.
attachmentsarray of objectThe 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_namestringyes
attachments[].content_typestringOptional; not trusted.
attachments[].content_base64stringyesThe file, base64. A data: URL prefix is accepted.

Answers

201Posted
422Unknown supplier, a party with no SUPPLIER account, or an unknown dimension key or value.

Example

curl -X POST 'https://api.reconsmith.com/v1/purchase-invoices' \
  -H 'Authorization: Bearer $RECONSMITH_KEY' \
  -H 'Idempotency-Key: 7c1d0c2e-0b55-4f3a-9a51-1d2f4b6c8e90' \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "external_ref": "string",
    "supplier_doc_no": "string",
    "doc_date": "2026-12-01",
    "lines": [
      {
        "description": "string",
        "amount_excl_tax": 100
      }
    ]
  }
]'

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

200OK

Example

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

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

NameInRequiredWhat it is
Idempotency-KeyheaderyesRequired on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422.

Body a JSON array of these, up to 1 000 per call

FieldTypeRequiredWhat it is
codestringyes
namestringyes
requiredbooleantrue refuses any line of the applicable type that does not carry it. Default false.
applies_toarray of stringDefault ["INCOME", "EXPENSE"].
valuesarray of objectyes
values[].codestringyes
values[].namestring

Answers

201Created

Example

curl -X POST 'https://api.reconsmith.com/v1/dimensions' \
  -H 'Authorization: Bearer $RECONSMITH_KEY' \
  -H 'Idempotency-Key: 7c1d0c2e-0b55-4f3a-9a51-1d2f4b6c8e90' \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "code": "VEHICLE",
    "name": "Vehicle",
    "values": [
      {
        "code": "JF 24 PV GP"
      }
    ]
  }
]'

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

NameInRequiredWhat it is
Idempotency-KeyheaderyesRequired on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422.

Body a JSON array of these, up to 1 000 per call

FieldTypeRequiredWhat it is
external_refstringyesYour identifier, e.g. APP-SUPCRN-17. The idempotency key for this document.
supplier_doc_nostringyesThe supplier's own credit-note number.
supplier_external_refstringYour supplier id, as pushed to /v1/parties with role = SUPPLIER.
account_codestringAlternative: the account_code returned by /v1/parties.
doc_datestring (date)yes
ccystringDefault "ZAR".
referencestringPrinted on the bill and shown on the supplier statement. For fuel, the vehicle registration.
notesstring
source_systemstringYour system's name, the same on every call (for example shop). Identifies your references.
linesarray of objectyes
lines[].descriptionstringyes
lines[].amount_excl_taxnumberyesThe net amount, as it appears on the supplier's document.
lines[].tax_amountnumberDefault 0.
lines[].account_codestringThe expense account, e.g. 6070 for fuel.
lines[].tax_codestringOptional. Defaults to SRI, or to the zero-rated input code when tax_amount is 0.
lines[].dimensionsobjecte.g. {"VEHICLE": "JF 24 PV GP"}. Keys are case-sensitive and both key and value must already exist.
attachmentsarray of objectThe 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_namestringyes
attachments[].content_typestringOptional; not trusted.
attachments[].content_base64stringyesThe file, base64. A data: URL prefix is accepted.
purchase_invoice_external_refstringOptional. Your external_ref of the bill this credits, e.g. APP-SUPBILL-42.
reasonstringWhy the supplier credited us, e.g. 'Empties returned on GRN-12'. Defaults to notes, then to 'Supplier credit note <number>'.

Answers

201Posted
422Unknown supplier, a party with no SUPPLIER account, or an unknown dimension key or value.

Example

curl -X POST 'https://api.reconsmith.com/v1/purchase-credit-notes' \
  -H 'Authorization: Bearer $RECONSMITH_KEY' \
  -H 'Idempotency-Key: 7c1d0c2e-0b55-4f3a-9a51-1d2f4b6c8e90' \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "external_ref": "string",
    "supplier_doc_no": "string",
    "doc_date": "2026-12-01",
    "lines": [
      {
        "description": "string",
        "amount_excl_tax": 100
      }
    ]
  }
]'

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

NameInRequiredWhat it is
Idempotency-KeyheaderyesRequired on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422.
externalRefpathyes
sourceSystemqueryYour system's name, the same on every call (for example shop). Identifies your references.

Body a JSON array of these, up to 1 000 per call

FieldTypeRequiredWhat it is
file_namestringyes
content_typestringOptional; not trusted.
content_base64stringyesThe file, base64. A data: URL prefix is accepted.

Answers

201Kept
400Idempotency-Key header missing, or an empty list
404Nothing was posted under that external_ref
409A request with this Idempotency-Key is already in flight
413A file over 8 MB, or more than 1000 files
422Not a PDF, PNG, JPEG or WebP, not valid base64, or Idempotency-Key reused with a different body

Example

curl -X POST 'https://api.reconsmith.com/v1/purchase-invoices/EXTERNALREF/attachments' \
  -H 'Authorization: Bearer $RECONSMITH_KEY' \
  -H 'Idempotency-Key: 7c1d0c2e-0b55-4f3a-9a51-1d2f4b6c8e90' \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "file_name": "string",
    "content_base64": "string"
  }
]'