{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentdrives-com/json-schema/agentdrives-com-order-schema.json",
  "title": "Order",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentdrives-com-openapi.json#/components/schemas/Order",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "product": {
      "type": "string",
      "description": "The id you order with: free, audit (the Audit; a renewal answers audit with renewal_of), monthly or yearly (a Monthly drive bought before 18 Oct 2026, now retired), stack, stack3, builder, team, pay_check; findings and report: an order of the retired Findings or Full report. GET /api/me's orders keep the stored ids: drive the Audit, verified_month or verified the Monthly drive, quick Findings, report a Full report"
    },
    "report_url": {
      "type": "string",
      "description": "A report delivered: its page in the dashboard"
    },
    "status": {
      "enum": [
        "requested",
        "paid",
        "queued",
        "running",
        "done",
        "failed",
        "past_due",
        "cancelled"
      ],
      "description": "past_due: a Monthly drive renewal failed; it is active again once paid. failed: paid, but the drive and its automatic retry failed; a person drives it again or refunds it"
    },
    "tool_slug": {
      "type": [
        "string",
        "null"
      ]
    },
    "url": {
      "type": [
        "string",
        "null"
      ]
    },
    "followup_available": {
      "type": "boolean"
    },
    "followups_left": {
      "type": "integer"
    },
    "rivals": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "The Audit ordered before 22 Oct 2026: its rivals, compared privately (new orders take none)"
    },
    "target_level": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 5,
      "description": "The Audit: the level the owner aims for, shown as their goal, never a promise"
    },
    "renewal_of": {
      "type": [
        "string",
        "null"
      ],
      "description": "A renewal: the Audit it renews"
    },
    "renewal": {
      "type": [
        "object",
        "null"
      ],
      "description": "A done Audit: its renewal ($199), open from 11 months after its report until 13",
      "properties": {
        "price_cents": {
          "type": "integer"
        },
        "opens": {
          "type": "string",
          "format": "date-time"
        },
        "closes": {
          "type": "string",
          "format": "date-time"
        },
        "open": {
          "type": "boolean"
        }
      }
    },
    "drive_order": {
      "type": [
        "string",
        "null"
      ],
      "description": "A subscription from before 10 Oct 2026 that came with a Drive: that order"
    },
    "keep_from": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "The Monthly drive: the day it started"
    },
    "keep_cents": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The Monthly drive: its price per period, excl. VAT"
    },
    "legacy_keep": {
      "type": "boolean",
      "description": "A subscription from before 10 Oct 2026: it keeps its price and terms until it ends"
    },
    "offers_ok": {
      "type": "boolean",
      "description": "A free check: the box for the monthly report and offers was ticked"
    },
    "pay": {
      "type": [
        "object",
        "null"
      ],
      "description": "What you gave so our agent buys your plan: never the value",
      "properties": {
        "kind": {
          "enum": [
            "code",
            "sandbox",
            "seat"
          ]
        },
        "hint": {
          "type": [
            "string",
            "null"
          ],
          "description": "A code's last two characters"
        },
        "status": {
          "enum": [
            "waiting",
            "handed",
            "done",
            "removed"
          ],
          "description": "waiting: kept for the drive; handed: a drive has it now; done: that drive ended and it is deleted; removed: you removed it, or the order ended first"
        },
        "at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "mailed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "A seat: when we sent you the address our agent signed up with"
        }
      }
    },
    "check_state": {
      "enum": [
        "failed",
        "retrying",
        "late",
        null
      ],
      "description": "A free check: failed when it didn't finish (order it again: a check that didn't finish doesn't count against its domain's 90 days); retrying when our side stopped it and it runs again by itself; late when it has waited longer than usual to start; null otherwise"
    },
    "check_reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "A free check that failed, is retrying or is late: why, in plain words, and what to do next"
    },
    "check_eta": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "A free check that waits or runs: when it should be done (the checks ahead of it, at the recent checks' pace); null when our queue can't say (check_reason says why)"
    },
    "terms": {
      "type": [
        "string",
        "null"
      ],
      "description": "The date of the terms the order was bought on (YYYY-MM-DD)"
    },
    "business": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "A paid order: you confirmed you buy for your business"
    },
    "company": {
      "type": [
        "string",
        "null"
      ]
    },
    "vat_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "plan_choice": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "include",
        "self_refund",
        "none",
        null
      ],
      "description": "The owner's paid plan on the Audit"
    },
    "plan_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "plan_cents": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The plan's monthly price: the drive's budget"
    },
    "price_cents": {
      "type": [
        "integer",
        "null"
      ],
      "description": "What the order cost before VAT, in its currency; null until it is paid"
    },
    "plan_line_cents": {
      "type": "integer",
      "description": "What the plan line took at checkout (include)"
    },
    "plan_spent_cents": {
      "type": [
        "integer",
        "null"
      ],
      "description": "What the drive spent on the plan, net of what the product refunded"
    },
    "plan_refunded_cents": {
      "type": "integer",
      "description": "What went back of the plan line"
    },
    "plan_status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "waiting",
        "bought",
        "not_bought",
        "settled",
        "by_hand",
        null
      ]
    },
    "plan_result": {
      "type": [
        "object",
        "null"
      ],
      "description": "What the drive recorded: bought, charged, currency, used, cancel, refund, charged_after_cancel"
    }
  }
}