Square: Cards schemas
7 Square schemas with complete fields and constraints.
← Cards operations · All schemas
Create Card — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Creates a card from the source (payment token or payment id). Accessible via HTTP requests at POST https://connect.squareup.com/v2/cards |
card | Model | Required within parent | Expand Create Card — request body — body card Payment details associated with the card to be stored. |
idempotency_key | string | Required within parent | A unique string that identifies this CreateCard request. Keys can be any valid string and must be unique for every request. Max: 45 characters See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information. Minimum length: 1 |
source_id | string | Required within parent | The ID of the source which represents the card information to be stored. This can be a card nonce or a payment id. Maximum length: 16384 Minimum length: 1 |
verification_token | string | Optional | An identifying token generated by [Payments.verifyBuyer()](https://developer.squareup.com/reference/sdks/web/payments/objects/Payments#Payments.verifyBuyer). Verification tokens encapsulate customer device information and 3-D Secure challenge results to indicate that Square has verified the buyer identity. See the [SCA Overview](https://developer.squareup.com/docs/sca-overview). |
Referenced models: Create Card — request body — body card
Create Card — request body — body card
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the payment details of a card to be used for payments. These details are determined by the payment token generated by Web Payments SDK. |
billing_address | JSON | Optional | |
billing_address (anyOf 1) | Model | Alternative | Expand Create Customer — request body — body address The billing address for this card. `US` postal codes can be provided as a 5-digit zip code or 9-digit ZIP+4 (example: `12345-6789`). For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-addresses). |
billing_address (anyOf 2) | null | Alternative | |
bin | string | Optional | The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API returns this field. Maximum length: 6 Read only: true |
card_brand | string | Optional | Indicates a card's brand, such as `VISA` or `MASTERCARD`. The card's brand. See [CardBrand](#type-cardbrand) for possible values One of: OTHER_BRAND, VISA, MASTERCARD, AMERICAN_EXPRESS, DISCOVER, DISCOVER_DINERS, JCB, CHINA_UNIONPAY, SQUARE_GIFT_CARD, SQUARE_CAPITAL_CARD, INTERAC, EFTPOS, FELICA, EBT, QUICPAY, ID, TRANSPORTATION_IC, CARNET Read only: true |
card_co_brand | string | Optional | Indicates the brand for a co-branded card. The card's co-brand if available. For example, an Afterpay virtual card would have a co-brand of AFTERPAY. See [CardCoBrand](#type-cardcobrand) for possible values One of: UNKNOWN, AFTERPAY, CLEARPAY Read only: true |
card_type | string | Optional | Indicates a card's type, such as `CREDIT` or `DEBIT`. The type of the card. The Card object includes this field only in response to Payments API calls. See [CardType](#type-cardtype) for possible values One of: UNKNOWN_CARD_TYPE, CREDIT, DEBIT Read only: true |
cardholder_name | JSON | Optional | |
cardholder_name (anyOf 1) | string | Alternative | The name of the cardholder. Maximum length: 96 |
cardholder_name (anyOf 2) | null | Alternative | |
created_at | string | Optional | Timestamp for when the card object was created on Square’s servers. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". Read only: true |
customer_id | JSON | Optional | |
customer_id (anyOf 1) | string | Alternative | **Required** The ID of a [customer](entity:Customer) to be associated with the card. |
customer_id (anyOf 2) | null | Alternative | |
disabled_at | string | Optional | Timestamp for when the card object was disabled on Square’s servers. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". Read only: true |
enabled | boolean | Optional | Indicates whether or not a card can be used for payments. Read only: true |
exp_month | JSON | Optional | |
exp_month (anyOf 1) | JSON | Alternative | |
exp_month (anyOf 1) (anyOf 1) | integer | Alternative | The expiration month of the associated card as an integer between 1 and 12. Format: int64 Minimum: -9223372036854775808 Maximum: 9223372036854775807 |
exp_month (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^(?:-(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-8]))))))))))))))))|-[1-9][0-9]{0,17}|0|(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-7]))))))))))))))))|[1-9][0-9]{0,17})$(?!\n) |
exp_month (anyOf 2) | null | Alternative | |
exp_year | JSON | Optional | |
exp_year (anyOf 1) | JSON | Alternative | |
exp_year (anyOf 1) (anyOf 1) | integer | Alternative | The four-digit year of the card's expiration date. Format: int64 Minimum: -9223372036854775808 Maximum: 9223372036854775807 |
exp_year (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^(?:-(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-8]))))))))))))))))|-[1-9][0-9]{0,17}|0|(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-7]))))))))))))))))|[1-9][0-9]{0,17})$(?!\n) |
exp_year (anyOf 2) | null | Alternative | |
fingerprint | string | Optional | Intended as a Square-assigned identifier, based on the card number, to identify the card across multiple locations within a single application. Maximum length: 255 Read only: true |
hsa_fsa | boolean | Optional | Indicates whether the card is linked to a Health Savings Account (HSA) or Flexible Spending Account (FSA), based on the card BIN. Read only: true |
id | string | Optional | Unique ID for this card. Generated by Square. Maximum length: 64 Read only: true |
issuer_alert | string | Optional | Indicates the type of issuer alert for a [card on file](entity:Card). An alert from the issuing bank about the card status. Alerts can indicate whether future charges to the card are likely to fail. For more information, see [Manage Card on File Declines](https://developer.squareup.com/docs/cards-api/manage-card-on-file-declines). This field is present only if there's an active issuer alert. See [IssuerAlert](#type-issueralert) for possible values One of: ISSUER_ALERT_CARD_CLOSED Read only: true |
issuer_alert_at | string | Optional | The timestamp of when the current issuer alert was received and processed, in RFC 3339 format. This field is present only if there's an active issuer alert. Read only: true |
last_4 | string | Optional | The last 4 digits of the card number. Maximum length: 4 Read only: true |
merchant_id | string | Optional | The ID of the merchant associated with the card. Read only: true |
prepaid_type | string | Optional | Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. Indicates whether the card is prepaid or not. See [CardPrepaidType](#type-cardprepaidtype) for possible values One of: UNKNOWN_PREPAID_TYPE, NOT_PREPAID, PREPAID Read only: true |
reference_id | JSON | Optional | |
reference_id (anyOf 1) | string | Alternative | An optional user-defined reference ID that associates this card with another entity in an external system. For example, a customer ID from an external customer management system. Maximum length: 128 |
reference_id (anyOf 2) | null | Alternative | |
version | JSON | Optional | |
version (anyOf 1) | integer | Alternative | Current version number of the card. Increments with each card update. Requests to update an existing Card object will be rejected unless the version in the request matches the current version for the Card. Format: int64 Minimum: -9223372036854775808 Maximum: 9223372036854775807 |
version (anyOf 2) | string | Alternative | Pattern: ^(?:-(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-8]))))))))))))))))|-[1-9][0-9]{0,17}|0|(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-7]))))))))))))))))|[1-9][0-9]{0,17})$(?!\n) |
Referenced models: Create Customer — request body — body address
Create Card — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields that are included in the response body of a request to the [CreateCard](api-endpoint:Cards-CreateCard) endpoint. Note: if there are errors processing the request, the card field will not be present. |
card | Model | Optional | Expand Create Card — response body — card The card created by the request. |
errors | array | Optional | Errors resulting from the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Card — response body — card, Get Shift — response body — errors item
Create Card — response body — card
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the payment details of a card to be used for payments. These details are determined by the payment token generated by Web Payments SDK. |
billing_address | JSON | Optional | |
billing_address (anyOf 1) | Model | Alternative | Expand Get Payment — response body — payment billing address The billing address for this card. `US` postal codes can be provided as a 5-digit zip code or 9-digit ZIP+4 (example: `12345-6789`). For a full list of field meanings by country, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/common-data-types/working-with-addresses). |
billing_address (anyOf 2) | null | Alternative | |
bin | string | Optional | The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API returns this field. Maximum length: 6 Read only: true |
card_brand | string | Optional | Indicates a card's brand, such as `VISA` or `MASTERCARD`. The card's brand. See [CardBrand](#type-cardbrand) for possible values Known values: OTHER_BRAND, VISA, MASTERCARD, AMERICAN_EXPRESS, DISCOVER, DISCOVER_DINERS, JCB, CHINA_UNIONPAY, SQUARE_GIFT_CARD, SQUARE_CAPITAL_CARD, INTERAC, EFTPOS, FELICA, EBT, QUICPAY, ID, TRANSPORTATION_IC, CARNET Read only: true |
card_co_brand | string | Optional | Indicates the brand for a co-branded card. The card's co-brand if available. For example, an Afterpay virtual card would have a co-brand of AFTERPAY. See [CardCoBrand](#type-cardcobrand) for possible values Known values: UNKNOWN, AFTERPAY, CLEARPAY Read only: true |
card_type | string | Optional | Indicates a card's type, such as `CREDIT` or `DEBIT`. The type of the card. The Card object includes this field only in response to Payments API calls. See [CardType](#type-cardtype) for possible values Known values: UNKNOWN_CARD_TYPE, CREDIT, DEBIT Read only: true |
cardholder_name | JSON | Optional | |
cardholder_name (anyOf 1) | string | Alternative | The name of the cardholder. Maximum length: 96 |
cardholder_name (anyOf 2) | null | Alternative | |
created_at | string | Optional | Timestamp for when the card object was created on Square’s servers. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". Read only: true |
customer_id | JSON | Optional | |
customer_id (anyOf 1) | string | Alternative | **Required** The ID of a [customer](entity:Customer) to be associated with the card. |
customer_id (anyOf 2) | null | Alternative | |
disabled_at | string | Optional | Timestamp for when the card object was disabled on Square’s servers. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z". Read only: true |
enabled | boolean | Optional | Indicates whether or not a card can be used for payments. Read only: true |
exp_month | JSON | Optional | |
exp_month (anyOf 1) | JSON | Alternative | |
exp_month (anyOf 1) (anyOf 1) | integer | Alternative | The expiration month of the associated card as an integer between 1 and 12. Format: int64 |
exp_month (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
exp_month (anyOf 2) | null | Alternative | |
exp_year | JSON | Optional | |
exp_year (anyOf 1) | JSON | Alternative | |
exp_year (anyOf 1) (anyOf 1) | integer | Alternative | The four-digit year of the card's expiration date. Format: int64 |
exp_year (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
exp_year (anyOf 2) | null | Alternative | |
fingerprint | string | Optional | Intended as a Square-assigned identifier, based on the card number, to identify the card across multiple locations within a single application. Maximum length: 255 Read only: true |
hsa_fsa | boolean | Optional | Indicates whether the card is linked to a Health Savings Account (HSA) or Flexible Spending Account (FSA), based on the card BIN. Read only: true |
id | string | Optional | Unique ID for this card. Generated by Square. Maximum length: 64 Read only: true |
issuer_alert | string | Optional | Indicates the type of issuer alert for a [card on file](entity:Card). An alert from the issuing bank about the card status. Alerts can indicate whether future charges to the card are likely to fail. For more information, see [Manage Card on File Declines](https://developer.squareup.com/docs/cards-api/manage-card-on-file-declines). This field is present only if there's an active issuer alert. See [IssuerAlert](#type-issueralert) for possible values Known values: ISSUER_ALERT_CARD_CLOSED Read only: true |
issuer_alert_at | string | Optional | The timestamp of when the current issuer alert was received and processed, in RFC 3339 format. This field is present only if there's an active issuer alert. Read only: true |
last_4 | string | Optional | The last 4 digits of the card number. Maximum length: 4 Read only: true |
merchant_id | string | Optional | The ID of the merchant associated with the card. Read only: true |
prepaid_type | string | Optional | Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. Indicates whether the card is prepaid or not. See [CardPrepaidType](#type-cardprepaidtype) for possible values Known values: UNKNOWN_PREPAID_TYPE, NOT_PREPAID, PREPAID Read only: true |
reference_id | JSON | Optional | |
reference_id (anyOf 1) | string | Alternative | An optional user-defined reference ID that associates this card with another entity in an external system. For example, a customer ID from an external customer management system. Maximum length: 128 |
reference_id (anyOf 2) | null | Alternative | |
version | JSON | Optional | |
version (anyOf 1) | integer | Alternative | Current version number of the card. Increments with each card update. Requests to update an existing Card object will be rejected unless the version in the request matches the current version for the Card. Format: int64 |
version (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Referenced models: Get Payment — response body — payment billing address
Disable Card — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields that are included in the response body of a request to the [DisableCard](api-endpoint:Cards-DisableCard) endpoint. Note: if there are errors processing the request, the card field will not be present. |
card | Model | Optional | Expand Create Card — response body — card The retrieved card. |
errors | array | Optional | Information on errors encountered during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Card — response body — card, Get Shift — response body — errors item
List Cards — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields that are included in the response body of a request to the [ListCards](api-endpoint:Cards-ListCards) endpoint. Note: if there are errors processing the request, the card field will not be present. |
cards | array | Optional | The requested list of `Card`s. |
cards[] | Model | Each item | Expand Create Card — response body — card |
cursor | string | Optional | The pagination cursor to be used in a subsequent request. If empty, this is the final response. See [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination) for more information. |
errors | array | Optional | Information on errors encountered during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Card — response body — card, Get Shift — response body — errors item
Retrieve Card — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines the fields that are included in the response body of a request to the [RetrieveCard](api-endpoint:Cards-RetrieveCard) endpoint. Note: if there are errors processing the request, the card field will not be present. |
card | Model | Optional | Expand Create Card — response body — card The retrieved card. |
errors | array | Optional | Information on errors encountered during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Card — response body — card, Get Shift — response body — errors item