Skip to main content

OrderMergeStrategy

An OrderMergeStrategy defines what happens when a Customer with an existing Order signs in with a guest Order, where both Orders may contain differing OrderLines.

Somehow these differing OrderLines need to be reconciled into a single collection of OrderLines. The OrderMergeStrategy defines the rules governing this reconciliation.

Info

This is configured via the orderOptions.mergeStrategy property of your VendureConfig.

Signature
interface OrderMergeStrategy extends InjectableStrategy {    merge(ctx: RequestContext, guestOrder: Order, existingOrder: Order): MergedOrderLine[];}

merge

method(ctx: RequestContext, guestOrder: Order, existingOrder: Order) => MergedOrderLine[]

Merges the lines of the guest Order with those of the existing Order which is associated with the active customer.

The result of the OrderMergeStrategy merge method.

Signature
interface MergedOrderLine {    orderLineId: ID;    quantity: number;    customFields?: any;}

orderLineId

propertyID

quantity

propertynumber

customFields

propertyany
Was this chapter helpful?
Report Issue
Edited Feb 4, 2026·Edit this page