{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gnosis-pay/json-schema/gnosis-pay-card-limit-schema.json",
  "title": "CardLimit",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gnosis-pay-cards-api-openapi.yml#/components/schemas/CardLimit",
  "type": "object",
  "required": [
    "spentToday",
    "remaining"
  ],
  "properties": {
    "spentToday": {
      "type": "integer",
      "format": "int64",
      "description": "Amount spent today against this card limit, in minor units of\n`currency`. Resets at the start of each calendar day."
    },
    "remaining": {
      "type": "integer",
      "format": "int64",
      "description": "Remaining headroom today, in minor units of `currency`. Equals max(0,\namount - spentToday)."
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/CardLimitSummary"
    }
  ],
  "$defs": {
    "CardLimitSummary": {
      "type": "object",
      "required": [
        "amount",
        "currency",
        "decimals",
        "syncStatus",
        "updatedAt"
      ],
      "properties": {
        "amount": {
          "type": "integer",
          "format": "int64",
          "description": "Daily limit in minor units of `currency`. Divide by 10^`decimals` to get\nthe major-unit value. USD, EUR, and GBP use 2 decimal places."
        },
        "currency": {
          "type": "string",
          "description": "ISO-4217 currency code — the card native currency (`nativeCurrency` on\nthe card from `GET /cards`)."
        },
        "decimals": {
          "type": "integer",
          "format": "int32",
          "description": "Number of decimal places for this currency (2 for USD, EUR, and GBP)."
        },
        "syncStatus": {
          "$ref": "#/$defs/CardLimitSyncStatus",
          "description": "Replication state of the limit. `pending` immediately after an update,\n`synced` once the change has been applied, `failed` if the change could\nnot be applied after retries."
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Last time this limit was modified."
        }
      }
    },
    "CardLimitSyncStatus": {
      "type": "string",
      "enum": [
        "pending",
        "synced",
        "failed"
      ]
    }
  }
}