{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xavio-in/json-schema/xavio-in-order-list-item-schema.json",
  "title": "OrderListItem",
  "description": "One row of GET /api/v1/orders. Since 2026-10-02 the row never carries the buyer user_id or the raw delivery_address; ship_to replaces it (contact details only with customers:pii).",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xavio-in-openapi.json#/components/schemas/OrderListItem",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "order"
      ]
    },
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "drawer_host_id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string"
    },
    "total_cents": {
      "type": "integer"
    },
    "currency": {
      "type": "string"
    },
    "story_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "source_post_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "tracking_status": {
      "type": [
        "string",
        "null"
      ]
    },
    "tracking_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "carrier": {
      "type": [
        "string",
        "null"
      ]
    },
    "cancel_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "cancelled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "cancelled_by": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "ship_to": {
      "type": [
        "object",
        "null"
      ],
      "description": "city / state / postcode / country always; full_name, phone, line1, line2, landmark only with customers:pii.",
      "properties": {
        "city": {
          "type": [
            "string",
            "null"
          ]
        },
        "state": {
          "type": [
            "string",
            "null"
          ]
        },
        "postcode": {
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "type": [
            "string",
            "null"
          ]
        },
        "full_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "customers:pii only"
        },
        "phone": {
          "type": [
            "string",
            "null"
          ],
          "description": "customers:pii only; masked after the active stage"
        },
        "line1": {
          "type": [
            "string",
            "null"
          ],
          "description": "customers:pii only"
        },
        "line2": {
          "type": [
            "string",
            "null"
          ],
          "description": "customers:pii only"
        },
        "landmark": {
          "type": [
            "string",
            "null"
          ],
          "description": "customers:pii only"
        }
      },
      "required": [
        "city",
        "state",
        "postcode",
        "country"
      ]
    },
    "items": {
      "type": "array",
      "description": "Only with ?include_items=true.",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "order_id": {
            "type": "string",
            "format": "uuid"
          },
          "product_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "variant_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "variant_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "qty": {
            "type": "integer"
          },
          "unit_price_cents": {
            "type": "integer"
          }
        }
      }
    }
  }
}