POST /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.
Servers
- https://connect.squareup.com
Path parameters
Name | Type | Required | Description |
---|---|---|---|
customer_id |
String | Yes |
The Square ID of the customer profile the card is linked to. |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
cardholder_name |
String | No |
The full name printed on the credit card. |
verification_token |
String | No |
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. |
card_nonce |
String | Yes |
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. |
billing_address |
Object | No |
Represents a postal address in a country. The address format is based
on an open-source library from Google. For more information,
see AddressValidationMetadata.
This format has dedicated fields for four address components: postal code,
locality (city), administrative district (state, prefecture, or province), and
sublocality (town or village). These components have dedicated fields in the
For the remaining address components, the Note that, in the current implementation, all other When it comes to localization, the seller's language preferences (see Language preferences) are ignored for addresses. Even though Square products (such as Square Point of Sale and the Seller Dashboard) mostly use a seller's language preference in communication, when it comes to addresses, they will use English for a US address, Japanese for an address in Japan, and so on. |
billing_address.address_line_3 |
String | No |
The third line of the address, if any. |
billing_address.first_name |
String | No |
Optional first name when it's representing recipient. |
billing_address.postal_code |
String | No |
The address's postal code. |
billing_address.organization |
String | No |
Optional organization name when it's representing recipient. |
billing_address.address_line_2 |
String | No |
The second line of the address, if any. |
billing_address.address_line_1 |
String | No |
The first line of the address. Fields that start with |
billing_address.administrative_district_level_3 |
String | No |
A civil entity within the address's |
billing_address.sublocality_2 |
String | No |
A civil region within the address's |
billing_address.administrative_district_level_2 |
String | No |
A civil entity within the address's |
billing_address.locality |
String | No |
The city or town of the address. |
billing_address.sublocality |
String | No |
A civil region within the address's |
billing_address.last_name |
String | No |
Optional last name when it's representing recipient. |
billing_address.administrative_district_level_1 |
String | No |
A civil entity within the address's country. In the US, this is the state. |
billing_address.sublocality_3 |
String | No |
A civil region within the address's |
billing_address.country |
String | No |
The address's country, in ISO 3166-1-alpha-2 format. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.