{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trajectory/json-schema/trajectory-billing-preferences-state-schema.json",
  "title": "BillingPreferencesState",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trajectory-billing-api-openapi.yml#/components/schemas/BillingPreferencesState",
  "properties": {
    "auto_reload": {
      "type": "boolean",
      "title": "Auto Reload",
      "default": false
    },
    "reload_mode": {
      "type": "string",
      "enum": [
        "target",
        "fixed"
      ],
      "title": "Reload Mode",
      "default": "target"
    },
    "threshold_cents": {
      "type": "integer",
      "maximum": 100000000.0,
      "minimum": 500.0,
      "title": "Threshold Cents",
      "default": 1000
    },
    "reload_cents": {
      "type": "integer",
      "maximum": 100000000.0,
      "minimum": 2500.0,
      "title": "Reload Cents",
      "default": 2500
    },
    "monthly_limit_cents": {
      "type": "integer",
      "maximum": 100000000.0,
      "minimum": 2500.0,
      "title": "Monthly Limit Cents",
      "default": 10000
    },
    "spend_alert_cents": {
      "type": "integer",
      "maximum": 100000000.0,
      "minimum": 1.0,
      "title": "Spend Alert Cents",
      "default": 10000
    },
    "sync_pending": {
      "type": "boolean",
      "title": "Sync Pending",
      "default": false
    },
    "sync_delayed": {
      "type": "boolean",
      "title": "Sync Delayed",
      "description": "Pending settings have waited longer than usual to apply.",
      "default": false
    },
    "sync_error": {
      "anyOf": [
        {
          "$ref": "#/$defs/PreferencesSyncError"
        },
        {
          "type": "null"
        }
      ],
      "description": "Why pending settings could not be applied; null unless they failed."
    },
    "fixed_reload_supported": {
      "type": "boolean",
      "const": true,
      "title": "Fixed Reload Supported",
      "default": true
    }
  },
  "type": "object",
  "$defs": {
    "PreferencesSyncError": {
      "type": "string",
      "enum": [
        "missing_card",
        "provider_error"
      ],
      "title": "PreferencesSyncError"
    }
  }
}