비회원 장바구니를 고객에게 병합
curl --request POST \
--url https://api.headlesscommerce.io/v1/storefront/carts/{id}/merge \
--header 'Authorization: Bearer <token>' \
--header 'X-Customer-Token: <api-key>'{
"id": "<string>",
"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": 123,
"saved": {
"amount": 123,
"currency": "<string>"
}
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Storefront - 장바구니
비회원 장바구니를 고객에게 병합
Merges a guest cart (identified by session_id) into the logged-in customer’s cart. If the customer has an existing cart, items are combined; otherwise, ownership is transferred.
POST
/
storefront
/
carts
/
{id}
/
merge
비회원 장바구니를 고객에게 병합
curl --request POST \
--url https://api.headlesscommerce.io/v1/storefront/carts/{id}/merge \
--header 'Authorization: Bearer <token>' \
--header 'X-Customer-Token: <api-key>'{
"id": "<string>",
"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": 123,
"saved": {
"amount": 123,
"currency": "<string>"
}
}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}인증
API Key. Example: sk_live_xxxxx or pk_live_xxxxx
Storefront customer authentication token. Issued via POST /admin/customers/{id}/token. Required for accessing /storefront/customers/, /storefront/orders/.
경로 매개변수
Resource ID
응답
성공
사용 가능한 옵션:
active, completed, abandoned Guest identification ID
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I