9 October 2025
Carts
We've introduced new endpoints in the Carts API to manually merge anonymous Carts for Customers who authenticate using external OAuth providers.
Previously, Cart merging was only available during sign-in or sign-up for Customers using the Composable Commerce OAuth 2.0 service.
With this enhancement, you can now ensure that any shopper who adds items to their Cart while browsing anonymously can retain their Cart contents after signing in—regardless of how they authenticate.
Changes:
- [API] Added the Merge Cart and Merge Cart in Store endpoints.
- [API] Added the MergeCartDraft type.
- [API] Added the CartMergeMode enum.
- [GraphQL API] Added the following types to the GraphQL schema:
CartMergeMode
,MergeCartDraft
. - [GraphQL API] Added the
mergeCart
field to theMutation
type.
enum CartMergeMode {
MergeWithExistingCustomerCart
UseAsNewActiveCustomerCart
}
input MergeCartDraft {
anonymousCart: ResourceIdentifierInput
mergeMode: CartMergeMode = MergeWithExistingCustomerCart
anonymousId: String
updateProductData: Boolean = false
}
extend type Mutation {
mergeCart(customerId: String!, draft: MergeCartDraft!, storeKey: KeyReferenceInput): Cart
}