{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/scribe-handwritten/main/json-schema/scribe-handwritten-order-schema.json",
  "title": "Order",
  "description": "A mail‐campaign order record",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scribe-handwritten-openapi.json#/components/schemas/Order",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64"
    },
    "user_id": {
      "type": "integer",
      "format": "int64"
    },
    "order_amount": {
      "description": "Total amount for the order",
      "type": "number",
      "format": "double"
    },
    "status": {
      "type": "string",
      "enum": [
        "payment-pending",
        "pending",
        "processing",
        "printing",
        "shipped",
        "delivered",
        "draft",
        "on-going",
        "paused",
        "delete",
        "expect-48-hour-delay",
        "queued"
      ]
    },
    "uploaded_recipient_file": {
      "type": "string"
    },
    "campaign_name": {
      "type": "string"
    },
    "campaign_name_new": {
      "type": "string"
    },
    "campaign_type": {
      "type": "string",
      "enum": [
        "one-time",
        "on-going"
      ]
    },
    "campaign_type_2": {
      "type": "string",
      "enum": [
        "single",
        "on-going",
        "One-time",
        "Ongoing",
        "Single letter"
      ]
    },
    "campaign_message": {
      "type": "string"
    },
    "text_type": {
      "type": "string",
      "enum": [
        "Short Text",
        "Medium Text",
        "Long Text"
      ]
    },
    "font": {
      "type": "string"
    },
    "front_design": {
      "type": "string"
    },
    "back_design": {
      "type": "string"
    },
    "main_design": {
      "type": "string"
    },
    "inner_design": {
      "type": "string"
    },
    "master_outer": {
      "type": "string"
    },
    "master_inner": {
      "type": "string"
    },
    "schedule_status": {
      "type": "integer"
    },
    "exclude_mf": {
      "type": "integer"
    },
    "auto_charge": {
      "type": "integer"
    },
    "threshold": {
      "type": "integer"
    },
    "delivered_at": {
      "description": "Timestamp when order was delivered",
      "type": "string",
      "format": "date-time"
    },
    "campaign_id": {
      "description": "Order ID (alias for id)",
      "type": "integer",
      "format": "int64"
    },
    "user_email": {
      "description": "Email of the user who created the order",
      "type": "string",
      "format": "email"
    },
    "created_at": {
      "description": "Order creation timestamp",
      "type": "string",
      "format": "date-time"
    },
    "submitted_date": {
      "description": "Order submission timestamp",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "list_id": {
      "description": "Associated listing ID",
      "type": [
        "integer",
        "null"
      ],
      "format": "int64"
    },
    "list_count": {
      "description": "Number of contacts in the listing",
      "type": "integer"
    },
    "message_dynamic_params": {
      "description": "Dynamic message parameters",
      "type": "object"
    },
    "message": {
      "description": "Campaign message content",
      "type": [
        "string",
        "null"
      ]
    },
    "external_id": {
      "description": "External system ID",
      "type": [
        "string",
        "null"
      ]
    },
    "external_email": {
      "description": "External system email",
      "type": [
        "string",
        "null"
      ],
      "format": "email"
    }
  },
  "type": "object"
}