curl --request POST \
--url 'https://prod-api.stateset.cloud.stateset.app/api/v1/checkout_sessions/{checkout_session_id}/cancel' \
--header 'Authorization: Bearer YOUR_API_KEY'
{
"created_at": "2026-08-31T14:22:05Z",
"customer": {
"billing_address": {
"city": "San Francisco",
"country": "US",
"email": "ada.lovelace@example.com",
"line1": "548 Market St",
"line2": "Suite 400",
"name": "Ada Lovelace",
"phone": "+1 415 555 0142",
"postal_code": "94107",
"region": "CA"
},
"shipping_address": {
"city": "San Francisco",
"country": "US",
"email": "ada.lovelace@example.com",
"line1": "548 Market St",
"line2": "Suite 400",
"name": "Ada Lovelace",
"phone": "+1 415 555 0142",
"postal_code": "94107",
"region": "CA"
}
},
"fulfillment": {
"options": [
{
"est_delivery": null,
"id": null,
"label": null,
"price": null
}
],
"selected_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"image_url": "https://cdn.example.com/products/tent-2p.jpg",
"quantity": 2,
"sku": "SKU-TENT-2P-GRN",
"title": "Replacement tent pole set",
"unit_price": {
"amount": null,
"currency": null
},
"variant_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
],
"links": {
"order_permalink": "string",
"privacy": "string",
"terms": "string"
},
"messages": [
{
"code": "string",
"message": "Two-person tent, green — replacement for damaged pole set.",
"param": "string",
"type": "standard"
}
],
"status": "pending",
"totals": {
"discount": {
"amount": 49,
"currency": "USD"
},
"grand_total": {
"amount": 49,
"currency": "USD"
},
"shipping": {
"amount": 49,
"currency": "USD"
},
"subtotal": {
"amount": 49,
"currency": "USD"
},
"tax": {
"amount": 49,
"currency": "USD"
}
},
"updated_at": "2026-08-31T14:22:05Z"
}
Cancel checkout session
Checkout session cancelled
POST
/
api
/
v1
/
checkout_sessions
/
{checkout_session_id}
/
cancel
curl --request POST \
--url 'https://prod-api.stateset.cloud.stateset.app/api/v1/checkout_sessions/{checkout_session_id}/cancel' \
--header 'Authorization: Bearer YOUR_API_KEY'
{
"created_at": "2026-08-31T14:22:05Z",
"customer": {
"billing_address": {
"city": "San Francisco",
"country": "US",
"email": "ada.lovelace@example.com",
"line1": "548 Market St",
"line2": "Suite 400",
"name": "Ada Lovelace",
"phone": "+1 415 555 0142",
"postal_code": "94107",
"region": "CA"
},
"shipping_address": {
"city": "San Francisco",
"country": "US",
"email": "ada.lovelace@example.com",
"line1": "548 Market St",
"line2": "Suite 400",
"name": "Ada Lovelace",
"phone": "+1 415 555 0142",
"postal_code": "94107",
"region": "CA"
}
},
"fulfillment": {
"options": [
{
"est_delivery": null,
"id": null,
"label": null,
"price": null
}
],
"selected_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"image_url": "https://cdn.example.com/products/tent-2p.jpg",
"quantity": 2,
"sku": "SKU-TENT-2P-GRN",
"title": "Replacement tent pole set",
"unit_price": {
"amount": null,
"currency": null
},
"variant_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
],
"links": {
"order_permalink": "string",
"privacy": "string",
"terms": "string"
},
"messages": [
{
"code": "string",
"message": "Two-person tent, green — replacement for damaged pole set.",
"param": "string",
"type": "standard"
}
],
"status": "pending",
"totals": {
"discount": {
"amount": 49,
"currency": "USD"
},
"grand_total": {
"amount": 49,
"currency": "USD"
},
"shipping": {
"amount": 49,
"currency": "USD"
},
"subtotal": {
"amount": 49,
"currency": "USD"
},
"tax": {
"amount": 49,
"currency": "USD"
}
},
"updated_at": "2026-08-31T14:22:05Z"
}
Path parameters
string
required
Checkout session identifier
Response
ApiCheckoutSession
string
required
ApiCustomer,null
Show ApiCustomer
Show ApiCustomer
ApiAddress,null
string
required
ApiLineItem[]
required
array,null
string
required
ApiTotals
required
Show ApiTotals
Show ApiTotals
string
required
Status codes
| Code | Meaning |
|---|---|
200 | Checkout session cancelled |
401 | Authentication or signature failure |
404 | Checkout session not found |
405 | Cancellation not permitted because session is terminal |
409 | Operation conflicts with session state |
500 | Unexpected error |
curl --request POST \
--url 'https://prod-api.stateset.cloud.stateset.app/api/v1/checkout_sessions/{checkout_session_id}/cancel' \
--header 'Authorization: Bearer YOUR_API_KEY'
{
"created_at": "2026-08-31T14:22:05Z",
"customer": {
"billing_address": {
"city": "San Francisco",
"country": "US",
"email": "ada.lovelace@example.com",
"line1": "548 Market St",
"line2": "Suite 400",
"name": "Ada Lovelace",
"phone": "+1 415 555 0142",
"postal_code": "94107",
"region": "CA"
},
"shipping_address": {
"city": "San Francisco",
"country": "US",
"email": "ada.lovelace@example.com",
"line1": "548 Market St",
"line2": "Suite 400",
"name": "Ada Lovelace",
"phone": "+1 415 555 0142",
"postal_code": "94107",
"region": "CA"
}
},
"fulfillment": {
"options": [
{
"est_delivery": null,
"id": null,
"label": null,
"price": null
}
],
"selected_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"image_url": "https://cdn.example.com/products/tent-2p.jpg",
"quantity": 2,
"sku": "SKU-TENT-2P-GRN",
"title": "Replacement tent pole set",
"unit_price": {
"amount": null,
"currency": null
},
"variant_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
],
"links": {
"order_permalink": "string",
"privacy": "string",
"terms": "string"
},
"messages": [
{
"code": "string",
"message": "Two-person tent, green — replacement for damaged pole set.",
"param": "string",
"type": "standard"
}
],
"status": "pending",
"totals": {
"discount": {
"amount": 49,
"currency": "USD"
},
"grand_total": {
"amount": 49,
"currency": "USD"
},
"shipping": {
"amount": 49,
"currency": "USD"
},
"subtotal": {
"amount": 49,
"currency": "USD"
},
"tax": {
"amount": 49,
"currency": "USD"
}
},
"updated_at": "2026-08-31T14:22:05Z"
}
Last modified on August 31, 2026