{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/hft71/schemas/order-payload.schema.json",
  "title": "HFT71 Order Payload",
  "description": "Minimal order payload used by the plugin for POST /order.",
  "type": "object",
  "required": [
    "referenceId",
    "orderDate",
    "address",
    "items"
  ],
  "properties": {
    "referenceId": {
      "type": "string",
      "minLength": 1
    },
    "orderDate": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "address": {
      "type": "object",
      "required": [
        "address1",
        "city",
        "zip",
        "country",
        "customerName"
      ],
      "properties": {
        "address1": { "type": "string" },
        "address2": { "type": "string" },
        "city": { "type": "string" },
        "zip": { "type": "string" },
        "state": { "type": "string" },
        "country": { "type": "string", "minLength": 2, "maxLength": 2 },
        "customerName": { "type": "string" },
        "email": { "type": "string", "format": "email" },
        "mobile": { "type": "string" }
      },
      "additionalProperties": true
    },
    "items": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "sku",
          "quantity"
        ],
        "properties": {
          "sku": {
            "type": "string",
            "minLength": 1
          },
          "quantity": {
            "type": "integer",
            "minimum": 1
          }
        },
        "additionalProperties": true
      }
    }
  },
  "additionalProperties": true
}

