Creates a card from the source (nonce, payment id, etc). Accessible via HTTP requests at POST https://connect.squareup.com/v2/cards
CreateCardRequest
Name | Type | Tags | Description |
---|---|---|---|
idempotencyKey |
string |
Required | A unique string that identifies this CreateCard request. Keys can be any valid string and must be unique for every request. Max: 45 characters See Idempotency keys for more information. Constraints: Minimum Length: 1 |
sourceId |
string |
Required | The ID of the source which represents the card information to be stored. This can be a card nonce or a payment id. Constraints: Minimum Length: 1 , Maximum Length: 16384 |
verificationToken |
string | undefined |
Optional | 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. See the SCA Overview. |
card |
Card |
Required | 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. |
{
"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"
},
"cardholder_name": "Amelia Earhart",
"customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8",
"reference_id": "user-id-1"
},
"idempotency_key": "4935a656-a929-4792-b97c-8848be85c27c",
"source_id": "cnon:uIbfJXhXETSP197M3GB"
}