{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/essentras-com/json-schema/essentras-com-order-schema.json",
  "title": "Order",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/essentras-com-openapi.json#/components/schemas/Order",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "order"
      ]
    },
    "id": {
      "type": "string",
      "description": "Order id for the API (the public id)."
    },
    "number": {
      "type": [
        "integer",
        "null"
      ]
    },
    "status": {
      "type": "string"
    },
    "payment_status": {
      "type": "string"
    },
    "fulfillment": {
      "type": "string",
      "enum": [
        "awaiting_payment",
        "awaiting_brief",
        "in_progress",
        "partially_published",
        "published",
        "cancelled",
        "refunded"
      ]
    },
    "channel": {
      "type": "string",
      "enum": [
        "api",
        "reseller_portal",
        "website"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "paid_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "currency": {
      "type": "string",
      "enum": [
        "USD"
      ]
    },
    "pricing_basis": {
      "type": "string",
      "enum": [
        "list",
        "reseller"
      ]
    },
    "subtotal": {
      "type": "number"
    },
    "discount": {
      "type": "number"
    },
    "discount_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "total": {
      "type": "number"
    },
    "paid_from_wallet": {
      "type": "number"
    },
    "client_reference": {
      "type": [
        "string",
        "null"
      ]
    },
    "line_items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Outlet id."
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "unit_price": {
            "type": "number"
          },
          "list_price": {
            "type": "number"
          },
          "amount": {
            "type": "number"
          },
          "placement_note": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "in_progress",
              "published"
            ]
          },
          "live_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      }
    },
    "brief": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "status": {
          "type": "string"
        },
        "submitted_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "article_status": {
          "type": "string"
        }
      }
    },
    "dashboard_url": {
      "type": "string",
      "format": "uri"
    }
  }
}