Guides
Connect a third-party system
Connecting a customer
In your product, ask the customer for a KWN API key, and tell them the scopes you need — the fewest that do the job (Scopes). The customer creates it in Settings → Integrations → API keys, named after your product, and pastes it into your product. Store it encrypted, against that customer, on your server only. Call GET /meat once: check the company’s TRN and name against your records, and that the key holds the capabilities you need (andeInvoicing.availableif you send invoices).
Running the connection
Carry your ids as externalIdon every record you create, and look records up by it — never by name.Send an Idempotency-Keyon every create and reuse it on retries (Idempotency).Sync by updatedSinceon a schedule (Pagination and sync); stay within each company’s rate limit, which every key of that company shares.Branch on codein a refusal, never on the sentence (Errors).
When a key stops working
401 API_KEY_INVALID or MERCHANT_INACTIVE means stop calling with it and ask the customer to reconnect; do not retry in a loop. A 403 means the key lacks a scope or the company’s plan lacks an app: tell the customer which.
What a connection can never do
Reach another company. A key is bound to one; another company’s record answers 404.Manage users, keys, billing or settings, or see bank details and internal notes. Do more than the person who created the key may do.