Agent
Cancel a checkout intent
Cancels a pending intent and releases its stock hold at once.
POST
/
v1
/
agent
/
checkout-intents
/
{id}
/
cancel
Cancel a checkout intent
curl --request POST \
--url https://api.tybritelabs.com/v1/agent/checkout-intents/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tybritelabs.com/v1/agent/checkout-intents/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tybritelabs.com/v1/agent/checkout-intents/{id}/cancel', 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/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tybritelabs.com/v1/agent/checkout-intents/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/agent/checkout-intents/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "56f13df1-c566-4c5b-83ab-618e0cc47a50",
"status": "cancelled",
"confirmation_mode": "token",
"expires_at": "2026-09-28T22:24:32.905+00:00",
"order_id": null,
"customer_id": null,
"total": 1524.95,
"currency": "EUR",
"items": [
{
"quantity": 1,
"variant_id": "06cf8d3e-da82-4d6f-896f-d756f80c592f"
}
],
"quote": {
"tax": {
"amount": 210.34,
"source": "fallback",
"status": "quoted",
"prices_include_tax": true
},
"lines": [
{
"sku": "selling-plans-ski-wax-selling-plans-ski-wax",
"name": "Selling Plans Ski Wax",
"stock": 10,
"quantity": 1,
"available": true,
"line_total": 24.95,
"list_price": 24.95,
"product_id": "3afdb59a-7f7f-4abb-baa1-2e37709c1128",
"unit_price": 24.95,
"variant_id": "06cf8d3e-da82-4d6f-896f-d756f80c592f",
"variant_name": "Selling Plans Ski Wax",
"category_name": "General",
"unavailable_reason": null
}
],
"currency": "EUR",
"discount": {
"amount": 0,
"promotion": null
},
"shipping": {
"amount": 1500,
"status": "quoted",
"is_free": false,
"description": "USA",
"free_threshold": 100000
},
"subtotal": 24.95,
"grand_total": 1524.95,
"total_is_final": true,
"shipping_address": {
"city": "New York",
"name": "John Doe",
"line1": "350 Fifth Avenue",
"state": "NY",
"country": "US",
"postal_code": "10118"
},
"unavailable_count": 0
},
"created_at": "2026-09-28T21:54:32.986631+00:00",
"confirmed_at": null,
"cancelled_at": "2026-09-28T21:54:33.89+00:00"
},
"evidence": [
{
"source": "agent",
"id": "56f13df1-c566-4c5b-83ab-618e0cc47a50",
"field": "status"
},
{
"source": "orders",
"field": "stock hold released"
}
],
"computed_at": "2026-09-28T21:54:34.447Z",
"currency": "EUR",
"environment": "sandbox"
}{
"error": {
"code": "invalid_request",
"message": "The id in the path must be a valid UUID"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid Authorization header"
}
}{
"error": {
"code": "not_found",
"message": "Checkout intent not found: 00000000-0000-4000-8000-000000000000"
}
}{
"error": {
"code": "intent_not_pending",
"message": "This checkout intent is cancelled",
"details": {
"status": "cancelled"
}
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests for this API key. Please slow down and try again shortly.",
"remaining": 0,
"reset": 1706198400
}
}{
"error": {
"code": "server_error",
"message": "An unexpected error occurred"
}
}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: write operations, authentication, payment verification, AI recommendations
Publishable Keys (Client-Safe):
- Format:
tybrite_pk_live_*(production) ortybrite_pk_test_*(sandbox) - Read-only access (GET requests only, plus POST semantic search)
- ✅ Safe for client-side JavaScript, mobile apps, and public code
- Allowed for: browsing products, search, CMS content, pricing queries
Endpoint-Specific Requirements:
- Authentication endpoints (
/v1/auth/*): Secret key required - 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) - All write operations: Secret key required
- All read operations: Both key types allowed
Using a publishable key for restricted operations returns 403 Forbidden.
Path Parameters
The checkout intent.
Response
The cancelled intent
Show child attributes
Show child attributes
Where each figure in data was read from.
Show child attributes
Show child attributes
Available options:
production, sandbox ISO 4217 code every amount in data is expressed in.
⌘I
Cancel a checkout intent
curl --request POST \
--url https://api.tybritelabs.com/v1/agent/checkout-intents/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tybritelabs.com/v1/agent/checkout-intents/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tybritelabs.com/v1/agent/checkout-intents/{id}/cancel', 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/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tybritelabs.com/v1/agent/checkout-intents/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/agent/checkout-intents/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "56f13df1-c566-4c5b-83ab-618e0cc47a50",
"status": "cancelled",
"confirmation_mode": "token",
"expires_at": "2026-09-28T22:24:32.905+00:00",
"order_id": null,
"customer_id": null,
"total": 1524.95,
"currency": "EUR",
"items": [
{
"quantity": 1,
"variant_id": "06cf8d3e-da82-4d6f-896f-d756f80c592f"
}
],
"quote": {
"tax": {
"amount": 210.34,
"source": "fallback",
"status": "quoted",
"prices_include_tax": true
},
"lines": [
{
"sku": "selling-plans-ski-wax-selling-plans-ski-wax",
"name": "Selling Plans Ski Wax",
"stock": 10,
"quantity": 1,
"available": true,
"line_total": 24.95,
"list_price": 24.95,
"product_id": "3afdb59a-7f7f-4abb-baa1-2e37709c1128",
"unit_price": 24.95,
"variant_id": "06cf8d3e-da82-4d6f-896f-d756f80c592f",
"variant_name": "Selling Plans Ski Wax",
"category_name": "General",
"unavailable_reason": null
}
],
"currency": "EUR",
"discount": {
"amount": 0,
"promotion": null
},
"shipping": {
"amount": 1500,
"status": "quoted",
"is_free": false,
"description": "USA",
"free_threshold": 100000
},
"subtotal": 24.95,
"grand_total": 1524.95,
"total_is_final": true,
"shipping_address": {
"city": "New York",
"name": "John Doe",
"line1": "350 Fifth Avenue",
"state": "NY",
"country": "US",
"postal_code": "10118"
},
"unavailable_count": 0
},
"created_at": "2026-09-28T21:54:32.986631+00:00",
"confirmed_at": null,
"cancelled_at": "2026-09-28T21:54:33.89+00:00"
},
"evidence": [
{
"source": "agent",
"id": "56f13df1-c566-4c5b-83ab-618e0cc47a50",
"field": "status"
},
{
"source": "orders",
"field": "stock hold released"
}
],
"computed_at": "2026-09-28T21:54:34.447Z",
"currency": "EUR",
"environment": "sandbox"
}{
"error": {
"code": "invalid_request",
"message": "The id in the path must be a valid UUID"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid Authorization header"
}
}{
"error": {
"code": "not_found",
"message": "Checkout intent not found: 00000000-0000-4000-8000-000000000000"
}
}{
"error": {
"code": "intent_not_pending",
"message": "This checkout intent is cancelled",
"details": {
"status": "cancelled"
}
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests for this API key. Please slow down and try again shortly.",
"remaining": 0,
"reset": 1706198400
}
}{
"error": {
"code": "server_error",
"message": "An unexpected error occurred"
}
}
