Create a line item if you want to add an SKU to an order. Other types of line items are automatically created to add a shipping cost to the order or to 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. You never need to make any calculation on your application.
A line item object is returned as part of the response body of each successful create, list, retrieve, or update API call.
Field | Type | Description |
type |
|
|
id |
| The line item unique identifier |
links.self |
| The line item endpoint URL |
attributes.sku_code |
| The code of the associated sku |
attributes.quantity |
| The line item quantity |
attributes._update_quantity |
| When creating a new line item, set this attribute to '1' if you want to update the line item quantity (if present) instead of creating a new line item for the same sku. |
attributes.currency_code |
| The international 3-letter currency code as defined by the ISO 4217 standard, automatically inherited from the order's market. |
attributes.unit_amount_cents |
| The unit amount of the line item, in cents. When you add a line item to an order, this is automatically populated from the price list associated to the order's market. |
attributes.unit_amount_float |
| The unit amount of the line item, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce. |
attributes.formatted_unit_amount |
| The unit amount of the line item, formatted. This can be useful to display the amount with currency in you views. |
attributes.options_amount_cents |
| The options amount of the line item, in cents. |
attributes.options_amount_float |
| The options amount of the line item, float. |
attributes.formatted_options_amount |
| The options amount of the line item, formatted. |
attributes.total_amount_cents |
| Calculated as unit amount x quantity + options amount, in cents. |
attributes.total_amount_float |
| Calculated as unit amount x quantity + options amount, float. This can be useful to track the purchase on thrid party systems, e.g Google Analyitcs Enhanced Ecommerce. |
attributes.formatted_total_amount |
| Calculated as unit amount x quantity + options amount, formatted. This can be useful to display the amount with currency in you views. |
attributes.name |
| The name of the line item. When blank, it gets populated with the name of the associated item (if present). |
attributes.image_url |
| The image_url of the line item. When blank, it gets populated with the image_url of the associated item (if present, sku only). |
attributes.tax_rate |
| The tax rate for this line item (if calculated). |
attributes.tax_breakdown |
| The tax breakdown for this line item (if calculated). |
attributes.item_type |
| The type of the associate item. Can be one of 'sku', 'shipment', 'payment_method', or 'promotion' |
attributes.id |
| Unique identifier for the resource (hash). |
attributes.created_at |
| Time at which the resource was created. |
attributes.updated_at |
| Time at which the resource was last updated. |
attributes.reference |
| A string that you can use to add your own identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool or a CRM. |
attributes.metadata |
| Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format. |
relationships.order |
| The associated order. |
relationships.item |
| The polymorphic item associated to the line item. Can be a sku, a shipment, a payment_method or a promotion. |
relationships.line_item_options |
| The associated line item options. |
meta.mode |
| The resource environment (can be one of |