{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/emporix/main/json-schema/emporix-tax-calculation-request-schema.json",
  "title": "taxCalculationRequest",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-tax-service-openapi.yml#/components/schemas/taxCalculationRequest",
  "type": "object",
  "properties": {
    "commandUuid": {
      "type": "string",
      "description": "Calculation command's unique identifier.\n\n**Note**: This field is optional. If not specified, the `commandUuid` will be generated by the server."
    },
    "input": {
      "type": "object",
      "description": "Information based on which the price will be calculated.",
      "required": [
        "targetTaxClass",
        "targetLocation",
        "price"
      ],
      "properties": {
        "sourceLocation": {
          "description": "Country for which the provided price is originally defined.\n\n**Note**: This field is only mandatory if the `includesTax` field is set to `true`.",
          "allOf": [
            {
              "$ref": "#/$defs/location"
            }
          ]
        },
        "sourceTaxClass": {
          "type": "string",
          "description": "Tax class originally applied to the provided price.\n\n**Note**: This field is only mandatory if the `includesTax` field is set to `true`."
        },
        "targetLocation": {
          "description": "Country for which the price should be calculated.",
          "allOf": [
            {
              "$ref": "#/$defs/location"
            }
          ]
        },
        "targetTaxClass": {
          "type": "string",
          "description": "Tax class that should be applied when calculating the price."
        },
        "includesTax": {
          "type": "boolean",
          "description": "Flag indicating whether the value provided in the `price` field is expressed as net or gross.\n\n| Value | Description |\n| --- | --- |\n| `true` | Prices are expressed as gross values. |\n| `false` | Prices are expressed as net values. |"
        },
        "price": {
          "type": "number",
          "description": "Original price value.\n\nThis field should contain by a number where the cent part is separated by a dot sign - such as `12.99`.\n\n**Note**: The cent part of the price is not limited to two digits. You can specify the price with any precision."
        }
      }
    }
  },
  "required": [
    "input"
  ],
  "$defs": {
    "location": {
      "type": "object",
      "description": "",
      "properties": {
        "countryCode": {
          "type": "string",
          "description": "Code of the country for which the tax classes are specified, as defined in the Country Service."
        }
      },
      "required": [
        "countryCode"
      ]
    }
  }
}