{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "client_id": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "event": {
      "type": "string",
      "const": "transaction_end"
    },
    "tracking_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "timestamp_ms": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "event_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "schema_version": {
      "type": "number",
      "const": 1
    },
    "user_agent": {
      "type": "string",
      "maxLength": 2048
    },
    "shop_country": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 8
        },
        {
          "type": "null"
        }
      ]
    },
    "channel": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ]
    },
    "store_id": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ]
    },
    "instance_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "product_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "brand_id": {
      "anyOf": [
        {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "product_associated": {
      "type": "boolean"
    },
    "ab_data": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    },
    "testEvent": {
      "type": "boolean",
      "const": true
    },
    "extra": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    },
    "order_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "products": {
      "minItems": 1,
      "maxItems": 500,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "price": {
            "type": "number",
            "minimum": 0
          },
          "quantity": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "size": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "variant_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "platform_product_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "sent_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "unknown_product": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": {}
      }
    },
    "product_ids": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "total_price": {
      "anyOf": [
        {
          "type": "number",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
    },
    "paid_price": {
      "type": "object",
      "properties": {
        "price": {
          "type": "number",
          "minimum": 0
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$"
        }
      },
      "additionalProperties": false
    },
    "transaction_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "products_associated": {
      "type": "array",
      "items": {
        "type": "boolean"
      }
    },
    "brand_ids": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          {
            "type": "null"
          }
        ]
      }
    }
  },
  "required": [
    "client_id",
    "event",
    "timestamp_ms",
    "order_id",
    "products"
  ],
  "additionalProperties": {},
  "x-fmt-schema-version": 1
}
