Headless sites and agents never build checkout. A checkout session holds what the shopper wants and who they are; the store prices it with the same engine as its own checkout (taxes, shipping, duties, discounts); its checkout_url opens Tringify checkout, where the shopper pays.
Statuses#
Status |
Means |
|---|---|
|
Something is missing ( |
|
Everything is priced and nothing is missing |
|
The |
|
The order was placed: |
|
24 hours passed |
|
Cancelled with |
The session#
lines[]: each withstatus(ok,unavailable,needs_variant,needs_customisation), title, variant title, image,unit_price,line_totaland, when it was left out or lowered, amessage.shipping_options[]for the address (id,name,price,free) and the chosenshipping_option_id.totals:subtotal,discount,shipping,tax(withtax_included),dutieswhen collected at checkout,fees,total; each money value hasamount,currencyanddisplay. Until a shipping address is set on a cart that ships,totalsholds the merchandise only andtax,shippinganddutiesare null.messages[]: backend-worded reasons in the shopper's language, for exampleSHOP_CHECKOUT_ITEM_UNAVAILABLE,SHOP_CHECKOUT_VARIANT_REQUIRED,SHOP_CHECKOUT_ITEM_NEEDS_CUSTOMISATION,SHOP_CHECKOUT_QUANTITY_REDUCED,SHOP_CHECKOUT_ADDRESS_NOT_SHIPPABLE,SHOP_CHECKOUT_SHIPPING_OPTION_UNAVAILABLE,SHOP_CHECKOUT_COUPON_REFUSED. Show them as they are.checkout_url: present while the session can still be handed off and at least one line can be bought.
Hand-off#
Open checkout_url in the shopper's browser (or an in-app browser). It works once. Tringify checkout opens with the session's lines and discount code in a checkout of its own, prices them again and takes payment. When the session was created with a Tringify-Shop-Session token, checkout also takes that session's consent (no second banner), its browser ID and its touches and click IDs, so the order is attributed exactly as a theme checkout would be, and app server events use the same browser ID.
Orders#
The order carries the sales channel: the headless storefront's channel, or AI agents.
Its events carry
surface: headlessorsurface: agent, and agent orders the agent's name.An order with no qualifying touch is credited in Analytics to the headless storefront or agent by name (traffic medium Headless storefront or AI agent).
An agent session carries no consent unless the agent passes the buyer’s in
POST /sessions, so agent orders reach ad platforms only then.
Example#
curl -X POST https://shop.example.com/api/shop/2026-11/checkout-sessions \
-H 'Tringify-Shop-Key: tfpk_…' -H 'Tringify-Shop-Session: <token>' \
-H 'Content-Type: application/json' \
-d '{"country":"IN","lines":[{"product_id":233,"variant_id":1953,"quantity":1}],
"email":"shopper@example.com",
"shipping_address":{"first_name":"Asha","last_name":"Rao","address1":"12 MG Road",
"city":"Bengaluru","province_code":"IN-KA","postal_code":"560001","country_code":"IN"}}'