Skip to main content
Skip to main content

addLineItemAdjustments - Cart Module Reference

This documentation provides a reference to the addLineItemAdjustments method. This belongs to the Cart Module.

addLineItemAdjustments(data): Promise<LineItemAdjustmentDTO[]>

This method adds line item adjustments to line items.

Example

const lineItemAdjustments =
await cartModuleService.addLineItemAdjustments([
{
item_id: "caliadj_123",
code: "50%OFF",
amount: 3000,
},
{
item_id: "caliadj_321",
code: "10%OFF",
amount: 3000,
},
])

Parameters

The line item adjustments to be created and added to line items. The line item is specified by the item_id field.

Returns

PromisePromise<LineItemAdjustmentDTO[]>Required
The added line item adjustments.

addLineItemAdjustments(data): Promise<LineItemAdjustmentDTO[]>

This method adds a line item adjustment to a line item.

Example

const lineItemAdjustments =
await cartModuleService.addLineItemAdjustments({
item_id: "caliadj_123",
code: "50%OFF",
amount: 3000,
})

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

PromisePromise<LineItemAdjustmentDTO[]>Required
The added line item adjustment.

addLineItemAdjustments(cartId, data): Promise<LineItemAdjustmentDTO[]>

This method adds line item adjustments to line items in a cart.

Example

const lineItemAdjustments =
await cartModuleService.addLineItemAdjustments("cart_123", [
{
item_id: "caliadj_123",
code: "50%OFF",
amount: 3000,
},
{
item_id: "caliadj_321",
code: "10%OFF",
amount: 2000,
},
])

Parameters

cartIdstringRequired
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

PromisePromise<LineItemAdjustmentDTO[]>Required
The added line item adjustment.
Was this section helpful?