{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oracle-retail/json-schema/oracle-retail-order-create-schema.json",
  "title": "OrderCreate",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oracle-retail-orders-api-openapi.yml#/components/schemas/OrderCreate",
  "type": "object",
  "required": [
    "externalOrderId",
    "channelId",
    "customerId",
    "currencyCode",
    "lines"
  ],
  "properties": {
    "externalOrderId": {
      "type": "string"
    },
    "channelId": {
      "type": "string"
    },
    "customerId": {
      "type": "string"
    },
    "currencyCode": {
      "type": "string",
      "maxLength": 3
    },
    "shippingAddress": {
      "$ref": "#/$defs/Address"
    },
    "lines": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OrderLineCreate"
      }
    }
  },
  "$defs": {
    "Address": {
      "type": "object",
      "properties": {
        "firstName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "address1": {
          "type": "string"
        },
        "address2": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "country": {
          "type": "string",
          "maxLength": 3
        },
        "phone": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        }
      }
    },
    "OrderLineCreate": {
      "type": "object",
      "required": [
        "itemId",
        "quantity",
        "unitPrice"
      ],
      "properties": {
        "itemId": {
          "type": "string"
        },
        "quantity": {
          "type": "integer"
        },
        "unitPrice": {
          "type": "number",
          "format": "double"
        },
        "fulfillmentType": {
          "type": "string",
          "enum": [
            "SHIP_TO_HOME",
            "SHIP_TO_STORE",
            "PICKUP_IN_STORE",
            "DELIVERY"
          ],
          "default": "SHIP_TO_HOME"
        }
      }
    }
  }
}