|
|
@@ -36,10 +36,10 @@ class OrderService {
|
|
|
updateCustomFields(ctx: RequestContext, orderId: ID, customFields: any) => ;
|
|
|
updateOrderCustomer(ctx: RequestContext, { customerId, orderId, note }: SetOrderCustomerInput) => ;
|
|
|
addItemToOrder(ctx: RequestContext, orderId: ID, productVariantId: ID, quantity: number, customFields?: { [key: string]: any }, relations?: RelationPaths<Order>) => Promise<ErrorResultUnion<UpdateOrderItemsResult, Order>>;
|
|
|
- addItemsToOrder(ctx: RequestContext, orderId: ID, items: Array<{
|
|
|
- productVariantId: ID;
|
|
|
- quantity: number;
|
|
|
- customFields?: { [key: string]: any };
|
|
|
+ addItemsToOrder(ctx: RequestContext, orderId: ID, items: Array<{
|
|
|
+ productVariantId: ID;
|
|
|
+ quantity: number;
|
|
|
+ customFields?: { [key: string]: any };
|
|
|
}>, relations?: RelationPaths<Order>) => Promise<{ order: Order; errorResults: Array<JustErrorResults<UpdateOrderItemsResult>> }>;
|
|
|
adjustOrderLine(ctx: RequestContext, orderId: ID, orderLineId: ID, quantity: number, customFields?: { [key: string]: any }, relations?: RelationPaths<Order>) => Promise<ErrorResultUnion<UpdateOrderItemsResult, Order>>;
|
|
|
adjustOrderLines(ctx: RequestContext, orderId: ID, lines: Array<{ orderLineId: ID; quantity: number; customFields?: { [key: string]: any } }>, relations?: RelationPaths<Order>) => Promise<{ order: Order; errorResults: Array<JustErrorResults<UpdateOrderItemsResult>> }>;
|
|
|
@@ -95,8 +95,8 @@ class OrderService {
|
|
|
|
|
|
<MemberInfo kind="method" type={`() => OrderProcessState[]`} />
|
|
|
|
|
|
-Returns an array of all the configured states and transitions of the order process. This is
|
|
|
-based on the default order process plus all configured <a href='/reference/typescript-api/orders/order-process#orderprocess'>OrderProcess</a> objects
|
|
|
+Returns an array of all the configured states and transitions of the order process. This is
|
|
|
+based on the default order process plus all configured <a href='/reference/typescript-api/orders/order-process#orderprocess'>OrderProcess</a> objects
|
|
|
defined in the <a href='/reference/typescript-api/orders/order-options#orderoptions'>OrderOptions</a> `process` array.
|
|
|
### findAll
|
|
|
|
|
|
@@ -157,13 +157,13 @@ Returns any <a href='/reference/typescript-api/entities/refund#refund'>Refund</a
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, userId: <a href='/reference/typescript-api/common/id#id'>ID</a>) => Promise<<a href='/reference/typescript-api/entities/order#order'>Order</a> | undefined>`} />
|
|
|
|
|
|
-Returns any Order associated with the specified User's Customer account
|
|
|
+Returns any Order associated with the specified User's Customer account
|
|
|
that is still in the `active` state.
|
|
|
### create
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, userId?: <a href='/reference/typescript-api/common/id#id'>ID</a>) => Promise<<a href='/reference/typescript-api/entities/order#order'>Order</a>>`} />
|
|
|
|
|
|
-Creates a new, empty Order. If a `userId` is passed, the Order will get associated with that
|
|
|
+Creates a new, empty Order. If a `userId` is passed, the Order will get associated with that
|
|
|
User's Customer account.
|
|
|
### createDraft
|
|
|
|
|
|
@@ -179,55 +179,55 @@ Updates the custom fields of an Order.
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, { customerId, orderId, note }: SetOrderCustomerInput) => `} since="2.2.0" />
|
|
|
|
|
|
-Updates the Customer which is assigned to a given Order. The target Customer must be assigned to the same
|
|
|
+Updates the Customer which is assigned to a given Order. The target Customer must be assigned to the same
|
|
|
Channels as the Order, otherwise an error will be thrown.
|
|
|
### addItemToOrder
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, orderId: <a href='/reference/typescript-api/common/id#id'>ID</a>, productVariantId: <a href='/reference/typescript-api/common/id#id'>ID</a>, quantity: number, customFields?: { [key: string]: any }, relations?: RelationPaths<<a href='/reference/typescript-api/entities/order#order'>Order</a>>) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><UpdateOrderItemsResult, <a href='/reference/typescript-api/entities/order#order'>Order</a>>>`} />
|
|
|
|
|
|
-Adds an item to the Order, either creating a new OrderLine or
|
|
|
-incrementing an existing one.
|
|
|
-
|
|
|
+Adds an item to the Order, either creating a new OrderLine or
|
|
|
+incrementing an existing one.
|
|
|
+
|
|
|
If you need to add multiple items to an Order, use `addItemsToOrder()` instead.
|
|
|
### addItemsToOrder
|
|
|
|
|
|
-<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, orderId: <a href='/reference/typescript-api/common/id#id'>ID</a>, items: Array<{ productVariantId: <a href='/reference/typescript-api/common/id#id'>ID</a>; quantity: number; customFields?: { [key: string]: any }; }>, relations?: RelationPaths<<a href='/reference/typescript-api/entities/order#order'>Order</a>>) => Promise<{ order: <a href='/reference/typescript-api/entities/order#order'>Order</a>; errorResults: Array<JustErrorResults<UpdateOrderItemsResult>> }>`} since="3.1.0" />
|
|
|
-
|
|
|
-Adds multiple items to an Order. This method is more efficient than calling `addItemToOrder`
|
|
|
-multiple times, as it only needs to fetch the entire Order once, and only performs
|
|
|
-price adjustments once at the end.
|
|
|
+<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, orderId: <a href='/reference/typescript-api/common/id#id'>ID</a>, items: Array<{
productVariantId: <a href='/reference/typescript-api/common/id#id'>ID</a>;
quantity: number;
customFields?: { [key: string]: any };
}>, relations?: RelationPaths<<a href='/reference/typescript-api/entities/order#order'>Order</a>>) => Promise<{ order: <a href='/reference/typescript-api/entities/order#order'>Order</a>; errorResults: Array<JustErrorResults<UpdateOrderItemsResult>> }>`} since="3.1.0" />
|
|
|
|
|
|
-Since this method can return multiple error results, it is recommended to check the `errorResults`
|
|
|
+Adds multiple items to an Order. This method is more efficient than calling `addItemToOrder`
|
|
|
+multiple times, as it only needs to fetch the entire Order once, and only performs
|
|
|
+price adjustments once at the end.
|
|
|
+
|
|
|
+Since this method can return multiple error results, it is recommended to check the `errorResults`
|
|
|
array to determine if any errors occurred.
|
|
|
### adjustOrderLine
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, orderId: <a href='/reference/typescript-api/common/id#id'>ID</a>, orderLineId: <a href='/reference/typescript-api/common/id#id'>ID</a>, quantity: number, customFields?: { [key: string]: any }, relations?: RelationPaths<<a href='/reference/typescript-api/entities/order#order'>Order</a>>) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><UpdateOrderItemsResult, <a href='/reference/typescript-api/entities/order#order'>Order</a>>>`} />
|
|
|
|
|
|
-Adjusts the quantity and/or custom field values of an existing OrderLine.
|
|
|
-
|
|
|
+Adjusts the quantity and/or custom field values of an existing OrderLine.
|
|
|
+
|
|
|
If you need to adjust multiple OrderLines, use `adjustOrderLines()` instead.
|
|
|
### adjustOrderLines
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, orderId: <a href='/reference/typescript-api/common/id#id'>ID</a>, lines: Array<{ orderLineId: <a href='/reference/typescript-api/common/id#id'>ID</a>; quantity: number; customFields?: { [key: string]: any } }>, relations?: RelationPaths<<a href='/reference/typescript-api/entities/order#order'>Order</a>>) => Promise<{ order: <a href='/reference/typescript-api/entities/order#order'>Order</a>; errorResults: Array<JustErrorResults<UpdateOrderItemsResult>> }>`} since="3.1.0" />
|
|
|
|
|
|
-Adjusts the quantity and/or custom field values of existing OrderLines.
|
|
|
-This method is more efficient than calling `adjustOrderLine` multiple times, as it only needs to fetch
|
|
|
-the entire Order once, and only performs price adjustments once at the end.
|
|
|
-Since this method can return multiple error results, it is recommended to check the `errorResults`
|
|
|
+Adjusts the quantity and/or custom field values of existing OrderLines.
|
|
|
+This method is more efficient than calling `adjustOrderLine` multiple times, as it only needs to fetch
|
|
|
+the entire Order once, and only performs price adjustments once at the end.
|
|
|
+Since this method can return multiple error results, it is recommended to check the `errorResults`
|
|
|
array to determine if any errors occurred.
|
|
|
### removeItemFromOrder
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, orderId: <a href='/reference/typescript-api/common/id#id'>ID</a>, orderLineId: <a href='/reference/typescript-api/common/id#id'>ID</a>) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><RemoveOrderItemsResult, <a href='/reference/typescript-api/entities/order#order'>Order</a>>>`} />
|
|
|
|
|
|
-Removes the specified OrderLine from the Order.
|
|
|
-
|
|
|
+Removes the specified OrderLine from the Order.
|
|
|
+
|
|
|
If you need to remove multiple OrderLines, use `removeItemsFromOrder()` instead.
|
|
|
### removeItemsFromOrder
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, orderId: <a href='/reference/typescript-api/common/id#id'>ID</a>, orderLineIds: <a href='/reference/typescript-api/common/id#id'>ID</a>[]) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><RemoveOrderItemsResult, <a href='/reference/typescript-api/entities/order#order'>Order</a>>>`} since="3.1.0" />
|
|
|
|
|
|
-Removes the specified OrderLines from the Order.
|
|
|
-This method is more efficient than calling `removeItemFromOrder` multiple times, as it only needs to fetch
|
|
|
+Removes the specified OrderLines from the Order.
|
|
|
+This method is more efficient than calling `removeItemFromOrder` multiple times, as it only needs to fetch
|
|
|
the entire Order once, and only performs price adjustments once at the end.
|
|
|
### removeAllItemsFromOrder
|
|
|
|
|
|
@@ -248,7 +248,7 @@ Removes a <a href='/reference/typescript-api/entities/surcharge#surcharge'>Surch
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, orderId: <a href='/reference/typescript-api/common/id#id'>ID</a>, couponCode: string) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><ApplyCouponCodeResult, <a href='/reference/typescript-api/entities/order#order'>Order</a>>>`} />
|
|
|
|
|
|
-Applies a coupon code to the Order, which should be a valid coupon code as specified in the configuration
|
|
|
+Applies a coupon code to the Order, which should be a valid coupon code as specified in the configuration
|
|
|
of an active <a href='/reference/typescript-api/entities/promotion#promotion'>Promotion</a>.
|
|
|
### removeCouponCode
|
|
|
|
|
|
@@ -289,10 +289,10 @@ Unsets the billing address for the Order.
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, orderId: <a href='/reference/typescript-api/common/id#id'>ID</a>) => Promise<ShippingMethodQuote[]>`} />
|
|
|
|
|
|
-Returns an array of quotes stating which <a href='/reference/typescript-api/entities/shipping-method#shippingmethod'>ShippingMethod</a>s may be applied to this Order.
|
|
|
-This is determined by the configured <a href='/reference/typescript-api/shipping/shipping-eligibility-checker#shippingeligibilitychecker'>ShippingEligibilityChecker</a> of each ShippingMethod.
|
|
|
-
|
|
|
-The quote also includes a price for each method, as determined by the configured
|
|
|
+Returns an array of quotes stating which <a href='/reference/typescript-api/entities/shipping-method#shippingmethod'>ShippingMethod</a>s may be applied to this Order.
|
|
|
+This is determined by the configured <a href='/reference/typescript-api/shipping/shipping-eligibility-checker#shippingeligibilitychecker'>ShippingEligibilityChecker</a> of each ShippingMethod.
|
|
|
+
|
|
|
+The quote also includes a price for each method, as determined by the configured
|
|
|
<a href='/reference/typescript-api/shipping/shipping-calculator#shippingcalculator'>ShippingCalculator</a> of each eligible ShippingMethod.
|
|
|
### getEligiblePaymentMethods
|
|
|
|
|
|
@@ -313,7 +313,7 @@ Transitions the Order to the given state.
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, fulfillmentId: <a href='/reference/typescript-api/common/id#id'>ID</a>, state: <a href='/reference/typescript-api/fulfillment/fulfillment-state#fulfillmentstate'>FulfillmentState</a>) => Promise<<a href='/reference/typescript-api/entities/fulfillment#fulfillment'>Fulfillment</a> | FulfillmentStateTransitionError>`} />
|
|
|
|
|
|
-Transitions a Fulfillment to the given state and then transitions the Order state based on
|
|
|
+Transitions a Fulfillment to the given state and then transitions the Order state based on
|
|
|
whether all Fulfillments of the Order are shipped or delivered.
|
|
|
### transitionRefundToState
|
|
|
|
|
|
@@ -324,51 +324,51 @@ Transitions a Refund to the given state
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, input: ModifyOrderInput) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><ModifyOrderResult, <a href='/reference/typescript-api/entities/order#order'>Order</a>>>`} />
|
|
|
|
|
|
-Allows the Order to be modified, which allows several aspects of the Order to be changed:
|
|
|
-
|
|
|
-* Changes to OrderLine quantities
|
|
|
-* New OrderLines being added
|
|
|
-* Arbitrary <a href='/reference/typescript-api/entities/surcharge#surcharge'>Surcharge</a>s being added
|
|
|
-* Shipping or billing address changes
|
|
|
-
|
|
|
-Setting the `dryRun` input property to `true` will apply all changes, including updating the price of the
|
|
|
-Order, except history entry and additional payment actions.
|
|
|
-
|
|
|
+Allows the Order to be modified, which allows several aspects of the Order to be changed:
|
|
|
+
|
|
|
+* Changes to OrderLine quantities
|
|
|
+* New OrderLines being added
|
|
|
+* Arbitrary <a href='/reference/typescript-api/entities/surcharge#surcharge'>Surcharge</a>s being added
|
|
|
+* Shipping or billing address changes
|
|
|
+
|
|
|
+Setting the `dryRun` input property to `true` will apply all changes, including updating the price of the
|
|
|
+Order, except history entry and additional payment actions.
|
|
|
+
|
|
|
__Using dryRun option, you must wrap function call in transaction manually.__
|
|
|
### transitionPaymentToState
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, paymentId: <a href='/reference/typescript-api/common/id#id'>ID</a>, state: <a href='/reference/typescript-api/payment/payment-state#paymentstate'>PaymentState</a>) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><TransitionPaymentToStateResult, <a href='/reference/typescript-api/entities/payment#payment'>Payment</a>>>`} />
|
|
|
|
|
|
-Transitions the given <a href='/reference/typescript-api/entities/payment#payment'>Payment</a> to a new state. If the order totalWithTax price is then
|
|
|
-covered by Payments, the Order state will be automatically transitioned to `PaymentSettled`
|
|
|
+Transitions the given <a href='/reference/typescript-api/entities/payment#payment'>Payment</a> to a new state. If the order totalWithTax price is then
|
|
|
+covered by Payments, the Order state will be automatically transitioned to `PaymentSettled`
|
|
|
or `PaymentAuthorized`.
|
|
|
### addPaymentToOrder
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, orderId: <a href='/reference/typescript-api/common/id#id'>ID</a>, input: PaymentInput) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><AddPaymentToOrderResult, <a href='/reference/typescript-api/entities/order#order'>Order</a>>>`} />
|
|
|
|
|
|
-Adds a new Payment to the Order. If the Order totalWithTax is covered by Payments, then the Order
|
|
|
+Adds a new Payment to the Order. If the Order totalWithTax is covered by Payments, then the Order
|
|
|
state will get automatically transitioned to the `PaymentSettled` or `PaymentAuthorized` state.
|
|
|
### addManualPaymentToOrder
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, input: ManualPaymentInput) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><AddManualPaymentToOrderResult, <a href='/reference/typescript-api/entities/order#order'>Order</a>>>`} />
|
|
|
|
|
|
-This method is used after modifying an existing completed order using the `modifyOrder()` method. If the modifications
|
|
|
-cause the order total to increase (such as when adding a new OrderLine), then there will be an outstanding charge to
|
|
|
-pay.
|
|
|
-
|
|
|
-This method allows you to add a new Payment and assumes the actual processing has been done manually, e.g. in the
|
|
|
+This method is used after modifying an existing completed order using the `modifyOrder()` method. If the modifications
|
|
|
+cause the order total to increase (such as when adding a new OrderLine), then there will be an outstanding charge to
|
|
|
+pay.
|
|
|
+
|
|
|
+This method allows you to add a new Payment and assumes the actual processing has been done manually, e.g. in the
|
|
|
dashboard of your payment provider.
|
|
|
### settlePayment
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, paymentId: <a href='/reference/typescript-api/common/id#id'>ID</a>) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><<a href='/reference/typescript-api/payment/payment-method-types#settlepaymentresult'>SettlePaymentResult</a>, <a href='/reference/typescript-api/entities/payment#payment'>Payment</a>>>`} />
|
|
|
|
|
|
-Settles a payment by invoking the <a href='/reference/typescript-api/payment/payment-method-handler#paymentmethodhandler'>PaymentMethodHandler</a>'s `settlePayment()` method. Automatically
|
|
|
+Settles a payment by invoking the <a href='/reference/typescript-api/payment/payment-method-handler#paymentmethodhandler'>PaymentMethodHandler</a>'s `settlePayment()` method. Automatically
|
|
|
transitions the Order state if all Payments are settled.
|
|
|
### cancelPayment
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, paymentId: <a href='/reference/typescript-api/common/id#id'>ID</a>) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><<a href='/reference/typescript-api/payment/payment-method-types#cancelpaymentresult'>CancelPaymentResult</a>, <a href='/reference/typescript-api/entities/payment#payment'>Payment</a>>>`} />
|
|
|
|
|
|
-Cancels a payment by invoking the <a href='/reference/typescript-api/payment/payment-method-handler#paymentmethodhandler'>PaymentMethodHandler</a>'s `cancelPayment()` method (if defined), and transitions the Payment to
|
|
|
+Cancels a payment by invoking the <a href='/reference/typescript-api/payment/payment-method-handler#paymentmethodhandler'>PaymentMethodHandler</a>'s `cancelPayment()` method (if defined), and transitions the Payment to
|
|
|
the `Cancelled` state.
|
|
|
### createFulfillment
|
|
|
|
|
|
@@ -389,13 +389,13 @@ Returns an array of all Surcharges associated with the Order.
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, input: CancelOrderInput) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><CancelOrderResult, <a href='/reference/typescript-api/entities/order#order'>Order</a>>>`} />
|
|
|
|
|
|
-Cancels an Order by transitioning it to the `Cancelled` state. If stock is being tracked for the ProductVariants
|
|
|
+Cancels an Order by transitioning it to the `Cancelled` state. If stock is being tracked for the ProductVariants
|
|
|
in the Order, then new <a href='/reference/typescript-api/entities/stock-movement#stockmovement'>StockMovement</a>s will be created to correct the stock levels.
|
|
|
### refundOrder
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, input: RefundOrderInput) => Promise<<a href='/reference/typescript-api/errors/error-result-union#errorresultunion'>ErrorResultUnion</a><RefundOrderResult, <a href='/reference/typescript-api/entities/refund#refund'>Refund</a>>>`} />
|
|
|
|
|
|
-Creates a <a href='/reference/typescript-api/entities/refund#refund'>Refund</a> against the order and in doing so invokes the `createRefund()` method of the
|
|
|
+Creates a <a href='/reference/typescript-api/entities/refund#refund'>Refund</a> against the order and in doing so invokes the `createRefund()` method of the
|
|
|
<a href='/reference/typescript-api/payment/payment-method-handler#paymentmethodhandler'>PaymentMethodHandler</a>.
|
|
|
### settleRefund
|
|
|
|
|
|
@@ -431,15 +431,15 @@ Deletes an Order, ensuring that any Sessions that reference this Order are deref
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, user: <a href='/reference/typescript-api/entities/user#user'>User</a>, guestOrder?: <a href='/reference/typescript-api/entities/order#order'>Order</a>, existingOrder?: <a href='/reference/typescript-api/entities/order#order'>Order</a>) => Promise<<a href='/reference/typescript-api/entities/order#order'>Order</a> | undefined>`} />
|
|
|
|
|
|
-When a guest user with an anonymous Order signs in and has an existing Order associated with that Customer,
|
|
|
-we need to reconcile the contents of the two orders.
|
|
|
-
|
|
|
+When a guest user with an anonymous Order signs in and has an existing Order associated with that Customer,
|
|
|
+we need to reconcile the contents of the two orders.
|
|
|
+
|
|
|
The logic used to do the merging is specified in the <a href='/reference/typescript-api/orders/order-options#orderoptions'>OrderOptions</a> `mergeStrategy` config setting.
|
|
|
### applyPriceAdjustments
|
|
|
|
|
|
<MemberInfo kind="method" type={`(ctx: <a href='/reference/typescript-api/request/request-context#requestcontext'>RequestContext</a>, order: <a href='/reference/typescript-api/entities/order#order'>Order</a>, updatedOrderLines?: <a href='/reference/typescript-api/entities/order-line#orderline'>OrderLine</a>[], relations?: RelationPaths<<a href='/reference/typescript-api/entities/order#order'>Order</a>>) => Promise<<a href='/reference/typescript-api/entities/order#order'>Order</a>>`} />
|
|
|
|
|
|
-Applies promotions, taxes and shipping to the Order. If the `updatedOrderLines` argument is passed in,
|
|
|
+Applies promotions, taxes and shipping to the Order. If the `updatedOrderLines` argument is passed in,
|
|
|
then all of those OrderLines will have their prices re-calculated using the configured <a href='/reference/typescript-api/orders/order-item-price-calculation-strategy#orderitempricecalculationstrategy'>OrderItemPriceCalculationStrategy</a>.
|
|
|
|
|
|
|