Cards
Creates, updates, deletes, and retrieves customer‑linked or merchant‑linked cards in Square. Includes cardholder details, billing address, expiration dates, brand information, and card usage status.
Table Specific Information
Select
The component uses the Square API to process search criteria , while other filters are processed client side within the component.
Select all Cards:
SELECT * FROM Cards
Select a Card using its Id:
SELECT * FROM Cards WHERE Id = 'ccof:CA4SENQvtCYtXFkIKLHESty7dn0oAg';
Select all Cards from a specific customer:
SELECT * FROM Cards WHERE CustomerId = 'CBASEPlKoFeu4nWm0MX_oHdklAIgAQ'
Select all Cards matching a 'ReferenceId':
SELECT * FROM Cards WHERE ReferenceId = 'myrefid';
By default, only enabled cards are returned. To fetch disabled cards also, use the 'IncludeDisabled' pseudo-column:
SELECT * FROM Cards WHERE IncludeDisabled = true;
Insert
To create a card, you will need to specify CustomerId, IdempotencyKey and SourceId.
INSERT INTO Cards (IdempotencyKey, SourceId, CustomerId, BillingAddressAddressLine1, BillingAddressAddressLine2, BillingAddressLocality, BillingAddressPostalCode, BillingAddressCountry, CardholderName) VALUES ('aa8f236c-13a6-42fe-a17e-4edf6caa2035', 'fake-card-nonce-ok', 'CBASEPlKoFeu4nWm0MX_oHdklAIgAQ', '500 Electric Ave', 'Suite 600', 'New York', '94103', 'US', 'CardholderName')
Delete
Use the DELETE operation to disable a Card. Cards can be disabled using their Id.
DELETE FROM Cards WHERE Id = 'eKoFeu4nWm0MX_oed'
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
Unique Id for the card, generated by Square. |
| BillingAddressAddressLine1 | String | False |
The first line of the billing address. |
| BillingAddressAddressLine2 | String | False |
The second line of the address, if applicable. |
| BillingAddressAddressLine3 | String | False |
The third line of the address, if applicable. |
| BillingAddressAdministrativeDistrictLevel1 | String | False |
Top‑level administrative region in the billing address (for example, U.S. state). |
| BillingAddressCountry | String | False |
The address's country, in the two-letter format of ISO 3166. |
| BillingAddressLocality | String | False |
The city or town of the address. |
| BillingAddressSubLocality | String | False |
A civil region within the address's locality, if applicable. |
| BillingAddressPostalCode | String | False |
The address's postal code. |
| Bin | String | True |
The first six digits of the card number, known as the Bank Identification Number (BIN). |
| CardBrand | String | True |
The card's brand. |
| CardType | String | True |
Card classification, such as CREDIT or DEBIT. |
| CardholderName | String | False |
The name of the cardholder. |
| CustomerId | String | False |
The Id of a customer created using the Customers API to be associated with the card. |
| MerchantId | String | True |
The Id of the merchant associated with the card. |
| Enabled | Boolean | True |
Indicates whether or not a card can be used for payments. |
| ExpMonth | Integer | False |
The expiration month of the associated card as an integer between 1 and 12. |
| ExpYear | Integer | False |
The four-digit year of the card's expiration date. |
| Fingerprint | String | True |
The unique string fingerprint for the card. The fingerprint is based on the credit card number and is unique to the merchant. If a card is used at multiple locations for the same merchant, it will have the same fingerprint in each case. |
| Last4 | String | True |
The last 4 digits of the card number. |
| PrepaidType | String | True |
Indicates whether the card is prepaid or not. |
| ReferenceId | String | False |
An optional, user-defined reference Id that associates this card with another entity in an external system. |
| Version | Int64 | False |
Current version number of the card. |
| IdempotencyKey | String | False |
A unique string that identifies this CreateCard request. |
| SourceId | String | False |
The Id of the source which represents the card information to be stored. This can be a card nonce or a payment Id. |
| VerificationToken | String | False |
An identifying token generated by Payments.verifyBuyer(). |
| CardCoBrand | String | True |
Current version number of the card. |
| BillingAddressAdministrativeDistrictLevel2 | String | False |
A civil entity within the address's administrative_district_level_1. In the US, this is the county. |
| BillingAddressAdministrativeDistrictLevel3 | String | False |
A civil entity within the address's administrative_district_level_2, if applicable. |
| BillingAddressSubLocality2 | String | False |
A civil region within the address's sublocality, if applicable. |
| BillingAddressSubLocality3 | String | False |
A civil region within the address's sublocality_2, if applicable. |
| BillingAddressFirstName | String | False |
First name in the billing address. |
| BillingAddressLastName | String | False |
Last name in the billing address. |
| IssuerAlert | String | True |
An alert from the issuing bank about the card status. Alerts can indicate whether future charges to the card are likely to fail. |
| IssuerAlertAt | Datetime | True |
The timestamp of when the current issuer alert was received and processed. |
| HsaFsa | Boolean | True |
Indicates whether the card is linked to a Health Savings Account (HSA) or Flexible Spending Account (FSA), based on the card BIN. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements (unless stated otherwise) and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| IncludeDisabled | Boolean |
When set to true, includes disabled cards in query results. By default, only enabled cards are returned. |