MergeCart

Merge guest cart into customer cart

Changed on

Merges a guest cart into the authenticated customer's cart. Requires the customer bearer token and the guest cart token (guest_cart_token) returned when the guest cart was created; cart_id is optional and must match that token.

post/merge-carts

Request

Headers

X-STOREFRONT-KEYstring required

Storefront API Key for authentication. Required for all shop/storefront API requests.

X-Localestring
Example:en

Locale code for localized data (e.g. "en", "fr", "ar"). Defaults to channel's default locale.

X-Channelstring
Example:default

Channel code (e.g. "default"). Defaults to the current channel.

X-Currencystring
Example:USD

Currency code (e.g. "USD", "EUR", "INR"). Defaults to channel's base currency.

Request body

guest_cart_tokenstring required

The guest cart token returned by POST /api/shop/cart-token

cart_idinteger

Optional. The ID of the guest cart; must match the token

Example request

{
  "guest_cart_token": "2f1c6f7e-5a0b-4c1e-9d0a-1b2c3d4e5f60",
  "cart_id": 6884
}

Response

Guest cart merged. Returns the customer's updated cart.

Changes

    • breaking

      added the new required request property

    • info

      the request property became optional