Authentication

Send your key in the Authorization header of every call.

Header
Authorization: Bearer sk_test_...

Keys

Starts withKindUse it
sk_live_Secret, liveOn your server, for real customers.
sk_test_Secret, testOn your server, in the sandbox.
pk_live_Publishable, liveIn a web page, such as the widget.
pk_test_Publishable, testIn 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:

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.