Create a checkout intent
An agent’s hand-off to the shopper. The basket is priced for the address, the price is frozen, and the
stock is held until the intent expires (30 minutes). The response carries a confirmation_token, once:
it is stored only as a hash, so a replay of the same Idempotency-Key returns the intent without it.
No order exists and nothing is charged until the shopper confirms.
confirmation_mode chooses who collects the shopper’s approval:
token(the default): the agent confirms throughPOST /v1/agent/checkout-intents/{id}/confirm, sending the token with the shopper’s credential or contact details.confirmation_urlis null.hosted:confirmation_urlis a link to the store’s own confirmation page,https://{store host}/confirm/{intent_id}#t={confirmation_token}. The token travels in the URL fragment, which a browser does not send to any server. The agent hands the link to the shopper; the page shows the frozen quote, takes the shopper’s contact details, confirms the intent and passes payment to the store’s own payment provider (a Stripe Checkout redirect, a Paystack popup, PayPal buttons, or a custom provider’s redirect). Card details are entered only on the provider’s page.
A replay of the same Idempotency-Key returns confirmation_token and confirmation_url as null in
either mode, with replayed: true.
The intent is refused when a line cannot be bought (409 items_unavailable), the store does not deliver
to the address (409 shipping_not_deliverable), or shipping or tax cannot be priced for it
(409 quote_incomplete); each carries the quote in error.details.
A shopper credential, when sent, ties the intent to that shopper, who must then confirm with it.
With a marketplace operator key the basket may span several sellers of that marketplace, priced as
POST /v1/agent/quote prices it for that key; the intent records each seller’s lines in sellers.
Only token confirmation is available (hosted answers 400). A line not sold on that marketplace is
refused with 409 items_unavailable, and nothing is created. Stock is held from confirmation, for the
payment window, rather than from creation. Shopper credentials are sent at confirmation.
Limits on a publishable key. An intent holds stock, so a publishable key — which anyone can read from a
storefront — is bounded: 60 new intents an hour from one address, 5 waiting for confirmation at once per
address (per shopper when a shopper credential is sent), 10 units of one item per intent for a guest and 25
for a signed-in shopper, and guests together may hold at most half of an item’s stock. Past a limit the
answer is 409 hold_limit_reached with details.limit, or 429 rate_limited with Retry-After. A secret key
(the store’s own server) is bound only by its plan.
Verified assistant platforms. Many shoppers using one assistant reach the store from the same few network
addresses, so a request identified as coming from an assistant platform Galactic Core recognises is counted
per store and platform instead of per address: 600 new intents an hour and 100 waiting for confirmation. A
request is identified either by a Web Bot Auth signature (HTTP Message Signatures with tag="web-bot-auth",
an Ed25519 key from the platform’s published key directory, created within the last five minutes, covering
@authority and the platform’s Signature-Agent member) or by a source address inside the platform’s
published egress ranges. The per-item limits and the share-of-stock limit apply unchanged. A signature that
cannot be verified is not an error: the request is counted by address, as an unsigned one is.
curl --request POST \
--url https://api.tybritelabs.com/v1/agent/checkout-intents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"items": [
{
"variant_id": "fbe89cdf-90a3-4050-a43b-e4c42302484a",
"quantity": 1
}
],
"shipping_address": {
"name": "John Doe",
"line1": "350 Fifth Avenue",
"city": "New York",
"state": "NY",
"postal_code": "10118",
"country": "US"
}
}
'import requests
url = "https://api.tybritelabs.com/v1/agent/checkout-intents"
payload = {
"items": [
{
"variant_id": "fbe89cdf-90a3-4050-a43b-e4c42302484a",
"quantity": 1
}
],
"shipping_address": {
"name": "John Doe",
"line1": "350 Fifth Avenue",
"city": "New York",
"state": "NY",
"postal_code": "10118",
"country": "US"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [{variant_id: 'fbe89cdf-90a3-4050-a43b-e4c42302484a', quantity: 1}],
shipping_address: {
name: 'John Doe',
line1: '350 Fifth Avenue',
city: 'New York',
state: 'NY',
postal_code: '10118',
country: 'US'
}
})
};
fetch('https://api.tybritelabs.com/v1/agent/checkout-intents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tybritelabs.com/v1/agent/checkout-intents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'variant_id' => 'fbe89cdf-90a3-4050-a43b-e4c42302484a',
'quantity' => 1
]
],
'shipping_address' => [
'name' => 'John Doe',
'line1' => '350 Fifth Avenue',
'city' => 'New York',
'state' => 'NY',
'postal_code' => '10118',
'country' => 'US'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tybritelabs.com/v1/agent/checkout-intents"
payload := strings.NewReader("{\n \"items\": [\n {\n \"variant_id\": \"fbe89cdf-90a3-4050-a43b-e4c42302484a\",\n \"quantity\": 1\n }\n ],\n \"shipping_address\": {\n \"name\": \"John Doe\",\n \"line1\": \"350 Fifth Avenue\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10118\",\n \"country\": \"US\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tybritelabs.com/v1/agent/checkout-intents")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"variant_id\": \"fbe89cdf-90a3-4050-a43b-e4c42302484a\",\n \"quantity\": 1\n }\n ],\n \"shipping_address\": {\n \"name\": \"John Doe\",\n \"line1\": \"350 Fifth Avenue\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10118\",\n \"country\": \"US\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/agent/checkout-intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"variant_id\": \"fbe89cdf-90a3-4050-a43b-e4c42302484a\",\n \"quantity\": 1\n }\n ],\n \"shipping_address\": {\n \"name\": \"John Doe\",\n \"line1\": \"350 Fifth Avenue\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10118\",\n \"country\": \"US\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "cdd0070c-01d1-4095-97d2-29665e51ee46",
"status": "pending_confirmation",
"confirmation_mode": "token",
"expires_at": "2026-11-03T11:09:23.756+00:00",
"order_id": null,
"customer_id": null,
"total": 2629.95,
"currency": "EUR",
"items": [
{
"quantity": 1,
"variant_id": "df6d046e-2c81-403f-b4e4-f8e42017811b"
}
],
"quote": {
"tax": {
"amount": 362.75,
"source": "fallback",
"status": "quoted",
"prices_include_tax": true
},
"lines": [
{
"sku": "sku-hosted-1",
"name": "The 3p Fulfilled Snowboard",
"stock": 14,
"quantity": 1,
"available": true,
"line_total": 2629.95,
"list_price": 2629.95,
"product_id": "02525ff5-0916-4f00-857c-c2c6237e671b",
"unit_price": 2629.95,
"variant_id": "df6d046e-2c81-403f-b4e4-f8e42017811b",
"variant_name": "Default",
"category_name": "General",
"unavailable_reason": null
}
],
"currency": "EUR",
"discount": {
"amount": 0,
"promotion": null
},
"shipping": {
"amount": 0,
"status": "quoted",
"is_free": true,
"description": "Free delivery: the order qualifies",
"free_threshold": 100
},
"subtotal": 2629.95,
"grand_total": 2629.95,
"total_is_final": true,
"shipping_address": {
"city": "New York",
"name": "Test Shopper",
"line1": "350 Fifth Avenue",
"state": "NY",
"country": "US",
"postal_code": "10118"
},
"unavailable_count": 0
},
"created_at": "2026-11-03T10:39:23.780689+00:00",
"confirmed_at": null,
"cancelled_at": null,
"confirmation_token": null,
"confirmation_url": null,
"replayed": true
},
"evidence": [
{
"source": "agent",
"id": "cdd0070c-01d1-4095-97d2-29665e51ee46",
"field": "checkout_intent"
}
],
"computed_at": "2026-11-03T10:39:24.770Z",
"currency": "EUR",
"environment": "sandbox"
}Authorizations
API Key Authentication
Use your API key in the Authorization header:
Authorization: Bearer tybrite_sk_live_YOUR_KEY
Key Types:
Secret Keys (Server-Side Only):
- Format:
tybrite_sk_live_*(production) ortybrite_sk_test_*(sandbox) - Full read/write access to all endpoints
- ⚠️ NEVER expose in client-side code or public repositories
- Required for: every write a shopper does not make for themselves, authentication, payment verification, AI recommendations
Publishable Keys (Client-Safe):
- Format:
tybrite_pk_live_*(production) ortybrite_pk_test_*(sandbox) - Catalogue reads, plus the actions a shopper takes for themselves
- ✅ Safe for client-side JavaScript, mobile apps, and public code
- Allowed for: browsing products, search, CMS content, pricing queries, cart and wishlist, reviews, storefront events, and the Agent API's quotes, cart drafts and checkout intents
Endpoint-Specific Requirements:
- Authentication endpoints (
/v1/auth/*): state-changingPOSTcalls require a secret key, for store and marketplace keys alike;GET /v1/auth/meaccepts either key - Payment verification (
POST /v1/payments/verify): Secret key required - AI Recommendations (
POST /v1/recommendations): Secret key required - Semantic Search (
POST /v1/search): Both key types allowed (read-only operation) - Shopper actions (cart, wishlist, reviews, storefront events, Agent API quotes, cart drafts and checkout intents): Both key types allowed
- All other write operations: Secret key required
- All read operations: Both key types allowed
Using a publishable key for restricted operations returns 403 Forbidden.
Limited publishable keys:
A publishable key can be limited to the products that carry one tag (for example starter:jewellery), created from
the store's Developers page. The limit applies to the key, never to the shopper: shopper sign-up and sign-in stay store-wide.
- Reads return only the slice: products (with their facets, filters, search, brands and specifications), categories and
subcategories that hold in-slice products, collections, promotions, posts and lookbooks that carry the tag, reviews of
in-slice products, prices, discovery lists and the store information summary, with every count computed on the slice.
A product outside the slice answers
404, as if it did not exist. - A write that names a product or variant outside the slice (adding to the cart or wishlist, reserving stock, an order line,
a review, a promotion calculation, a storefront event) answers
403with the error codeout_of_scope, and nothing is written or reserved. An order is refused as a whole. - A route that carries no slice behaviour is not available to the key: it answers
403withendpoint_not_allowed. - Orders placed through such a key record the tag on the order's attribution as
key_scope. - Secret keys and connected-app keys cannot be limited.
- Responses are cached per key limit: a limited key never receives a response cached for the whole store, and the reverse.
Headers
Body
Response
A replay of an Idempotency-Key already used with the same items
curl --request POST \
--url https://api.tybritelabs.com/v1/agent/checkout-intents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"items": [
{
"variant_id": "fbe89cdf-90a3-4050-a43b-e4c42302484a",
"quantity": 1
}
],
"shipping_address": {
"name": "John Doe",
"line1": "350 Fifth Avenue",
"city": "New York",
"state": "NY",
"postal_code": "10118",
"country": "US"
}
}
'import requests
url = "https://api.tybritelabs.com/v1/agent/checkout-intents"
payload = {
"items": [
{
"variant_id": "fbe89cdf-90a3-4050-a43b-e4c42302484a",
"quantity": 1
}
],
"shipping_address": {
"name": "John Doe",
"line1": "350 Fifth Avenue",
"city": "New York",
"state": "NY",
"postal_code": "10118",
"country": "US"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [{variant_id: 'fbe89cdf-90a3-4050-a43b-e4c42302484a', quantity: 1}],
shipping_address: {
name: 'John Doe',
line1: '350 Fifth Avenue',
city: 'New York',
state: 'NY',
postal_code: '10118',
country: 'US'
}
})
};
fetch('https://api.tybritelabs.com/v1/agent/checkout-intents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tybritelabs.com/v1/agent/checkout-intents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'variant_id' => 'fbe89cdf-90a3-4050-a43b-e4c42302484a',
'quantity' => 1
]
],
'shipping_address' => [
'name' => 'John Doe',
'line1' => '350 Fifth Avenue',
'city' => 'New York',
'state' => 'NY',
'postal_code' => '10118',
'country' => 'US'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tybritelabs.com/v1/agent/checkout-intents"
payload := strings.NewReader("{\n \"items\": [\n {\n \"variant_id\": \"fbe89cdf-90a3-4050-a43b-e4c42302484a\",\n \"quantity\": 1\n }\n ],\n \"shipping_address\": {\n \"name\": \"John Doe\",\n \"line1\": \"350 Fifth Avenue\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10118\",\n \"country\": \"US\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tybritelabs.com/v1/agent/checkout-intents")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"variant_id\": \"fbe89cdf-90a3-4050-a43b-e4c42302484a\",\n \"quantity\": 1\n }\n ],\n \"shipping_address\": {\n \"name\": \"John Doe\",\n \"line1\": \"350 Fifth Avenue\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10118\",\n \"country\": \"US\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/agent/checkout-intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"variant_id\": \"fbe89cdf-90a3-4050-a43b-e4c42302484a\",\n \"quantity\": 1\n }\n ],\n \"shipping_address\": {\n \"name\": \"John Doe\",\n \"line1\": \"350 Fifth Avenue\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10118\",\n \"country\": \"US\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "cdd0070c-01d1-4095-97d2-29665e51ee46",
"status": "pending_confirmation",
"confirmation_mode": "token",
"expires_at": "2026-11-03T11:09:23.756+00:00",
"order_id": null,
"customer_id": null,
"total": 2629.95,
"currency": "EUR",
"items": [
{
"quantity": 1,
"variant_id": "df6d046e-2c81-403f-b4e4-f8e42017811b"
}
],
"quote": {
"tax": {
"amount": 362.75,
"source": "fallback",
"status": "quoted",
"prices_include_tax": true
},
"lines": [
{
"sku": "sku-hosted-1",
"name": "The 3p Fulfilled Snowboard",
"stock": 14,
"quantity": 1,
"available": true,
"line_total": 2629.95,
"list_price": 2629.95,
"product_id": "02525ff5-0916-4f00-857c-c2c6237e671b",
"unit_price": 2629.95,
"variant_id": "df6d046e-2c81-403f-b4e4-f8e42017811b",
"variant_name": "Default",
"category_name": "General",
"unavailable_reason": null
}
],
"currency": "EUR",
"discount": {
"amount": 0,
"promotion": null
},
"shipping": {
"amount": 0,
"status": "quoted",
"is_free": true,
"description": "Free delivery: the order qualifies",
"free_threshold": 100
},
"subtotal": 2629.95,
"grand_total": 2629.95,
"total_is_final": true,
"shipping_address": {
"city": "New York",
"name": "Test Shopper",
"line1": "350 Fifth Avenue",
"state": "NY",
"country": "US",
"postal_code": "10118"
},
"unavailable_count": 0
},
"created_at": "2026-11-03T10:39:23.780689+00:00",
"confirmed_at": null,
"cancelled_at": null,
"confirmation_token": null,
"confirmation_url": null,
"replayed": true
},
"evidence": [
{
"source": "agent",
"id": "cdd0070c-01d1-4095-97d2-29665e51ee46",
"field": "checkout_intent"
}
],
"computed_at": "2026-11-03T10:39:24.770Z",
"currency": "EUR",
"environment": "sandbox"
}
