addLineItemAdjustments - Cart Module Reference
This documentation provides a reference to the addLineItemAdjustments
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 line item adjustments to line items.
Example#
1const lineItemAdjustments =2 await cartModuleService.addLineItemAdjustments([3 {4 item_id: "caliadj_123",5 code: "50%OFF",6 amount: 3000,7 },8 {9 item_id: "caliadj_321",10 code: "10%OFF",11 amount: 3000,12 },13 ])
Parameters#
The line item adjustments to be created and added to line items.
The line item is specified by the item_id
field.
Returns#
The added line item adjustments.
This method adds a line item adjustment to a line item.
Example#
1const lineItemAdjustments =2 await cartModuleService.addLineItemAdjustments({3 item_id: "caliadj_123",4 code: "50%OFF",5 amount: 3000,6 })
Parameters#
The line item adjustment to be created and added to a line item.
The line item is specified by the item_id
field.
Returns#
The added line item adjustment.
addLineItemAdjustments(cartId, data): Promise<LineItemAdjustmentDTO[]>#
This method adds line item adjustments to line items in a cart.
Example#
1const lineItemAdjustments =2 await cartModuleService.addLineItemAdjustments("cart_123", [3 {4 item_id: "caliadj_123",5 code: "50%OFF",6 amount: 3000,7 },8 {9 item_id: "caliadj_321",10 code: "10%OFF",11 amount: 2000,12 },13 ])
Parameters#
The cart's ID.
The line item adjustments to be created and added to line items.
The line item is specified by the item_id
field.
Returns#
The added line item adjustment.