{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scaledthought-com/json-schema/scaledthought-com-topup-schema.json",
  "title": "Topup",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scaledthought-com-openapi.json#/components/schemas/Topup",
  "type": "object",
  "properties": {
    "topup_id": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "checkout",
        "auto_reload",
        "card_setup"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "paid",
        "expired",
        "failed",
        "canceled"
      ]
    },
    "amount_usd": {
      "type": "number"
    },
    "approval_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "failure_code": {
      "type": [
        "string",
        "null"
      ]
    },
    "auto_reload": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "threshold_usd": {
              "type": "number"
            },
            "amount_usd": {
              "type": "number"
            },
            "monthly_limit_usd": {
              "type": [
                "number",
                "null"
              ]
            }
          },
          "required": [
            "threshold_usd",
            "amount_usd",
            "monthly_limit_usd"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "topup_id",
    "kind",
    "status",
    "amount_usd",
    "approval_url",
    "expires_at",
    "created_at",
    "completed_at",
    "failure_code",
    "auto_reload"
  ],
  "additionalProperties": false
}