ReconSmiths Developers Your API keys

Reference

Customers

Who you sell to: create, update and find customers.

This page as plain text: customers.md

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

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_refstringyes
namestringyes
source_systemstringYour system's name, the same on every call (for example shop). Identifies your references.
party_typestring: ORGANISATION, PERSON
rolestring: CUSTOMER, SUPPLIER, EMPLOYEE
emailstringRequired when party_type is PERSON.
ccystringCurrency of the account provisioned for this party. One account per currency. Default "ZAR".
parent_external_refstringYour 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_numberstringnull 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_regstringSame rules as vat_number.
phonestringSame rules as vat_number.
addressobjectThe 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.unitstring
address.buildingstring
address.street_nostring
address.streetstring
address.suburbstring
address.citystring
address.provincestring
address.postal_codestring
address.country_codestring

Answers

200Parties 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.
422Validation or idempotency conflict

Example

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

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

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

Answers

200missing_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.
422This API key has no default entity.

Example

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