Authentication with an API key

Every request to the Checkslip API needs your API key. Create keys on the API keys page of the web app.

Send the API key

Put the key in the Authorization header as a Bearer token on every request. Checkslip keys start with csk_ and go over HTTPS only.

Authorization: Bearer csk_…
curl https://api.checkslip.com/api/slips/lookup \
  -H "Authorization: Bearer $CHECKSLIP_API_KEY" \
  -H "Idempotency-Key: order-1042-slip-1" \
  -H "Content-Type: application/json" \
  -d '{"qr":"00330006000001010306902126302105340875102TH9104F86F"}'

What a key may do

When you create a key you choose what it may do. Give each key only the scopes your system uses.

ScopeWhat it allows
slip:lookupSend a QR or trans_ref to fetch the transfer the bank has on record (uses credit when found)
slip:readRead the account's lookup history
credit:readRead the credit balance, its expiry date and the credit history
webhook:readRead webhook endpoints and delivery history
webhook:manageCreate, edit and delete webhook endpoints (reading not included)
audit:readRead the account's API request log and change log
audit:exportCreate and download evidence files (needs audit:read too)
billing:readRead orders, receipts, credits and receipt details (including the tax ID)
billing:writeEdit the details printed on receipts issued from now on (a key cannot top up credits)
usage:readRead the account's credit usage

Keep keys safe

Replace a key

  1. Create a new key in the web app
  2. Switch your system to the new key
  3. Revoke the old key

A revoked or expired key stops working within 30 seconds (usually at once) and cannot be turned back on.

When a key has a problem

Requests answered with these errors use no credit. Every code is listed in Error codes

CodeHTTPMeaning
UNAUTHENTICATED401No key, or a key that cannot be used (malformed, revoked, expired or unknown); which one is not said, for safety
FORBIDDEN403The key does not have the scope this request needs
NOT_VIA_API_KEY403This can only be done in the web app, for example managing API keys or topping up credit
ACCOUNT_SUSPENDED403The account is suspended for now
RATE_LIMITED429Calls came faster than a limit allows: the account's, or this key's own cap when one is set. Wait the seconds in the Retry-After header, then send again