Skip to content
Coursey CreativeSign in

Authentication

Four kinds of access, and the API key is never required.

The API key is optional

Every storefront route accepts an X-CCP-Api-Key header and none of them requires one. Leave it out and the request is anonymous: no lookup, no cost, and every public endpoint answers exactly as it would with a key. That is the mode the Framer components use.

Send one and it is checked on every request. A key that is malformed, unknown or revoked is refused with a 401. A key issued to a different store, or used from a browser origin it has not been allowed on, is refused with a 403. So a key buys you three things: you can revoke it, you can bind it to your site, and its reads draw a wider budget -- 600 per minute for each visitor, against 120 per minute without one. Its traffic is also shown against it in the panel, so you can see which site is sending what.

X-CCP-Api-Key: ccp_pk_live_YOUR_KEY

Keys are publishable. They begin ccp_pk_live_, they are created in the panel under Settings and API keys, and they are safe to ship in a page. There is no secret key, because nothing on this API grants more than the storefront already shows.

Public

18 endpoints answer with no credential at all: the catalogue, the gallery, the store configuration, and the sign-in and review forms a storefront submits. Each is scoped by the store slug in its path, returns only what the storefront itself shows, and carries open CORS so a page on any origin can call it.

Customer token

A shopper signs in with a one-time code. POST /auth/send-code emails it and POST /auth/verify-code exchanges it for an access token and a refresh token. Send the access token on every request that acts for that shopper:

Authorization: Bearer <access_token>

The access token lasts an hour. POST /auth/refresh takes the refresh token and returns a new pair, so a shopper stays signed in across tabs and days without seeing a code again. A request with the token missing, malformed or expired is refused with a 401.

20 endpoints require it. They are the shopper's own things: their orders, profile, messages and subscriptions, and the threads they post.

Optional on 8 more

These work for a guest and do more for a member. Checkout completes without a token; with one, the order is linked to the shopper and their details are filled in. Community and forum reads show a signed-in member what they may do.

Shared secrets and signed tokens

3 endpoints are called by systems rather than shoppers, and each carries its own credential.

  • Form order webhook. A per-store token, sent as an x-ccp-webhook-token header or a token query parameter and compared in constant time. Missing or wrong is a 401.
  • Checkout recovery. A signed recovery token in the token query parameter, from the link in a recovery email. It mints a fresh checkout session for that cart and nothing else.
  • Reservations calendar. The feed's secret token in the token query parameter. A wrong token is a 404, not a 401, so the response does not confirm that a feed exists.

Rate limits

Every read of the catalogue, the gallery, the configuration and the community counts against a budget, and every budget is counted across all of the platform's servers rather than per instance, so the number means what it says.

Without a key120 per minute

Per address, per store. Room for a shopper browsing quickly and for an office behind one address; not for a scraper.

With a key600 per minute

Per key, per address. The key is what makes the wider budget safe to give out: it can be revoked, it can be bound to your site, and its traffic is shown against it in the panel. It is per key and address rather than per key because the key is public, and a budget shared by everyone who holds it would let one visitor exhaust it for every other.

Checkout verify30 per minute

Per address, per store, key or no key. That read can create an order, so it has a write's budget.

Writes have budgets of their own, printed on each endpoint's page. A refused request is a 429 whose body carries retryAfter in seconds and whose Retry-After header repeats it. The SDK retries a throttled read with backoff, so a page that brushes the limit recovers on its own.

What a refusal looks like

Every route validates its input before it does anything else, and every refusal carries a status you can branch on. Key errors also carry a machine-readable code, so a client can tell a revoked key from a typo.

400

A field failed validation. The response names every field that failed.

401

The API key is malformed, unknown or revoked (invalid_api_key, api_key_revoked), or the customer token is missing, malformed or expired.

403

The key belongs to another store (api_key_business_mismatch) or is being used from an origin it is not allowed on (origin_not_allowed).

404

No such store, or no such record in it.

429

The budget for this address, or for this key on this address, is spent (rate_limited). The body carries retryAfter in seconds and the Retry-After header repeats it.