Skip to main content

Authentication

Send the key as a Bearer token on every request:

Authorization: Bearer ksr_live_3f9a...

A key is ksr_live_ followed by 64 hexadecimal characters; a test key starts with ksr_test_ instead and reaches only the sandbox (see Test mode). Keep it on your server: anyone holding it acts for the merchant.

Permissions​

The merchant grants each key a level per resource, written resource:level:

PermissionAllows
customers:readlisting and reading customers
customers:writethe above, plus creating and updating customers
sales_invoices:readlisting and reading sales invoices, with their PDF and XML
sales_invoices:writethe above, plus issuing sales invoices
payments:readlisting and reading payments
payments:writethe above, plus recording payments
credit_notes:readlisting and reading credit notes, with their PDF and XML
credit_notes:writethe above, plus issuing credit notes

write includes read. A call the key is not allowed to make answers 403 missing_permission, and the error's requiredPermission names the permission it needs. More resources join as the API grows.

Branches​

A key may be limited to some of the merchant's branches. A call that names another branch answers 403 branch_not_allowed.

When a key stops working​

CodeStatusWhy
missing_api_key401no Authorization: Bearer header
invalid_api_key401the key is malformed or unknown
revoked_api_key401the merchant revoked it
expired_api_key401its expiry date has passed
tenant_suspended403the merchant's Kosoor account is suspended

None of these is fixed by retrying: ask the merchant for a new key or to restore its account.