
# Order Line Item

Represents a line item in an order. Each line item describes a different
product to purchase, with its own quantity and price details.

## Structure

`OrderLineItem`

## Fields

| Name | Type | Tags | Description |
|  --- | --- | --- | --- |
| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the line item only within this order.<br>**Constraints**: *Maximum Length*: `60` |
| `name` | `string \| null \| undefined` | Optional | The name of the line item.<br>**Constraints**: *Maximum Length*: `512` |
| `quantity` | `string` | Required | The count, or measurement, of a line item being purchased:<br><br>If `quantity` is a whole number, and `quantity_unit` is not specified, then `quantity` denotes an item count.  For example: `3` apples.<br><br>If `quantity` is a whole or decimal number, and `quantity_unit` is also specified, then `quantity` denotes a measurement.  For example: `2.25` pounds of broccoli.<br><br>For more information, see [Specify item quantity and measurement unit](https://developer.squareup.com/docs/orders-api/create-orders#specify-item-quantity-and-measurement-unit).<br><br>Line items with a quantity of `0` are automatically removed<br>when paying for or otherwise completing the order.<br>**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12` |
| `quantityUnit` | [`OrderQuantityUnit \| undefined`](../../doc/models/order-quantity-unit.md) | Optional | Contains the measurement unit for a quantity and a precision that<br>specifies the number of digits after the decimal point for decimal quantities. |
| `note` | `string \| null \| undefined` | Optional | An optional note associated with the line item.<br>**Constraints**: *Maximum Length*: `2000` |
| `catalogObjectId` | `string \| null \| undefined` | Optional | The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this line item.<br>**Constraints**: *Maximum Length*: `192` |
| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the catalog object that this line item references. |
| `variationName` | `string \| null \| undefined` | Optional | The name of the variation applied to this line item.<br>**Constraints**: *Maximum Length*: `400` |
| `itemType` | [`string \| undefined`](../../doc/models/order-line-item-item-type.md) | Optional | Represents the line item type. |
| `metadata` | `Record<string, string> \| null \| undefined` | Optional | Application-defined data attached to this line item. Metadata fields are intended<br>to store descriptive references or associations with an entity in another system or store brief<br>information about the object. Square does not process this field; it only stores and returns it<br>in relevant API calls. Do not use metadata to store any sensitive information (such as personally<br>identifiable information or card details).<br><br>Keys written by applications must be 60 characters or less and must be in the character set<br>`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed<br>with a namespace, separated from the key with a ':' character.<br><br>Values have a maximum length of 255 characters.<br><br>An application can have up to 10 entries per metadata field.<br><br>Entries written by applications are private and can only be read or modified by the same<br>application.<br><br>For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). |
| `modifiers` | [`OrderLineItemModifier[] \| null \| undefined`](../../doc/models/order-line-item-modifier.md) | Optional | The [CatalogModifier](entity:CatalogModifier)s applied to this line item. |
| `appliedTaxes` | [`OrderLineItemAppliedTax[] \| null \| undefined`](../../doc/models/order-line-item-applied-tax.md) | Optional | The list of references to taxes applied to this line item. Each<br>`OrderLineItemAppliedTax` has a `tax_uid` that references the `uid` of a<br>top-level `OrderLineItemTax` applied to the line item. On reads, the<br>amount applied is populated.<br><br>An `OrderLineItemAppliedTax` is automatically created on every line<br>item for all `ORDER` scoped taxes added to the order. `OrderLineItemAppliedTax`<br>records for `LINE_ITEM` scoped taxes must be added in requests for the tax<br>to apply to any line items.<br><br>To change the amount of a tax, modify the referenced top-level tax. |
| `appliedDiscounts` | [`OrderLineItemAppliedDiscount[] \| null \| undefined`](../../doc/models/order-line-item-applied-discount.md) | Optional | The list of references to discounts applied to this line item. Each<br>`OrderLineItemAppliedDiscount` has a `discount_uid` that references the `uid` of a top-level<br>`OrderLineItemDiscounts` applied to the line item. On reads, the amount<br>applied is populated.<br><br>An `OrderLineItemAppliedDiscount` is automatically created on every line item for all<br>`ORDER` scoped discounts that are added to the order. `OrderLineItemAppliedDiscount` records<br>for `LINE_ITEM` scoped discounts must be added in requests for the discount to apply to any<br>line items.<br><br>To change the amount of a discount, modify the referenced top-level discount. |
| `appliedServiceCharges` | [`OrderLineItemAppliedServiceCharge[] \| null \| undefined`](../../doc/models/order-line-item-applied-service-charge.md) | Optional | The list of references to service charges applied to this line item. Each<br>`OrderLineItemAppliedServiceCharge` has a `service_charge_id` that references the `uid` of a<br>top-level `OrderServiceCharge` applied to the line item. On reads, the amount applied is<br>populated.<br><br>To change the amount of a service charge, modify the referenced top-level service charge. |
| `basePriceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.<br>Fields that do not explicitly define whether they are signed or unsigned are<br>considered unsigned and can only hold positive amounts. For signed fields, the<br>sign of the value indicates the purpose of the money transfer. See<br>[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)<br>for more information. |
| `variationTotalPriceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.<br>Fields that do not explicitly define whether they are signed or unsigned are<br>considered unsigned and can only hold positive amounts. For signed fields, the<br>sign of the value indicates the purpose of the money transfer. See<br>[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)<br>for more information. |
| `grossSalesMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.<br>Fields that do not explicitly define whether they are signed or unsigned are<br>considered unsigned and can only hold positive amounts. For signed fields, the<br>sign of the value indicates the purpose of the money transfer. See<br>[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)<br>for more information. |
| `totalTaxMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.<br>Fields that do not explicitly define whether they are signed or unsigned are<br>considered unsigned and can only hold positive amounts. For signed fields, the<br>sign of the value indicates the purpose of the money transfer. See<br>[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)<br>for more information. |
| `totalDiscountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.<br>Fields that do not explicitly define whether they are signed or unsigned are<br>considered unsigned and can only hold positive amounts. For signed fields, the<br>sign of the value indicates the purpose of the money transfer. See<br>[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)<br>for more information. |
| `totalMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.<br>Fields that do not explicitly define whether they are signed or unsigned are<br>considered unsigned and can only hold positive amounts. For signed fields, the<br>sign of the value indicates the purpose of the money transfer. See<br>[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)<br>for more information. |
| `pricingBlocklists` | [`OrderLineItemPricingBlocklists \| undefined`](../../doc/models/order-line-item-pricing-blocklists.md) | Optional | Describes pricing adjustments that are blocked from automatic<br>application to a line item. For more information, see<br>[Apply Taxes and Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts). |
| `totalServiceChargeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | Represents an amount of money. `Money` fields can be signed or unsigned.<br>Fields that do not explicitly define whether they are signed or unsigned are<br>considered unsigned and can only hold positive amounts. For signed fields, the<br>sign of the value indicates the purpose of the money transfer. See<br>[Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)<br>for more information. |

## Example (as JSON)

```json
{
  "uid": "uid4",
  "name": "name4",
  "quantity": "quantity0",
  "quantity_unit": {
    "measurement_unit": {
      "custom_unit": {
        "name": "name2",
        "abbreviation": "abbreviation4"
      },
      "area_unit": "IMPERIAL_ACRE",
      "length_unit": "IMPERIAL_INCH",
      "volume_unit": "METRIC_LITER",
      "weight_unit": "IMPERIAL_WEIGHT_OUNCE"
    },
    "precision": 54,
    "catalog_object_id": "catalog_object_id0",
    "catalog_version": 12
  },
  "note": "note0",
  "catalog_object_id": "catalog_object_id8"
}
```

