MergeCart
Merge guest cart into customer cart
Changed onMerges 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
- Base URLhttp://localhost:8000/api/shop
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
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
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
- breaking