{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-customer-payment-instrument-schema.json",
  "title": "CustomerPaymentInstrument",
  "description": "Method for customers to pay for the goods purchased on an ecommerce site. Payment methods include - credit card, debit card, bank account, and gift card.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-shopper-customers-api-openapi.yml#/components/schemas/CustomerPaymentInstrument",
  "type": "object",
  "properties": {
    "bankRoutingNumber": {
      "maxLength": 256,
      "type": "string",
      "description": "The bank routing number."
    },
    "creationDate": {
      "type": "string",
      "description": "Returns the value of attribute 'creationDate'.",
      "format": "date-time"
    },
    "lastModified": {
      "type": "string",
      "description": "Returns the value of attribute 'lastModified'.",
      "format": "date-time"
    },
    "maskedGiftCertificateCode": {
      "type": "string",
      "description": "The masked gift certificate code."
    },
    "paymentCard": {
      "allOf": [
        {
          "$ref": "#/$defs/PaymentCard"
        }
      ],
      "description": "The payment card."
    },
    "paymentInstrumentId": {
      "type": "string",
      "description": "The payment instrument ID."
    },
    "paymentMethodId": {
      "maxLength": 256,
      "type": "string",
      "description": "The payment method ID. Optional if a customer payment instrument ID is specified."
    },
    "default": {
      "type": "boolean",
      "description": "The default payment instrument."
    }
  },
  "$defs": {
    "PaymentCard": {
      "additionalProperties": false,
      "description": "Document representing a payment card.",
      "type": "object",
      "properties": {
        "cardType": {
          "maxLength": 256,
          "description": "The payment card type.",
          "type": "string"
        },
        "creditCardExpired": {
          "description": "A flag indicating if the credit card is expired. It is read only.",
          "type": "boolean"
        },
        "creditCardToken": {
          "description": "A credit card token. If a credit card is tokenized, the token can be used to look up the credit card data\nin the token store.",
          "type": "string"
        },
        "expirationMonth": {
          "format": "int32",
          "description": "The month when the payment card expires.",
          "type": "integer"
        },
        "expirationYear": {
          "format": "int32",
          "description": "The year when the payment card expires.",
          "type": "integer"
        },
        "holder": {
          "maxLength": 256,
          "description": "The payment card holder.",
          "type": "string"
        },
        "issueNumber": {
          "maxLength": 256,
          "description": "The payment card issue number.",
          "type": "string"
        },
        "maskedNumber": {
          "maxLength": 4000,
          "description": "The masked payment card number.",
          "type": "string"
        },
        "numberLastDigits": {
          "maxLength": 4000,
          "description": "The last digits of the payment card number. It is read only.",
          "type": "string"
        },
        "validFromMonth": {
          "minimum": 1,
          "maximum": 12,
          "format": "int32",
          "description": "The month the payment card is valid from.",
          "type": "integer"
        },
        "validFromYear": {
          "format": "int32",
          "description": "The year the payment card is valid from.",
          "type": "integer"
        }
      }
    }
  }
}