<- Cards API

Cards API

Create card

POST

 /v2/cards

Adds a card on file to an existing merchant.

Permissions:PAYMENTS_WRITE
Try in API Explorer
Link to section

Request body

Example code

Link to section

idempotency_key

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.

Link to section

source_id

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.

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.

See the SCA Overview.

Link to section

card

Required

Payment details associated with the card to be stored.

Link to section

Response fields

Link to section

errors

Errors resulting from the request.

Link to section

card

The card created by the request.

Error descriptions