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

      For ad-hoc taxes, this field will be `null`.
    format: uuid
  name:
    type: string
    minLength: 1
    maxLength: 255
    example: GST
    description: The name of the tax at the time the order was placed.
  type:
    enum:
      - inclusive
      - additive
    description: Indicates whether the tax was inclusive or additive.
  percentage:
    type:
      - string
      - 'null'
    description: 'The percentage value that was used when calculating the value of the tax, if any.'
    pattern: '^((0\.[1-9])|([1-9]([0-9])?(\.[0-9])?)|(100\.0|100))$'
    example: '12.5'
  scope:
    enum:
      - order
      - item
    description: 'Indicates whether the tax was applied against line items individually, or spread across the order.'
  value:
    $ref: ./Money.yaml
    description: The total value of the tax.
description: Represents a tax that has been levied against an order line item.
x-tags:
  - Orders
