Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 1.99 KB

create-card-request.md

File metadata and controls

41 lines (32 loc) · 1.99 KB

Create Card Request

Creates a card from the source (nonce, payment id, etc). Accessible via HTTP requests at POST https://connect.squareup.com/v2/cards

Structure

CreateCardRequest

Fields

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.

Example (as JSON)

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