Getting started
API key
Every request carries the shop key in the Authorization: Bearer cpk_… header. A key works only for its shop: another shop's address, payment or invoice looks like a missing one, 404. A missing or invalid key gives 401 UNAUTHORIZED, a disabled shop gives 403 SHOP_DISABLED. A shop may have several keys; a revoked key stops working at once.
The access of a key is chosen when it is issued and does not change later:
- invoices only: invoices,
GET /shop,/chains,/currencies. Put this key into CMS plugins and websites: everyone with access to the CMS admin can see it, and it cannot withdraw money from the shop. Addresses, payments, balances and payouts answer403 KEY_ACCESS_DENIED; - full: adds addresses, payments, balances and payouts. Your own server that withdraws money needs it; keep it only there.
GET /shop shows the access of the key in key.access.
In the dashboard a key can get an IP allowlist: addresses and subnets (203.0.113.7, 203.0.113.0/24, 2001:db8::/48), up to 20 entries. A request from any other address then gets 403 IP_NOT_ALLOWED, and details.ip holds the address it came from: that is the one to add. An empty list lets the key work from any address. The address is the one the request reached us from: behind NAT, a proxy or in a cloud it is the server's public address, not its internal one.