• Example searches: “transaction”, “CreateOrder”, “/v2/locations”, “inventory”, “delete customer”

You are viewing an old version of the API
Create customer

POST /v2/customers

Creates a new customer for a business, which can have associated cards on file.

You must provide at least one of the following values in your request to this endpoint:

  • given_name
  • family_name
  • company_name
  • email_address
  • phone_number

Permissions
CUSTOMERS_WRITE
Guide
Create a customer profile
Try in API Explorer
Name Description
idempotency_key
string

The idempotency key for the request. See the Idempotency guide for more information.

given_name
string

The given (i.e., first) name associated with the customer profile.

family_name
string

The family (i.e., last) name associated with the customer profile.

company_name
string

A business name associated with the customer profile.

nickname
string

A nickname for the customer profile.

email_address
string

The email address associated with the customer profile.

address
Address

The physical address associated with the customer profile.

phone_number
string

The 11-digit phone number associated with the customer profile.

reference_id
string

An optional, second ID used to associate the customer profile with an entity in another system.

note
string

A custom note associated with the customer profile.

birthday
string

The birthday associated with the customer profile, in RFC 3339 format. Year is optional, timezone and times are not allowed. For example: 0000-09-01T00:00:00-00:00 indicates a birthday on September 1st. 1998-09-01T00:00:00-00:00 indications a birthday on September 1st 1998.

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

customer
Customer

The created customer.

Examples

You are viewing an old version of the API
POST /v2/customers
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
  • Node.js
curl https://connect.squareup.com/v2/customers \
  -X POST \
  -H 'Square-Version: 2021-03-17' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "given_name": "Amelia",
    "family_name": "Earhart",
    "email_address": "Amelia.Earhart@example.com",
    "address": {
      "address_line_1": "500 Electric Ave",
      "address_line_2": "Suite 600",
      "locality": "New York",
      "administrative_district_level_1": "NY",
      "postal_code": "10003",
      "country": "US"
    },
    "phone_number": "1-212-555-4240",
    "reference_id": "YOUR_REFERENCE_ID",
    "note": "a customer"
  }'
Response JSON
{
  "customer": {
    "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4",
    "created_at": "2016-03-23T20:21:54.859Z",
    "updated_at": "2016-03-23T20:21:54.859Z",
    "given_name": "Amelia",
    "family_name": "Earhart",
    "email_address": "Amelia.Earhart@example.com",
    "address": {
      "address_line_1": "500 Electric Ave",
      "address_line_2": "Suite 600",
      "locality": "New York",
      "administrative_district_level_1": "NY",
      "postal_code": "10003",
      "country": "US"
    },
    "phone_number": "1-212-555-4240",
    "reference_id": "YOUR_REFERENCE_ID",
    "note": "a customer"
  }
}

Share Feedback

Thanks for visiting the Square API documentation. What's on your mind?