{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ucp.dev/schemas/shopping/types/card_payment_instrument.json",
  "title": "Card Payment Instrument",
  "description": "A basic card payment instrument with visible card details. Can be inherited by a handler's instrument schema to define handler-specific display details or more complex credential structures.",
  "allOf": [
    {
      "$ref": "https://ucp.dev/schemas/shopping/types/payment_instrument_base.json"
    },
    {
      "type": "object",
      "required": [
        "type",
        "brand",
        "last_digits"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "card",
          "description": "Indicates this is a card payment instrument."
        },
        "brand": {
          "type": "string",
          "description": "The card brand/network (e.g., visa, mastercard, amex)."
        },
        "last_digits": {
          "type": "string",
          "description": "Last 4 digits of the card number."
        },
        "expiry_month": {
          "type": "integer",
          "description": "The month of the card's expiration date (1-12)."
        },
        "expiry_year": {
          "type": "integer",
          "description": "The year of the card's expiration date."
        },
        "rich_text_description": {
          "type": "string",
          "description": "An optional rich text description of the card to display to the user (e.g., 'Visa ending in 1234, expires 12/2025')."
        },
        "rich_card_art": {
          "type": "string",
          "format": "uri",
          "description": "An optional URI to a rich image representing the card (e.g., card art provided by the issuer)."
        }
      }
    }
  ]
}