Authentication
Send your key in the Authorization header of every call.
Authorization: Bearer sk_test_...
Keys
| Starts with | Kind | Use it |
|---|---|---|
sk_live_ | Secret, live | On your server, for real customers. |
sk_test_ | Secret, test | On your server, in the sandbox. |
pk_live_ | Publishable, live | In a web page, such as the widget. |
pk_test_ | Publishable, test | In a web page, in the sandbox. |
The shop owner makes keys in the dashboard under Settings, then API keys. We show a key once and keep only a hash of it, so we can't show it again. Revoking a key stops it at once. A test key works on the shop's sandbox, so the key decides the mode.
What a publishable key can do
A publishable key is public: anyone can read it in the page. So it can only do what is safe once a customer has proved they hold the phone:
GET /v1/rewards: the rewards on offer.POST /v1/otp/sendandPOST /v1/otp/verify, for purposemember_accessand a phone number.POST /v1/memberswith theotp_verificationfrom the verify call. It returns amember_token. Send"create": falseto only find a card: a number with no card yet answers{"found": false}and nothing is written.GET /v1/members/{id}and its transactions, with that token.
Everything else, earn, redeem and reverse included, needs a secret key.
The member token
Send it as Nimbuu-Member-Token to read that one member. It lasts 30 minutes and can't write anything. There is no refresh: after 30 minutes the customer confirms a new code.
Browsers
The routes a publishable key can call answer requests from any website, without cookies. Earn, redeem and reverse don't. A secret key sent from a web page on another site is refused with 403 not_allowed, before anything is written. Never put a secret key in a web page.
Rate limits
Calls are limited per key: 600 a minute for a secret key, and 600 a minute for a publishable key, of which 30 a minute from one IP address. Past that, calls get 429 rate_limited with retry_after. See Errors and limits.