{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/withreach/json-schema/withreach-quote-schema.json",
  "title": "Quote",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/withreach-tax-quote-api-openapi.yml#/components/schemas/Quote",
  "type": "object",
  "properties": {
    "Id": {
      "description": "A unique string generated by Reach to identify the specific tax quote instance.",
      "type": "string",
      "format": "uuid",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
      "minLength": 36,
      "maxLength": 36,
      "readOnly": true
    },
    "Currency": {
      "description": "Three-character ISO-4217 currency code.",
      "type": "string",
      "minLength": 3,
      "maxLength": 3
    },
    "Reference": {
      "description": "Unique reference provided by supplier.",
      "type": "string",
      "minLength": 1
    },
    "Items": {
      "description": "List of items.",
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/Item"
      }
    },
    "ShippingAddress": {
      "$ref": "#/$defs/Address"
    },
    "WarehouseAddress": {
      "$ref": "#/$defs/WarehouseAddress"
    },
    "BusinessIdentificationNumber": {
      "description": "Business Identification Number for tax exemption.",
      "type": "string",
      "minLength": 1
    },
    "Amount": {
      "description": "Amount to be paid. Currency is defined by the parent object.",
      "type": "number",
      "format": "float",
      "readOnly": true
    },
    "TaxAmount": {
      "description": "Amount of tax calculated.",
      "type": "number",
      "format": "float",
      "readOnly": true
    }
  },
  "required": [
    "Reference",
    "Currency",
    "Items",
    "ShippingAddress"
  ],
  "$defs": {
    "Address": {
      "description": "Standard address.",
      "type": "object",
      "properties": {
        "Street": {
          "description": "Customer's street address.",
          "type": "string",
          "minLength": 1
        },
        "City": {
          "description": "Customer's city.",
          "type": "string",
          "minLength": 1
        },
        "Region": {
          "description": "Customer's state or province. The region code is the region-only portion of an ISO-3166-2 region (e.g., MX-GUA would be sent as \"GUA\").",
          "type": "string",
          "minLength": 2,
          "maxLength": 3
        },
        "Country": {
          "description": "Customer's country (uppercase ISO 3166 alpha-2 country code).",
          "type": "string",
          "minLength": 2,
          "maxLength": 2
        },
        "Postcode": {
          "description": "Customer's zip/postal code.",
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "Street",
        "City",
        "Country"
      ]
    },
    "Item": {
      "description": "A line item, representing one or more digital or physical goods that a user is paying for.",
      "type": "object",
      "properties": {
        "Id": {
          "description": "Line item identifier.",
          "type": "string",
          "minLength": 1,
          "readOnly": true
        },
        "Sku": {
          "description": "Field to identify a line item within the tax system.",
          "type": "string",
          "minLength": 1
        },
        "Description": {
          "description": "Description of a line item.",
          "type": "string",
          "minLength": 1
        },
        "TaxCode": {
          "description": "Tax code for the line item.",
          "type": "string",
          "minLength": 1,
          "readOnly": true
        },
        "TaxIncluded": {
          "description": "Indicates if a line item has tax included.",
          "type": "boolean"
        },
        "Amount": {
          "description": "Amount of item to be paid. Currency is defined by the parent object.",
          "type": "number",
          "format": "float"
        },
        "TaxAmount": {
          "description": "Amount of tax calculated for this item.",
          "type": "number",
          "format": "float",
          "readOnly": true
        },
        "Tax": {
          "description": "List of taxes applied for the item.",
          "type": "array",
          "minItems": 1,
          "readOnly": true,
          "items": {
            "$ref": "#/$defs/Tax"
          }
        }
      },
      "required": [
        "Amount",
        "Sku"
      ]
    },
    "Tax": {
      "description": "Representation of the Tax calculated.",
      "type": "object",
      "readOnly": true,
      "properties": {
        "Name": {
          "description": "Name of the tax.",
          "type": "string",
          "minLength": 1,
          "readOnly": true
        },
        "Type": {
          "description": "Type of tax.",
          "type": "string",
          "readOnly": true
        },
        "TaxAmount": {
          "description": "Amount of tax calculated of this tax type.",
          "type": "number",
          "format": "float",
          "readOnly": true
        }
      }
    },
    "WarehouseAddress": {
      "description": "Required for physical goods. Standard address.",
      "type": "object",
      "properties": {
        "Street": {
          "description": "Warehouse's street address.",
          "type": "string",
          "minLength": 1
        },
        "City": {
          "description": "Warehouse's city.",
          "type": "string",
          "minLength": 1
        },
        "Region": {
          "description": "Warehouse's state or province. The region code is the region-only portion of an ISO-3166-2 region (e.g., MX-GUA would be sent as \"GUA\").",
          "type": "string",
          "minLength": 2,
          "maxLength": 3
        },
        "Country": {
          "description": "Warehouse's country (uppercase ISO 3166 alpha-2 country code).",
          "type": "string",
          "minLength": 2,
          "maxLength": 2
        },
        "Postcode": {
          "description": "Warehouse's zip/postal code.",
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "Street",
        "City",
        "Country"
      ]
    }
  }
}