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
| Name | In | Required | What it is |
|---|---|---|---|
Idempotency-Key | header | yes | Required on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422. |
Body a JSON array of these, up to 1 000 per call
| Field | Type | Required | What it is |
|---|---|---|---|
external_ref | string | yes | Your identifier, e.g. APP-FUEL-1234. The idempotency key for this document. |
supplier_doc_no | string | yes | 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) | yes | |
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 | yes | |
lines[].description | string | yes | |
lines[].amount_excl_tax | number | yes | 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 | yes | |
attachments[].content_type | string | Optional; not trusted. | |
attachments[].content_base64 | string | yes | The file, base64. A data: URL prefix is accepted. |
Answers
201 | Posted |
422 | Unknown 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
200 | OK |
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
| Name | In | Required | What it is |
|---|---|---|---|
Idempotency-Key | header | yes | Required on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422. |
Body a JSON array of these, up to 1 000 per call
| Field | Type | Required | What it is |
|---|---|---|---|
code | string | yes | |
name | string | yes | |
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 | yes | |
values[].code | string | yes | |
values[].name | string |
Answers
201 | Created |
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
| Name | In | Required | What it is |
|---|---|---|---|
Idempotency-Key | header | yes | Required on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422. |
Body a JSON array of these, up to 1 000 per call
| Field | Type | Required | What it is |
|---|---|---|---|
external_ref | string | yes | Your identifier, e.g. APP-SUPCRN-17. The idempotency key for this document. |
supplier_doc_no | string | yes | 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) | yes | |
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 | yes | |
lines[].description | string | yes | |
lines[].amount_excl_tax | number | yes | 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 | yes | |
attachments[].content_type | string | Optional; not trusted. | |
attachments[].content_base64 | string | yes | 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 <number>'. |
Answers
201 | Posted |
422 | Unknown 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
| Name | In | Required | What it is |
|---|---|---|---|
Idempotency-Key | header | yes | Required on this call. Retrying with the same key returns the original response instead of doing it twice. Reusing a key with a different body is a 422. |
externalRef | path | yes | |
sourceSystem | query | Your system's name, the same on every call (for example shop). Identifies your references. |
Body a JSON array of these, up to 1 000 per call
| Field | Type | Required | What it is |
|---|---|---|---|
file_name | string | yes | |
content_type | string | Optional; not trusted. | |
content_base64 | string | yes | The file, base64. A data: URL prefix is accepted. |
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 |
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"
}
]'