title: Tax
x-tags:
  - Catalog
type: object
description: Defines a tax that is levied by a merchant against an order or specific line items.
properties:
  uuid:
    type: string
    format: uuid
    description: The tax's unique identifier.
    readOnly: true
  model_type:
    enum:
      - tax
    readOnly: true
  name:
    type: string
    minLength: 1
    maxLength: 255
    example: GST
    description: The tax's display name.
  tags:
    type: array
    uniqueItems: true
    description: The tax's tags.
    items:
      type: string
      format: uuid
  type:
    type: string
    enum:
      - inclusive
      - additive
    description: The tax's type.
  calculation:
    allOf:
      - $ref: ./Calculation.yaml
      - type: object
        required:
          - type
          - fixed_value
          - percentage
          - percentage_cap
          - price_override
        properties:
          type:
            enum:
              - percentage
    description: |-
      The tax's calculation.

      Taxes may only use `percentage` calculations.
  product_group:
    type:
      - string
      - 'null'
    format: uuid
    description: The uuid of the product group that the tax should be levied against.
  availability:
    $ref: ./Availability.yaml
  created_at:
    type: string
    format: date-time
    description: The date-time that the tax was created.
    readOnly: true
required:
  - uuid
  - model_type
  - name
  - tags
  - type
  - calculation
  - product_group
  - availability
  - created_at
