{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/raute-io/json-schema/raute-io-new-order-schema.json",
  "title": "NewOrder",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/raute-io-openapi.json#/components/schemas/NewOrder",
  "type": "object",
  "required": [
    "customer_name",
    "address"
  ],
  "properties": {
    "customer_name": {
      "type": "string"
    },
    "address": {
      "type": "string",
      "description": "A full street address. It is geocoded on creation."
    },
    "city": {
      "type": [
        "string",
        "null"
      ]
    },
    "state": {
      "type": [
        "string",
        "null"
      ]
    },
    "zip_code": {
      "type": [
        "string",
        "null"
      ]
    },
    "phone": {
      "type": [
        "string",
        "null"
      ]
    },
    "notes": {
      "type": "string"
    },
    "order_type": {
      "type": "string",
      "enum": [
        "delivery",
        "pickup"
      ],
      "default": "delivery"
    },
    "order_number": {
      "type": [
        "string",
        "null"
      ],
      "description": "Your own human readable number. Generated if omitted."
    },
    "external_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The id of this order in your system. Lets you address it later without storing Raute ids."
    },
    "source": {
      "type": "string",
      "default": "api",
      "description": "A name for your system, used with external_id to address orders."
    },
    "delivery_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "time_window_start": {
      "type": [
        "string",
        "null"
      ]
    },
    "time_window_end": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}