{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dropto-run/json-schema/dropto-run-plan-history-response-schema.json",
  "title": "PlanHistoryResponse",
  "description": "Response of `GET /api/billing/plan-history`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dropto-run-billing-api-openapi.yml#/components/schemas/PlanHistoryResponse",
  "properties": {
    "changes": {
      "description": "The account's tier changes, newest first.",
      "items": {
        "$ref": "#/$defs/PlanChangeRow"
      },
      "type": "array"
    }
  },
  "required": [
    "changes"
  ],
  "type": "object",
  "$defs": {
    "PlanChangeRow": {
      "description": "One movement between tiers, as a page renders it.",
      "properties": {
        "fromInterval": {
          "description": "The billing term before, or null when there was none.",
          "type": [
            "null",
            "string"
          ]
        },
        "fromPlanId": {
          "description": "The tier before.",
          "type": "string"
        },
        "fromSeats": {
          "description": "Seats paid for before; one on every tier not sold by the seat.",
          "format": "int32",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ]
        },
        "occurredAt": {
          "description": "When it happened.",
          "format": "date-time",
          "type": "string"
        },
        "reason": {
          "description": "Why it moved: one of PlanChangeReason.",
          "type": "string"
        },
        "toInterval": {
          "description": "The billing term after, or null when there is none.",
          "type": [
            "null",
            "string"
          ]
        },
        "toPlanId": {
          "description": "The tier after.",
          "type": "string"
        },
        "toSeats": {
          "description": "Seats paid for afterwards.",
          "format": "int32",
          "pattern": "^-?(?:0|[1-9]\\d*)$",
          "type": [
            "integer",
            "string"
          ]
        }
      },
      "required": [
        "fromPlanId",
        "toPlanId",
        "fromInterval",
        "toInterval",
        "reason",
        "occurredAt",
        "fromSeats",
        "toSeats"
      ],
      "type": "object"
    }
  }
}