v1

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

CreateCard

Adds a card on file to an existing merchant.

post/v2/cards

Request body

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

source_idstring required

The ID of the source which represents the card information to be stored. This can be a card nonce or a payment id.

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.

See the SCA Overview.

Example request

{
  "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"
}

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"
    },
    "bin": "411111",
    "card_brand": "VISA",
    "card_type": "CREDIT",
    "cardholder_name": "Amelia Earhart",
    "customer_id": "VDKXEEKPJN48QDG3BGGFAK05P8",
    "enabled": true,
    "exp_month": 11,
    "exp_year": 2022,
    "fingerprint": "ex-p-cs80EK9Flz7LsCMv-szbptQ_ssAGrhemzSTsPFgt9nzyE6t7okiLIQc-qw_quqKX4Q",
    "hsa_fsa": false,
    "id": "ccof:uIbfJXhXETSP197M3GB",
    "last_4": "1111",
    "merchant_id": "6SSW7HV8K2ST5",
    "prepaid_type": "NOT_PREPAID",
    "reference_id": "user-id-1",
    "version": 1
  }
}