v1

latestOpenAPI 3.0.0Apache 2.02026-07-143281,4552.1 MB
Customers

CreateCustomerCard

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.

post/v2/customers/{customer_id}/cards

Path parameters

customer_idstring required

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

Request body

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

cardholder_namestring

The full name printed on the credit card.

verification_tokenstring

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.

Example request

{
  "billing_address": {
    "address_line_1": "500 Electric Ave",
    "address_line_2": "Suite 600",
    "administrative_district_level_1": "NY",
    "country": "US",
    "locality": "New York",
    "postal_code": "10003"
  },
  "card_nonce": "YOUR_CARD_NONCE",
  "cardholder_name": "Amelia Earhart"
}

Response

Success

Example response

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