<- Customers API

Customers API

All versions ->

Create customer card

DEPRECATED

 /v2/customers/{customer_id}/cards

Adds a card on file to an existing customer.

As with charges, calls to CreateCustomerCard are idempotent. Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the first call.

Permissions:CUSTOMERS_WRITE

Deprecation date

2021-06-16

Replaced by

CreateCard

Migration guide
Link to section

Path parameters

Example code

Link to section

customer_id

string

Required

The Square ID of the customer profile the card is linked to.

Link to section

Request body

Link to section

card_nonce

string

Required

A card nonce representing the credit card to link to the customer.

Card nonces are generated by the Square payment form when customers enter their card information. For more information, see Walkthrough: Integrate Square Payments in a Website.

NOTE: Card nonces generated by digital wallets (such as Apple Pay) cannot be used to create a customer card.

Link to section

billing_address

Address information for the card on file.

NOTE: If a billing address is provided in the request, the CreateCustomerCardRequest.billing_address.postal_code must match the postal code encoded in the card nonce.

Link to section

cardholder_name

string

The full name printed on the credit card.

Link to section

verification_token

string

An identifying token generated by Payments.verifyBuyer(). Verification tokens encapsulate customer device information and 3-D Secure challenge results to indicate that Square has verified the buyer identity.

Link to section

Response fields

Link to section

errors

Any errors that occurred during the request.

Link to section

card

The created card on file.

Error descriptions