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
| 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 | |
name | string | yes | |
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 |
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 |
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
| Name | In | Required | What it is |
|---|---|---|---|
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. |
Example
curl -X GET 'https://api.reconsmith.com/v1/parties/incomplete' \
-H 'Authorization: Bearer $RECONSMITH_KEY'
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
| Name | In | Required | What it is |
|---|---|---|---|
q | query | yes | |
limit | query |
Answers
200 | Ranked matches |
Example
curl -X GET 'https://api.reconsmith.com/v1/parties/search' \
-H 'Authorization: Bearer $RECONSMITH_KEY'