Shopper API overview

Plain REST and JSON on every store domain for headless storefronts, AI agents and apps: catalog, content, checkout sessions and the hand-off to Tringify checkout.

The shopper API serves a store's published catalog and content (pages, blog, custom content), searches the store, prices it for the shopper's country and language, and turns a cart into a checkout session whose checkout_url opens Tringify checkout, where the shopper pays. Headless storefronts, AI agents and apps all use the same API. It is plain REST and JSON; there is no GraphQL.

Base URL#

bash
https://<store domain>/api/shop/2026-11

Call the store's primary domain. The version is in the path; 2026-11 is the current version.

Callers and keys#

Caller

How it calls

What it sees

Limits

AI agent or anyone else

No key

Products sold on the store's built-in AI agents channel

Per client address and per store

Headless storefront, in the browser

Tringify-Shop-Key: tfpk_… (storefront key)

Products sold on that headless storefront's channel

Its own, higher bucket; only from the storefront's allowed origins

Headless storefront, from its server

Authorization: Bearer tfsk_… (server key)

As above

As above; may forward the shopper's details

  • The merchant creates headless storefronts and their keys in Store Admin under Settings > Headless. Each headless storefront is its own sales channel; it starts with the same products as Online Store.

  • A storefront key is public by design: it ships in browser code and only reads published data and creates checkout sessions. Requests from an origin the storefront does not allow are refused with SHOP_API_ORIGIN_NOT_ALLOWED.

  • A server key must never reach a browser: a request with a server key and an Origin header is refused. Only a server key may send Tringify-Shop-Client-IP, Tringify-Shop-Client-User-Agent and Tringify-Shop-Client-Cookies (the cookies installed apps declared); otherwise SHOP_API_FORWARDING_REFUSED.

  • A revoked or unknown key is treated as no key: the request gets anonymous limits and the AI agents catalog, and every response says so in Tringify-Shop-Key-Status: revoked (or unknown).

  • An agent can name itself in Tringify-Shop-Agent (for example ChatGPT); otherwise its user agent names it. Orders it brings show that name.

Shopper context#

GET /context lists the countries the storefront sells to; each has exactly one currency, its languages and default language, its Country URL and whether a consent banner is required there (and for which purposes). Every catalog and checkout call takes country and language only (the currency follows the country) and returns the context it used.

Request

With a key

Without a key (agent)

No country

SHOP_API_COUNTRY_REQUIRED

The storefront's primary country; context.defaulted lists country

Language not offered in the country

SHOP_API_LANGUAGE_NOT_SERVED (lists the languages)

The country's default language; context.defaulted lists language

Country not served

SHOP_API_COUNTRY_NOT_SERVED (lists the countries)

Same

Caching#

  • Catalog and content reads (context, products, listings, pages, menus, policies, blog posts and comments, custom content, search and search suggestions) are kept for 60 seconds at the edge, keyed by store, the caller's catalog (no key, or the key), and the sorted query, which holds the country and language. A key buys a bigger rate-limit bucket, not fresher data.

  • Never kept: checkout sessions, shopper sessions and consent, the events intake, posting blog comments, customer calls, and server calls that forward the shopper's details.

  • A change to a product or page reaches callers within those 60 seconds. Responses carry X-TF-Shop-Cache: hit or miss.

Rate limits#

Bucket

Burst

Sustained

No key, per client address and store

60

10 requests/second

Storefront or server key

600

100 requests/second

Storefront key, per shopper address

120

20 requests/second

Every caller of one store together

1,200

200 requests/second

Development and transfer stores

20

1 request/second

Limits are checked at the edge before the cache and before any work. A refused request answers 429 with SHOP_API_RATE_LIMITED and Retry-After. Each key's requests per day show in Settings > Headless.

Errors#

Errors answer {"error": {"code", "message", "field", "params"}}. message is in the request's language; params holds the values in it. Codes start with SHOP_API_ (requests) or SHOP_CHECKOUT_ (why a checkout session left something out).