Square: Disable Card
Square cards.disableCard: arguments, response, policy and SDK examples.
← Cards operations · Get started
Operation square.disablecard
Provider route: POST /v2/cards/{card_id}/disable. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/square with npm, or alter-sdk-square with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { SquareIntegration } from "@alter-ai/square";
async function execute(input: Parameters<SquareIntegration["cards"]["disableCard"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new SquareIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.cards.disableCard(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_square import SquareIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = SquareIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.cards.disable_card(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.card_id | string | Required within parent |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Disable Card — response body |
Referenced models: Disable Card — response body
Schemas
Section titled “Schemas”2 more schemas are linked from the tables above, on the schema pages.
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
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
Get Shift — response body — errors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an error encountered during a request to the Connect API. See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information. |
category | string | Required within parent | Indicates which high-level category of error has occurred during a request to the Connect API. The high-level category for the error. See [ErrorCategory](#type-errorcategory) for possible values Known values: API_ERROR, AUTHENTICATION_ERROR, INVALID_REQUEST_ERROR, RATE_LIMIT_ERROR, PAYMENT_METHOD_ERROR, REFUND_ERROR, MERCHANT_SUBSCRIPTION_ERROR, EXTERNAL_VENDOR_ERROR |
code | Model | Required within parent | Expand Get Shift — response body — errors item code The specific code of the error. See [ErrorCode](#type-errorcode) for possible values |
detail | string | Optional | A human-readable description of the error for debugging purposes. |
field | string | Optional | The name of the field provided in the original request (if any) that the error pertains to. |
Referenced models: Get Shift — response body — errors item code
Create Location — response body — location country
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | Indicates the country associated with another entity, such as a business. Values are in [ISO 3166-1-alpha-2 format](http://www.iso.org/iso/home/standards/country_codes.htm). Known values: ZZ, AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, YE, YT, ZA, ZM, ZW |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.disablecard. Catalog operation: DisableCard. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["PAYMENTS_WRITE"]
Pinned headers: {"Square-Version": "2026-11-18"}