Skip to content

Authentication

API tokens, how to create and revoke them, what they reach and how a call is refused.

Updated

Every call carries an API token as a bearer:

Authorization: Bearer utk_...

A token acts as the seller who created it, in one business. A call may do what both that seller’s seat in the business and the token allow, so a token never does more than its seller could in the merchant app.

Create a token

Tokens are created in the merchant app, never through the API: open Account settings, then API tokens, and choose New token.

  • Name: what uses it, so you know what breaks if you revoke it.
  • Expires: after one of the periods the form offers, or never. An expired token stops working; make a new one.
  • Access: Everything I can do follows your access in the business, including what you are given later; or choose the permissions it gets, which are scopes. You can give only what you may do yourself.
  • Limits: a rate limit (calls a minute) and a quota (calls a day or a month), which apply on each store on its own. Left empty, it gets the default rate and no quota. See rate limits.

The token is shown once, right after you create it: copy it then, since nobody can see it again. You can change its limits later; its name, expiry and access stay as created, so make a new token to change them.

Your tokens are yours alone: other members of the business don’t see them. A seller holds at most 100 working tokens at once, across all their businesses. Creating one needs your seat to allow managing API tokens; otherwise ask a member of the business with full access to give you access.

What a token reaches

  • One business. A token created in a business reaches that business alone, on every store it has now or later, over this API and the merchant MCP server.
  • Stores by id. Store operations take the store’s id in the path, /v1/stores/{store}. A store outside the business answers 403 with the reason principal, exactly like one that does not exist, so a token can’t learn which stores exist elsewhere.
  • The business itself. GET /v1/merchants lists the business the token belongs to and the stores it may act on, and GET /v1/merchants/{merchant} reads its details and plan. Both need organization:read.

Refusals

Answer When
401, WWW-Authenticate: Bearer No Authorization header.
401, WWW-Authenticate: Bearer error="invalid_token" The header isn’t a bearer token, or the token is unknown, expired or revoked, or its seller no longer has a seat in the business. Signing in again won’t help: create a new token.
403, WWW-Authenticate: Bearer error="insufficient_scope" The token lacks the scope the operation needs. The reference names each operation’s scope.
403 with the reason principal The token may not act on this store or row: a store outside its business, or a file URL another token asked for.
403 with the reason plan The store’s plan doesn’t include what the call asks for.

Each refusal’s body is a problem whose context.reason says which. A token is never taken from the query string.

Revoke a token

Revoke a token on the same API tokens page. Anything using it stops working right away, and the webhook endpoints, integrations and redirects it set up are turned off; this can’t be undone. Access it granted and affiliates it made or changed stay until you end them, and automations it created keep running until you pause them. The page lists them when you revoke it, and shows each token’s last use and its calls on the store you are in.

Keep tokens safe

  • Store a token as a secret, never in code, a repository or a URL.
  • Give each script its own token with only the scopes it needs, so revoking one breaks nothing else.
  • Prefer a token that expires, and make a new one before it does.
  • Call the API from a server, never from a browser or an app your customers run: a token acts as you. To build a storefront, use the customer API instead.

Type to search…

↑↓ navigate↵ selectEsc close