메인 콘텐츠로 건너뛰기
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>",
  "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"
}

인증

Authorization
string
header
필수

API Key. Example: sk_live_xxxxx or pk_live_xxxxx

X-Customer-Token
string
header
필수

Storefront customer authentication token. Issued via POST /admin/customers/{id}/token. Required for accessing /storefront/customers/, /storefront/orders/.

경로 매개변수

id
string
필수

Resource ID

응답

성공

id
string
status
enum<string>
사용 가능한 옵션:
active,
completed,
abandoned
session_id
string | null

Guest identification ID

customer_id
string | null
items
object[]
shipping_address
object
billing_address
object
shipping_method_id
string | null
discount_codes
string[]
summary
object
applied_discounts
object[]
metadata
object
created_at
string<date-time>
updated_at
string<date-time>