All documentation

Authentication and API keys

Every request carries one API key in the Authorization header:

http
Authorization: Bearer sk_live_Q7f2kLm9…

A key belongs to one business. Whatever it records shows in Likom Business's Activity and audit log under the key's name (for example "API key · Till 2"), so the business always knows which system did what.

Key format

A key is sk_live_ followed by 40 letters and digits, 48 characters in all. The first 16 characters (sk_live_ and 8 more) are its prefix. Likom Business shows the prefix so people can tell keys apart; it's useless on its own.

Likom Business stores only a one-way hash of each key. The full key is shown once, when it's created or rotated. If it's lost, rotate the key to get a new one.

Creating a key

Only the business's owners and co-owners can manage keys: Likom Business → Business & Branches → API keys. Each key has:

SettingWhat it does
NameWhat connects with it, e.g. "Till 2" or "Website". Shown in Activity and the audit log.
PermissionsWhat the key may do (scopes, below).
BranchOne branch (a till), or any branch (the system sends branch_id with each scan).
Largest billThe most one purchase can be. Empty: the business's Counter limit applies. Owners can go over the Counter limit at the Counter; keys never can.
Daily totalOptional. The most the key can record in one day, all purchases together.
Allowed addressesOptional. Public IP addresses or ranges (CIDR, IPv4 or IPv6), up to 20. Empty: any address.
ExpiresNever, in 90 days, or in 1 year.

Make one key per system or till. Then revoking one doesn't stop the others, and Activity shows which till recorded each purchase.

Permissions (scopes)

ScopeAllows
customers:identifyPOST /customers/identify, /customers/find, /customers/card
transactions:writePOST /transactions/preview, POST /transactions, and undoing the key's own purchases within 10 minutes
redemptions:writePOST /redemptions and undoing the key's own redemptions within 10 minutes
transactions:readGET /transactions (every transaction of the business, for reconciliation)
catalog:readGET /branches, GET /programs
transactions:refundUndo any purchase or redemption up to 30 days old, including staff's. Give it only to a system you fully trust.

GET /me works with any key. A call without the scope it needs gets 403 missing_scope, with the scope it needed in scope.

Branch lock

A key set to one branch can only scan and record there:

  • You can leave out branch_id; the key's branch is used.
  • Sending another branch's id gets 403 not_your_branch.
  • GET /branches and GET /transactions only show that branch.

A key for any branch must send branch_id when it identifies a customer (400 branch_required otherwise). GET /branches lists them.

Allowed addresses

When a key has allowed addresses, calls from anywhere else get 403 ip_not_allowed, even with the right key. Use your server's or store's fixed public IP. Don't use it if your POS connects from changing mobile networks.

Rotating and revoking

  • Rotate gives a new key with the same name and settings. The old key stops working at once, so update your system straight after.
  • Revoke stops a key at once, for good. Purchases it already recorded stay as they are.
  • An expired or revoked key, or a key of a deleted business, gets 401 api_key_invalid, exactly like a mistyped key.

Keeping keys safe

  • Call the API only from your server or POS. Never put a key in a web page, browser JavaScript, or a mobile app people download: anyone can read it there.
  • Keep keys in your POS settings, a secrets manager or environment variables, never in source code or a repository.
  • Log the prefix, never the whole key.
  • Give each key only the permissions it needs. A till rarely needs transactions:refund or transactions:read.
  • If a key may have leaked, revoke it in Likom Business first, then make a new one.

Wrong keys

Missing header: 401 api_key_missing. Wrong, revoked or expired key: 401 api_key_invalid. After 30 wrong keys from one network in 10 minutes, that network gets 429 rate_limited for a while, even with a good key.

Still need help? Troubleshooting · [email protected]