GraphQL API
A typed, client-facing GraphQL surface for storefront data and shopper journeys. The API is intentionally narrow: it exposes what a storefront needs, not internal operations.
Endpoint
Send POST requests to the Cartly GraphQL endpoint from your storefront server. The exact API origin comes from your environment configuration.
POST /api/graphql
Content-Type: application/json
{ "query": "...", "variables": {} }Headers
X-Storefront-HostRequired on every client request. Resolves the published storefront.
X-Cart-TokenRequired for cart and checkout operations. Keep it server-side.
X-Customer-TokenRequired for signed-in shopper operations.
Idempotency-KeyRequired for checkout. Reuse it for safe retries.
Operations
Catalog
storefrontProducts, storefrontProduct, storefrontCategories
Commerce
createCart, cart, setCartItem, removeCartItem, checkout
Store experience
storefrontShippingMethods, storefrontPaymentMethods, storefrontServiceCoverage
Customer
registerCustomer, customerLogin, customerAccount, customerOrders
Errors and retries
GraphQL errors include a stable code, message, optional path, and request id. Treat validation and authentication errors as user-actionable; retry only network and timeout failures.