title: Discount (Order)
type: object
x-tags:
  - Orders
description: Represents a discount that has been applied against an order line item.
properties:
  uuid:
    type: string
    format: uuid
    description: The unique identifier.
  source_discount_uuid:
    type:
      - string
      - 'null'
    description: |-
      The UUID of the original (catalog) discount that was used to create this instance.

      For ad-hoc discounts, this field will be `null`.
    format: uuid
  name:
    type: string
    minLength: 1
    maxLength: 255
    example: Sunday Specials
    description: The name of the discount at the time the order was placed.
  promo_code:
    type:
      - string
      - 'null'
    maxLength: 255
    minLength: 1
    description: 'The promo code that was entered by the customer to activate discount, if any.'
    example: FREECOFFEE
  scope:
    enum:
      - order
      - item
    description: 'Indicates whether the discount was applied against line items individually, or spread across the order.'
  value:
    $ref: ./Money.yaml
    description: The total value of the discount.
