curl --request POST \
--url 'https://prod-api.stateset.cloud.stateset.app/api/v1/checkout_sessions' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"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": {
"selected_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"quantity": 2
}
]
}'
{
"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"
}
Create a checkout session
Checkout session already existed
POST
/
api
/
v1
/
checkout_sessions
curl --request POST \
--url 'https://prod-api.stateset.cloud.stateset.app/api/v1/checkout_sessions' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"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": {
"selected_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"quantity": 2
}
]
}'
{
"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"
}
Request body
ApiCreateCheckoutSessionRequest
ApiCustomer,null
ApiFulfillmentSelection,null
ApiItemInput[]
required
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 already existed |
201 | Checkout session created |
400 | Invalid request payload |
401 | Authentication or signature failure |
409 | Unable to honor the request because of a conflict |
422 | Request failed validation |
500 | Unexpected error |
curl --request POST \
--url 'https://prod-api.stateset.cloud.stateset.app/api/v1/checkout_sessions' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"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": {
"selected_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"items": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"quantity": 2
}
]
}'
{
"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