{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/lightspeed/main/json-schema/lightspeed-tax-collection-schema.json",
  "title": "Tax Collection",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lightspeed-taxes-api-openapi.yml#/components/schemas/TaxCollection",
  "properties": {
    "data": {
      "description": "An array of tax objects.",
      "items": {
        "$ref": "#/$defs/Tax"
      },
      "type": "array"
    }
  },
  "required": [
    "data"
  ],
  "type": "object",
  "$defs": {
    "RateRule": {
      "description": "Rule that applies to a rate.\nE.g.: Tax rate that applies for clothing and footwear costing $90 or more.",
      "properties": {
        "tax_code": {
          "description": "Label assigned to a product which indicates the tax obligation.",
          "enum": [
            "vend_clothing_footwear"
          ],
          "type": "string"
        },
        "type": {
          "description": "Type of rule to apply.",
          "enum": [
            "threshold"
          ],
          "type": "string"
        },
        "value": {
          "description": "An optional value that can be used for the rule.",
          "type": "number"
        }
      },
      "required": [
        "tax_code",
        "type"
      ],
      "title": "Rate Rule",
      "type": "object"
    },
    "Tax": {
      "properties": {
        "deleted_at": {
          "description": "The deletion timestamp.",
          "type": [
            "string",
            "null"
          ]
        },
        "display_name": {
          "description": "The name of the tax used for display.",
          "type": "string"
        },
        "id": {
          "description": "Auto-generated object ID.",
          "format": "uuid",
          "type": "string"
        },
        "is_default": {
          "description": "Indicates whether the tax is used as the default one.",
          "type": "boolean"
        },
        "name": {
          "description": "The name of the tax.",
          "type": "string"
        },
        "rates": {
          "items": {
            "$ref": "#/$defs/TaxRate"
          },
          "type": "array"
        },
        "version": {
          "description": "Auto-incrementing object version number.",
          "format": "int64",
          "type": "integer"
        }
      },
      "required": [
        "deleted_at",
        "display_name",
        "id",
        "is_default",
        "version"
      ],
      "title": "Tax",
      "type": "object"
    },
    "TaxRate": {
      "properties": {
        "display_name": {
          "description": "The name of the tax rate used for display.",
          "type": "string"
        },
        "id": {
          "description": "Auto-generated object ID.",
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "description": "The name of the tax rate.",
          "type": "string"
        },
        "rate": {
          "description": "Tax rate value. `0.1 = 10%`.",
          "format": "double",
          "type": "number"
        },
        "rules": {
          "description": "Rules that apply to the rate for tax exclusive outlets.",
          "items": {
            "$ref": "#/$defs/RateRule"
          },
          "type": "array"
        }
      },
      "required": [
        "display_name",
        "id",
        "name",
        "rate"
      ],
      "title": "Tax rate",
      "type": "object"
    }
  }
}