Skip to main content
POST
This endpoint merges items from one cart (typically a guest cart) into another cart (typically the logged-in customer’s cart). Useful when customers add items before logging in.

Authentication

This endpoint requires a valid API key with carts:write permissions.

Path Parameters

id
string
required
The target cart ID (cart to merge INTO)

Request Body

source_cart_id
string
required
The source cart ID (cart to merge FROM)
merge_strategy
string
default:"combine"
How to handle duplicate items: “combine” (add quantities), “keep_source”, “keep_target”
preserve_source_metadata
boolean
default:"true"
Whether to preserve metadata from source cart items
delete_source_cart
boolean
default:"true"
Whether to delete the source cart after merge

Response

Returns the merged cart object.