{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hoplix-com/json-schema/hoplix-com-order-input-schema.json",
  "title": "OrderInput",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/hoplix-com-v1-openapi.json#/components/schemas/OrderInput",
  "type": "object",
  "required": [
    "products",
    "shipping-mode",
    "shipping-info"
  ],
  "properties": {
    "products": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/OrderItem"
      }
    },
    "shipping-mode": {
      "type": "string",
      "description": "fob = collection by your own courier",
      "enum": [
        "economy",
        "tracked",
        "express",
        "fob"
      ]
    },
    "order_reference": {
      "type": "string",
      "description": "Your own order reference; duplicates are refused"
    },
    "payment-method": {
      "type": "string",
      "description": "Default credit-card",
      "enum": [
        "credit-card",
        "wallet"
      ]
    },
    "client-email": {
      "type": "string",
      "description": "Address that receives the tracking e-mail"
    },
    "shipping-info": {
      "$ref": "#/$defs/ShippingInfo"
    }
  },
  "$defs": {
    "OrderItem": {
      "type": "object",
      "required": [
        "campaign-id",
        "product-id",
        "product-color",
        "product-size",
        "quantity"
      ],
      "properties": {
        "campaign-id": {
          "type": "string"
        },
        "product-id": {
          "type": "string",
          "description": "From info-campaign"
        },
        "product-color": {
          "type": "string"
        },
        "product-size": {
          "type": "string"
        },
        "quantity": {
          "type": "integer",
          "minimum": 1
        }
      }
    },
    "ShippingInfo": {
      "type": "object",
      "required": [
        "name",
        "surname",
        "address",
        "zip-code",
        "city",
        "country-code"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "surname": {
          "type": "string"
        },
        "address": {
          "type": "string"
        },
        "address-more": {
          "type": "string"
        },
        "zip-code": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "province": {
          "type": "string",
          "description": "Province code, required for Italy (e.g. MI)"
        },
        "country-code": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2"
        }
      }
    }
  }
}