Authentication
Every request names one store in its URL and carries a token for that store. The Admin API acts for a merchant or an app and takes a bearer token; the Storefront API serves a store's buyers and takes a storefront token.
Admin API
POST https://api.tanqory.com/admin/2026-10/stores/<storeId>/graphql
Authorization: Bearer <access token>
Content-Type: application/json
{ "query": "{ shop { name } }" }
The Admin API accepts two kinds of bearer token.
Merchant session tokens
Signing in to Tanqory starts a session. Its access token is a signed JWT (PS256) valid for 15 minutes, renewed with a refresh token that changes every time it is used. A session stays open for 7 days after its last renewal and ends 30 days after sign-in at the latest. Signing out, resetting the password or ending the session from the account's device list stops its access token at once, because every request checks the session.
A session token opens only the stores the merchant is a member of, with the permissions of their role in each store. A role that cannot make changes can run queries but not mutations.
Delegate access tokens
A delegate access token holds some of the scopes of the token that made it, for one store. Create one with
delegateAccessTokenCreate: list the scopes
in delegateAccessScope and, optionally, a lifetime in seconds in expiresIn. The token is in the
mutation's answer only; Tanqory keeps just a hash of it. Send it as a bearer token.
- Every root field of a request must be opened by one of the token's scopes. A
write_scope also opens the reads of the same resource:write_productsopens whatread_productsopens. Each operation's page in this reference shows the scope it needs, and Access scopes lists them all. Theshopquery is open to every token. - A field the token's scopes do not open is refused with
ACCESS_DENIED(see Errors). - A delegate token cannot make another delegate token.
- A token made from a merchant's session acts for that merchant. It must expire, at most 90 days after it is made, and it stops working when the merchant signs out of that session or leaves the store. Each request is also held to the merchant's own permissions.
delegateAccessTokenDestroyrevokes a token.
Storefront API
POST https://<store domain>/api/v1/stores/<storeId>/2026-10/graphql X-Tanqory-Storefront-Access-Token: <storefront access token> Content-Type: application/json { "query": "{ shop { name } }" }
Public access
For code that runs in the buyer's browser or app. Send a storefront access token in
X-Tanqory-Storefront-Access-Token. Make one with the Admin API's
storefrontAccessTokenCreate; an app can
hold up to 100 active storefront access tokens per store. These tokens are meant to be seen
by buyers.
Private access
For code on your own server only. Send Tanqory-Storefront-Private-Token with an unexpired delegate access
token of the store that holds at least one unauthenticated_ scope. Only a private request may pass on the
buyer's IP address, in Tanqory-Storefront-Buyer-IP. Never send a private token to a browser. When a request
carries both headers, the private one is used. A delegate token whose scopes are all unauthenticated_ opens
nothing in the Admin API.
Errors
The token and the store are checked before GraphQL runs, and these answers are plain HTTP, sent as application/problem+json (RFC 9457). Branch on code; the error and errors members are the older form of the same answer and will be removed.
| Status | Body | When |
|---|---|---|
| 401 | {"type":"https://docs.tanqory.com/errors/invalid_access_token","title":"Invalid access token","status":401,"detail":"Send a valid access token in the Authorization header. The token sent is missing, not valid, or belongs to another store.","code":"invalid_access_token","request_id":"req_…","error":{"code":"invalid_access_token","message":"Send a valid access token in the Authorization header. The token sent is missing, not valid, or belongs to another store.","status":401}} | No token, or one that is not valid: malformed, expired or revoked, or a store token (delegate or storefront) made for another store. |
| 404 | {"type":"https://docs.tanqory.com/errors/not_found","title":"Not found","status":404,"detail":"Not Found","code":"not_found","request_id":"req_…","errors":"Not Found"} | The store id is not a store id, there is no such store, or (Admin API) the token's holder is not a member of it. It is one answer for all three, so a token cannot find out which stores exist. |
Inside GraphQL, an operation the token may not run answers HTTP 200 with an error whose code is
ACCESS_DENIED and a message that says what is missing:
{
"errors": [
{
"message": "Access denied for orders field. Required access: `read_orders` access scope.",
"extensions": { "code": "ACCESS_DENIED", "type": "permission_error", "status": 403 }
}
]
}
The same code answers when the role or the staff permissions of the merchant behind the token do not allow the
operation. A mutation that runs but finds a problem with its input answers in its payload's userErrors
instead. Cost errors are described in Rate limits and query cost.
MCP clients (OAuth 2.1)
Tanqory's remote MCP server, at https://api.tanqory.com/v1/mcp (Streamable HTTP, MCP protocol
2025-11-25; at initialize it agrees on one of 2025-11-25, 2025-06-18), lets an AI assistant work with one store. MCP clients sign in with OAuth 2.1 as the MCP
authorization specification describes:
- Discovery. A request without a valid token answers 401 with
WWW-Authenticate: Bearer resource_metadata="…", pointing to the protected-resource metadata (RFC 9728) athttps://api.tanqory.com/.well-known/oauth-protected-resource/v1/mcp. That names the authorization server, whose metadata (RFC 8414) is athttps://api.tanqory.com/.well-known/oauth-authorization-server. - Registration. A client registers itself with dynamic client registration (RFC 7591) at
https://api.tanqory.com/v1/oauth/register. Only public clients are supported: there is no client secret. Each redirect URI must be https, or http onlocalhost,127.0.0.1or[::1], without a fragment. - Authorization. The client sends the merchant to
https://api.tanqory.com/v1/oauth/authorizewith the authorization code flow and PKCE; the only code challenge method isS256. Theresourceparameter (RFC 8707) is required and must name the MCP server. The redirect URI must match a registered one exactly (on a loopback address, any port). The merchant signs in, picks one store and approves the scopes, within 10 minutes. - Token.
https://api.tanqory.com/v1/oauth/tokenexchanges the code, together with its code verifier, for an access token and a refresh token. A code can be used once, within 5 minutes; a code used a second time also revokes what it made.
| Token | Lifetime and rules |
|---|---|
| Access token | A JWT valid for 15 minutes, bound to the MCP server (its aud) and to the one store the merchant picked. |
| Refresh token | Changes every time it is used; presenting an old one again ends the connection. The connection stays open for 30 days after the last refresh and ends 90 days after approval at the latest. |
Scopes an MCP client can ask for: read_products, write_products, read_orders, read_customers, read_inventory, read_themes, write_publications, write_themes, read_content, write_content, read_online_store_navigation, write_online_store_navigation, write_legal_policies, write_files, write_shop_settings, write_online_store_preferences. A merchant whose role cannot make changes gets
read scopes only, at approval and at every refresh. tools/list shows the tools the token's scopes open; any
other tool answers 403 insufficient_scope. The connection appears in the merchant's device list, and
signing it out there ends it.