curl --request POST \
--url https://api.headlesscommerce.io/v1/storefront/carts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session_id": "<string>",
"customer_id": "<string>",
"metadata": {}
}
'{
"id": "<string>",
"status": "active",
"session_id": "<string>",
"customer_id": "<string>",
"items": [
{
"id": "<string>",
"variant_id": "<string>",
"product_id": "<string>",
"product_name": "<string>",
"variant_name": "<string>",
"sku": "<string>",
"image_url": "<string>",
"quantity": 123,
"unit_price": {
"amount": 123,
"currency": "<string>"
},
"line_discount": {
"amount": 123,
"currency": "<string>"
},
"line_total": {
"amount": 123,
"currency": "<string>"
},
"metadata": {}
}
],
"shipping_address": {
"name": "<string>",
"company": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>"
},
"billing_address": {
"name": "<string>",
"company": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>"
},
"shipping_method_id": "<string>",
"discount_codes": [
"<string>"
],
"summary": {
"subtotal": {
"amount": 123,
"currency": "<string>"
},
"discount_total": {
"amount": 123,
"currency": "<string>"
},
"shipping_total": {
"amount": 123,
"currency": "<string>"
},
"tax_total": {
"amount": 123,
"currency": "<string>"
},
"total": {
"amount": 123,
"currency": "<string>"
},
"item_count": 123,
"total_quantity": 123
},
"applied_discounts": [
{
"discount_id": "<string>",
"code": "<string>",
"name": "<string>",
"value_type": "fixed",
"value": 123,
"saved": {
"amount": 123,
"currency": "<string>"
}
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Guest Cart는 session_id (클라이언트 생성 UUID)로 식별합니다. 로그인 고객은 X-Customer-Token 헤더와 함께 customer_id를 전달합니다. Guest가 session_id를 생략하면 Cart ID로만 식별 가능합니다.
curl --request POST \
--url https://api.headlesscommerce.io/v1/storefront/carts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session_id": "<string>",
"customer_id": "<string>",
"metadata": {}
}
'{
"id": "<string>",
"status": "active",
"session_id": "<string>",
"customer_id": "<string>",
"items": [
{
"id": "<string>",
"variant_id": "<string>",
"product_id": "<string>",
"product_name": "<string>",
"variant_name": "<string>",
"sku": "<string>",
"image_url": "<string>",
"quantity": 123,
"unit_price": {
"amount": 123,
"currency": "<string>"
},
"line_discount": {
"amount": 123,
"currency": "<string>"
},
"line_total": {
"amount": 123,
"currency": "<string>"
},
"metadata": {}
}
],
"shipping_address": {
"name": "<string>",
"company": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>"
},
"billing_address": {
"name": "<string>",
"company": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country": "<string>",
"phone": "<string>"
},
"shipping_method_id": "<string>",
"discount_codes": [
"<string>"
],
"summary": {
"subtotal": {
"amount": 123,
"currency": "<string>"
},
"discount_total": {
"amount": 123,
"currency": "<string>"
},
"shipping_total": {
"amount": 123,
"currency": "<string>"
},
"tax_total": {
"amount": 123,
"currency": "<string>"
},
"total": {
"amount": 123,
"currency": "<string>"
},
"item_count": 123,
"total_quantity": 123
},
"applied_discounts": [
{
"discount_id": "<string>",
"code": "<string>",
"name": "<string>",
"value_type": "fixed",
"value": 123,
"saved": {
"amount": 123,
"currency": "<string>"
}
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}API Key. 예: sk_live_xxxxx 또는 pk_live_xxxxx
Created
active, completed, abandoned Guest 식별 ID
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes