{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/divvy/json-schema/divvy-card-response-dto-schema.json",
  "title": "CardResponseDto",
  "description": "Cards response.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/divvy-cards-api-openapi.yml#/components/schemas/CardResponseDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "BILL-generated ID of the card",
      "deprecated": true
    },
    "uuid": {
      "type": "string",
      "description": "BILL-generated UUID of the card"
    },
    "name": {
      "type": "string",
      "description": "Card name"
    },
    "userId": {
      "type": "string",
      "description": "BILL-generated ID of the user linked with the card",
      "deprecated": true
    },
    "userUuid": {
      "type": "string",
      "description": "BILL-generated UUID of the user linked with the card"
    },
    "budgetId": {
      "type": "string",
      "description": "BILL-generated ID of the budget linked with the card",
      "deprecated": true
    },
    "budgetUuid": {
      "type": "string",
      "description": "BILL-generated UUID of the budget linked with the card"
    },
    "lastFour": {
      "type": "string",
      "description": "Last four digits of the card number"
    },
    "validThru": {
      "type": "string",
      "description": "BILL-generated card expiration date. The value is in the `MM/YY` format.\n\n**Note**: Use the `validThru` value as the expiration date in a card payment. Do not use the `expirationDate` value for this operation."
    },
    "expirationDate": {
      "type": "string",
      "description": "User-generated card expiration date. This value is in the `yyyy-MM-dd` format. BILL automatically closes the card account on this date.\n\n**Note**: Use the `validThru` value as the expiration date in a card payment. Do not use the `expirationDate` value for this operation.",
      "format": "date"
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/CardStatus"
        },
        {
          "description": "Card status."
        }
      ]
    },
    "deletedReason": {
      "allOf": [
        {
          "$ref": "#/$defs/DeletedReasonType"
        },
        {
          "description": "Delete card reason. This field is available in the response only when `status` is `DELETED`."
        }
      ]
    },
    "type": {
      "allOf": [
        {
          "$ref": "#/$defs/CardType"
        },
        {
          "description": "Card type."
        }
      ]
    },
    "shareBudgetFunds": {
      "type": "boolean",
      "description": "Set as `true` to share all the budget funds with the card. This option enables the card user to spend from unallocated budget funds when the allocation is empty."
    },
    "recurring": {
      "type": "boolean",
      "description": "Set as `true` to renew the card funds in the next budget period"
    },
    "recurringLimit": {
      "type": "number",
      "description": "Card spend limit for the all future budget periods"
    },
    "currentPeriod": {
      "allOf": [
        {
          "$ref": "#/$defs/CardCurrentPeriodDto"
        },
        {
          "description": "Current budget period information about the card"
        }
      ]
    },
    "createdTime": {
      "type": "string",
      "description": "Created date and time",
      "format": "date-time"
    },
    "updatedTime": {
      "type": "string",
      "description": "Updated date and time",
      "format": "date-time"
    }
  },
  "$defs": {
    "CardCurrentPeriodDto": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "number",
          "description": "Card spend limit for the current budget period"
        },
        "spent": {
          "type": "number",
          "description": "Amount spent with the card for the current budget period"
        }
      },
      "description": "DTO representing card values relevant to the current budget period."
    },
    "CardStatus": {
      "type": "string",
      "description": "CardStatus.",
      "enum": [
        "ACTIVATED",
        "NOT_ACTIVATED",
        "FROZEN",
        "DELETED"
      ]
    },
    "CardType": {
      "type": "string",
      "description": "CardType.",
      "enum": [
        "PHYSICAL",
        "VIRTUAL_MEMBER",
        "VIRTUAL_VENDOR",
        "VIRTUAL"
      ]
    },
    "DeletedReasonType": {
      "type": "string",
      "description": "DeletedReasonType.",
      "enum": [
        "CANCELLED",
        "LOST",
        "STOLEN",
        "MISPLACED",
        "FRAUD_CONFIRMED",
        "SUPERSEDED_BY_NEW_ORDER"
      ]
    }
  }
}