The line item object and the allowed CRUD operations on the related resource endpoint
Line items can be of different types (anything that can have a cost or add a discount and contribute to changing the total order amount):
Create a line item if you want to add an SKU or bundle to an order. Other types of line items are automatically created (e.g. to add a shipping cost to the order or apply a discount). The sum of all line item amounts makes the order's total, split into subtotal, taxes, and discount. The order object includes all the data you need. No calculation is required on your application.
When creating a new line item, set the
trueif you want to update the line item quantity (if present) instead of creating a new line item for the same SKU.
Sometimes, you can decide not to manage prices within Commerce Layer but use an external service instead. When adding a line item to an order, set the
trueif you want the line item price to be provided by your external endpoint, instead of Commerce Layer.
Line items that have the
frequencyattribute populated (with one of the frequency values available for the associated market, as set at the subscription model level) will be used to generate the recurring orders involved in the order subscription process, according to the subscription model's strategy.