From catalog to checkout
The storefront API gives you the primitives for product discovery, a durable cart, delivery coverage, payment options, and a safe checkout handoff.
Catalog
Use storefrontProducts for collection views and storefrontProduct for a detail route. Prices, stock, media, SEO fields, and variant choices are returned by the published storefront.
query Product($slug: String!) {
storefrontProduct(slug: $slug) {
slug title description seoTitle seoDescription
media { url altText kind variantId }
variants { id sku title price currency inStock }
}
}Cart lifecycle
Create a cart once, store the returned secret on your server, and send it as X-Cart-Token. Setting quantity to zero removes an item.
Create
createCartUpdate
setCartItemRead
cartCheckout
Checkout reserves the order and returns its payment session: open Cartly Checkout with sessionToken to pay online, see bank-transfer details or confirm cash on delivery. Always send the same Idempotency-Key when retrying the same submission.
mutation Checkout($input: CheckoutInput!) {
checkout(input: $input) {
orderId orderNumber total currency
sessionToken
payment { method reference }
}
}Delivery coverage
When a store uses service areas, ask whether a latitude/longitude point is covered before showing delivery as an option. An unconfigured store returns enabled: false.