Customers

  • Create customer card

  • Delete customer card

Development
  • Guides
  • API Reference
  • API Explorer
  • SDKs
  • Sample apps
  • System status
Support
  • Developer forums
  • Developer blog
  • YouTube
  • X
More
  • Square Home
  • Square Developer
  • App Marketplace
  • Partner with Square
  • Solutions Partner Program
  • Pricing
  • Sales

© 2026 Square, Inc.

  • Developer terms of service
  • Developer Integration and Marketing Agreement
  • Privacy policy
  • Partnerships
  • Sign In
  • Sign In

<- 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

Guide

Manage cards on file

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.

Link to section

Examples

All versions ->

POST /v2/customers/{customer_id}/cards
curl https://connect.squareup.com/v2/customers/customer_id0/cards \ -X POST \ -H 'Square-Version: 2026-11-18' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "card_nonce": "YOUR_CARD_NONCE", "billing_address": { "address_line_1": "500 Electric Ave", "address_line_2": "Suite 600", "locality": "New York", "administrative_district_level_1": "NY", "postal_code": "10003", "country": "US" }, "cardholder_name": "Amelia Earhart" }'

Response JSON

{ "card": { "id": "icard-card_id", "card_brand": "VISA", "last_4": "1111", "exp_month": 11, "exp_year": 2018, "cardholder_name": "Amelia Earhart", "billing_address": { "address_line_1": "500 Electric Ave", "address_line_2": "Suite 600", "locality": "New York", "administrative_district_level_1": "NY", "postal_code": "10003", "country": "US" } } }

Error descriptions

400 Bad request

{ "errors": [ { "code": "CARD_EXPIRED", "category": "PAYMENT_METHOD_ERROR" } ] }