curl --request POST \
--url 'https://prod-api.stateset.cloud.stateset.app/api/v1/carts' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"currency": "USD",
"customer_id": "550e8400-e29b-41d4-a716-446655440000",
"metadata": {
"campaign": "holiday_sale",
"source": "mobile_app"
},
"session_id": "sess_abc123xyz"
}'
{
"data": {
"created_at": "2024-12-09T10:30:00Z",
"currency": "USD",
"discount_total": "15.00",
"expires_at": "2024-12-16T10:30:00Z",
"id": "770e8400-e29b-41d4-a716-446655440000",
"shipping_total": "9.99",
"status": "active",
"subtotal": "149.98",
"tax_total": "12.00",
"total": "156.97",
"updated_at": "2024-12-09T11:45:00Z"
},
"errors": [
"string"
],
"message": "Two-person tent, green — replacement for damaged pole set.",
"meta": {
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"timestamp": "2026-08-31T14:22:05Z"
},
"success": true
}
Create a new cart
Create a new cart
POST
/
api
/
v1
/
carts
curl --request POST \
--url 'https://prod-api.stateset.cloud.stateset.app/api/v1/carts' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"currency": "USD",
"customer_id": "550e8400-e29b-41d4-a716-446655440000",
"metadata": {
"campaign": "holiday_sale",
"source": "mobile_app"
},
"session_id": "sess_abc123xyz"
}'
{
"data": {
"created_at": "2024-12-09T10:30:00Z",
"currency": "USD",
"discount_total": "15.00",
"expires_at": "2024-12-16T10:30:00Z",
"id": "770e8400-e29b-41d4-a716-446655440000",
"shipping_total": "9.99",
"status": "active",
"subtotal": "149.98",
"tax_total": "12.00",
"total": "156.97",
"updated_at": "2024-12-09T11:45:00Z"
},
"errors": [
"string"
],
"message": "Two-person tent, green — replacement for damaged pole set.",
"meta": {
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"timestamp": "2026-08-31T14:22:05Z"
},
"success": true
}
Request body
CreateCartRequest
string,null
Currency code (ISO 4217, defaults to USD)
string,null (uuid)
Customer UUID (must match authenticated user)
object
Additional metadata for the cart
string,null
Optional session ID for guest carts
Response
ApiResponse_CartResponse
object
Show data
Show data
string (date-time)
required
Cart creation timestamp
string
required
Currency code (ISO 4217)
string
required
Total discount amount
string (date-time)
required
Cart expiration timestamp
string (uuid)
required
Cart UUID
string
required
Total shipping cost
CartStatus
required
Cart status (active, abandoned, converted, expired)
string
required
Subtotal before tax, shipping, and discounts
string
required
Total tax amount
string
required
Final total (subtotal + tax + shipping - discounts)
string (date-time)
required
Last update timestamp
array,null
string,null
boolean
required
Status codes
| Code | Meaning |
|---|---|
201 | Cart created |
401 | Unauthorized |
403 | Forbidden |
curl --request POST \
--url 'https://prod-api.stateset.cloud.stateset.app/api/v1/carts' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"currency": "USD",
"customer_id": "550e8400-e29b-41d4-a716-446655440000",
"metadata": {
"campaign": "holiday_sale",
"source": "mobile_app"
},
"session_id": "sess_abc123xyz"
}'
{
"data": {
"created_at": "2024-12-09T10:30:00Z",
"currency": "USD",
"discount_total": "15.00",
"expires_at": "2024-12-16T10:30:00Z",
"id": "770e8400-e29b-41d4-a716-446655440000",
"shipping_total": "9.99",
"status": "active",
"subtotal": "149.98",
"tax_total": "12.00",
"total": "156.97",
"updated_at": "2024-12-09T11:45:00Z"
},
"errors": [
"string"
],
"message": "Two-person tent, green — replacement for damaged pole set.",
"meta": {
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"timestamp": "2026-08-31T14:22:05Z"
},
"success": true
}
Last modified on August 31, 2026