{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/spacecontext-app/json-schema/spacecontext-app-wallet-schema.json",
  "title": "Wallet",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/spacecontext-app-openapi.json#/components/schemas/Wallet",
  "type": "object",
  "required": [
    "object",
    "currency",
    "balance_cents",
    "free_scans_remaining",
    "scan_price_cents",
    "card_on_file",
    "auto_recharge"
  ],
  "properties": {
    "object": {
      "type": "string",
      "const": "wallet"
    },
    "currency": {
      "type": "string",
      "const": "usd"
    },
    "balance_cents": {
      "type": "integer"
    },
    "free_scans_remaining": {
      "type": "integer",
      "minimum": 0
    },
    "scan_price_cents": {
      "type": "integer",
      "minimum": 1
    },
    "card_on_file": {
      "type": "boolean",
      "description": "A real card stands behind the account: a card saved in the console, a paid top-up, or a settled x402 payment on mainnet. Starting a live scan, and creating a live key that can scan, need it: without it they answer 402 `PAYMENT_METHOD_REQUIRED`. Adding a card charges nothing."
    },
    "tax_added": {
      "type": "boolean",
      "description": "Whether tax is added on top of top-ups and automatic recharges where it applies (such as VAT), from the billing address and tax ID, and shown on the payment page and the invoice. A business with a valid VAT number in another EU country is invoiced under the reverse charge. The balance always receives the amount before tax."
    },
    "auto_recharge": {
      "type": "object",
      "required": [
        "enabled"
      ],
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "threshold_cents": {
          "type": [
            "integer",
            "null"
          ]
        },
        "amount_cents": {
          "type": [
            "integer",
            "null"
          ]
        },
        "payment_method_saved": {
          "type": "boolean"
        },
        "last_error": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "terms_accepted": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "version",
        "accepted_at"
      ],
      "description": "Console only (absent from `GET /wallet`): the first time this account accepted the current version of the billing terms, with the box of a payment or card page; null if never, or only an older version. The box is still ticked on every page (`accept_terms`), and the first acceptance is kept on later payments for a dispute.",
      "properties": {
        "version": {
          "type": "string"
        },
        "accepted_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}