title: Line Item (Order)
type: object
properties:
  uuid:
    type: string
    format: uuid
    description: The unique identifier.
  source_item_uuid:
    type:
      - string
      - 'null'
    description: |-
      The UUID of the original (catalog) item that was used to create this instance.

      For ad-hoc items, this field will be `null`.
    format: uuid
  name:
    type: string
    minLength: 1
    maxLength: 255
    example: Chocolate Cake
    description: The name of the item at the time the order was placed.
  source_category_name:
    type:
      - string
      - 'null'
    minLength: 1
    maxLength: 255
    example: Lunch
    description: The saved source category name. Null is displayed as "Unattributed" in category reports.
  qty:
    type: integer
    minimum: 1
    description: The quantity that the customer requested.
  unit_price:
    $ref: ./Money.yaml
    description: 'The value of a single unit of the meal, before the value of modifiers, meals, discounts, surcharges and taxes are calculated.'
  modifiers:
    type: array
    description: The modifiers that the customer selected for this item.
    items:
      $ref: ./OrderModifier.yaml
  meal:
    oneOf:
      - type: 'null'
      - type: object
        $ref: ./OrderMeal.yaml
    description: 'The meal the customer selected for this item, if any.'
  sub_total:
    $ref: ./Money.yaml
    description: 'The unit price of the item, plus the aggregate value of the selected modifiers.'
  discounts:
    type: array
    description: The discounts that have been applied against the line item.
    items:
      $ref: ./OrderDiscount.yaml
  total_discounts:
    $ref: ./Money.yaml
    description: The aggregate value of the discounts applied against the line item.
  surcharges:
    type: array
    description: The surcharges that have been levied against the line item.
    items:
      $ref: ./OrderSurcharge.yaml
  total_surcharges:
    $ref: ./Money.yaml
    description: The aggregate value of the surcharges levied against the line item.
  taxes:
    type: array
    description: The taxes that have been levied against the line item.
    items:
      $ref: ./OrderTax.yaml
  total_taxes:
    $ref: ./Money.yaml
    description: The aggregate value of the taxes levied against the line item.
  total:
    $ref: ./Money.yaml
    description: The total value of the meal (this will be the same as `sub_total`).
description: Represents a line item that has been applied against an order.
x-tags:
  - Orders
