Skip to main content
Skip to main content

updateLineItems - Order Module Reference

This documentation provides a reference to the updateLineItems method. This belongs to the Order Module.

updateLineItems(data): Promise<OrderLineItemDTO[]>

This method updates existing {return type}(s).

Example

const updateOrderLineItems: UpdateOrderLineItemWithSelectorDTO[] = [
{
selector: {
id: "line-item-id-1"
},
data: {
id: "line-item-id-1",
quantity: 2,
unit_price: 1999
}
}
];

const updatedLineItems = await orderModuleService.updateLineItems(updateOrderLineItems);

Parameters

The attributes to update in the order line item with selector.

Returns

PromisePromise<OrderLineItemDTO[]>Required
The updated {return type}(s).

updateLineItems(selector, data, sharedContext?): Promise<OrderLineItemDTO[]>

This method updates existing {return type}(s).

Example

const result = await orderModuleService.updateLineItems(
{ id: "line-item-id-1" },
{ quantity: 10 }
);

Parameters

selectorPartial<FilterableOrderLineItemProps>Required
Make all properties in T optional
dataPartial<UpdateOrderLineItemDTO>Required
Make all properties in T optional
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderLineItemDTO[]>Required
The updated {return type}(s).

updateLineItems(lineId, data, sharedContext?): Promise<OrderLineItemDTO>

This method updates existing {return type}(s).

Example

const result = await orderModuleService.updateLineItems(
"lineIdExample",
{
quantity: 10,
}
);

Parameters

lineIdstringRequired
The line's ID.
dataPartial<UpdateOrderLineItemDTO>Required
Make all properties in T optional
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderLineItemDTO>Required
The updated {return type}(s).
Was this section helpful?