addShippingMethodAdjustments - Cart Module Reference
This documentation provides a reference to the addShippingMethodAdjustments
method. This belongs to the Cart Module.
Note: You should only use this methods when implementing complex customizations. For common cases, check out
available workflows instead.
This method adds shipping method adjustments to shipping methods.
Example#
1const shippingMethodAdjustments =2 await cartModuleService.addShippingMethodAdjustments([3 {4 shipping_method_id: "casm_123",5 code: "FREESHIPPING",6 amount: 3000,7 },8 {9 shipping_method_id: "casm_321",10 code: "10%OFF",11 amount: 1500,12 },13 ])
Parameters#
The shipping method adjustments to be created and added to
shipping methods. The shipping method is specified by the shipping_method_id
field.
Returns#
The added shipping method adjustments.
This method adds a shipping method adjustment to a shipping method.
Example#
1const shippingMethodAdjustment =2 await cartModuleService.addShippingMethodAdjustments({3 shipping_method_id: "casm_123",4 code: "FREESHIPPING",5 amount: 3000,6 })
Parameters#
The shipping method adjustment to be created and added to a
shipping method. The shipping method is specified by the shipping_method_id
field.
Returns#
The added shipping method adjustment.
addShippingMethodAdjustments(cartId, data, sharedContext?): Promise<ShippingMethodAdjustmentDTO[]>#
This method adds shipping method adjustments to shipping methods in a cart.
Example#
1const shippingMethodAdjustments =2 await cartModuleService.addShippingMethodAdjustments(3 "cart_123",4 [5 {6 shipping_method_id: "casm_123",7 code: "FREESHIPPING",8 amount: 3000,9 },10 {11 shipping_method_id: "casm_321",12 code: "10%OFF",13 amount: 1500,14 },15 ]16 )
Parameters#
The cart's ID.
The shipping method adjustments to be created and added to
shipping methods. The shipping method is specified by the shipping_method_id
field.
A context used to share resources, such as transaction manager, between the application and the module.
Returns#
The added shipping method adjustments.