{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/evictionsapi-com/json-schema/evictionsapi-com-card-schema.json",
  "title": "Card",
  "description": "One of the organization's saved cards for the automatic charges of full-service cases, in the key's mode. The card number is never stored: only its brand and last four. A case is charged to the card it names (`paymentMethodId`), else to the default card. `failed`: the card was declined; it is not charged again, and cannot be made the default.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/evictionsapi-com-payment-methods-api-openapi.yml#/components/schemas/Card",
  "type": "object",
  "required": [
    "id",
    "brand",
    "lastFour",
    "status",
    "label",
    "isDefault",
    "addedBy",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "brand": {
      "type": [
        "string",
        "null"
      ]
    },
    "lastFour": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "enum": [
        "usable",
        "failed"
      ]
    },
    "label": {
      "type": [
        "string",
        "null"
      ],
      "description": "What the organization calls the card, such as \"Operating account card\"; null when unnamed."
    },
    "isDefault": {
      "type": "boolean",
      "description": "The card charged when a case names none. One card per mode at most."
    },
    "addedBy": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "description": "The person who added it; null for a card added with an API key, or before this was kept."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}