Customer

Version 2019-10

The Customer resource stores information about a shop's customers, such as their contact details, their order history, and whether they've agreed to receive email marketing.

The Customer resource also holds information on the status of a customer's account. Customers with accounts save time at checkout when they're logged in because they don't need to enter their contact information. You can use the Customer API to check whether a customer has an active account, and then invite them to create one if they don't.

For security reasons, the Customer resource doesn't store credit card information. Customers always need to enter this information at checkout.

In a shop's checkout settings, there are three options for customer accounts:

  • Accounts are disabled: Customers can't create accounts and can check out only as guests.
  • Accounts are optional: Customers have the choice of either signing into their account or checking out as a guest. Customers can create accounts for themselves, and the shop owner can create an account for a customer and then invite them by email to use it.
  • Accounts are required: Customers can't check out unless they're logged in, and the shop owner must create their accounts.

What you can do with Customer

The Shopify API lets you do the following with the Customer resource. More detailed versions of these general actions may be available:

Customer properties

accepts_marketing
"accepts_marketing": false

Whether the customer has consented to receive marketing material via email.

accepts_marketing_updated_at
"accepts_marketing_updated_at": "2013-06-27T08:48:27-04:00"

The date and time (ISO 8601 format) when the customer consented or objected to receiving marketing material by email. Set this value whenever the customer consents or objects to marketing materials.

addresses
"addresses": [
  {
    "id": 207119551,
    "customer_id": 6940095564,
    "first_name": "Bob",
    "last_name": "Norman",
    "company": null,
    "address1": "Chestnut Street 92",
    "address2": "Apartment 2",
    "city": "Louisville",
    "province": "Kentucky",
    "country": "United States",
    "zip": "40202",
    "phone": "555-625-1199",
    "province_code": "KY",
    "country_code": "US",
    "country_name": "United States",
    "default": true
  }
]

A list of the ten most recently updated addresses for the customer. Each address has the following properties:

  • address1: The customer's mailing address.
  • address2: An additional field for the customer's mailing address.
  • city: The customer's city, town, or village.
  • company: The customer's company.
  • country: The customer's country.
  • country_code: The two-letter country code corresponding to the customer's country.
  • country_name: The customer's normalized country name.
  • customer_id: A unique identifier for the customer.
  • default: Whether this address is the default address for the customer.
  • first_name: The customer's first name.
  • id: A unique identifier for the address.
  • last_name: The customer's last name.
  • name: The customer's first and last names.
  • phone: The customer's phone number at this address.
  • province: The customer's region name. Typically a province, a state, or a prefecture.
  • province_code: The code for the region of the address, such as the province, state, or district. For example QC for Quebec, Canada.
  • zip: The customer's postal code, also known as zip, postcode, Eircode, etc.

currency
read-only
"currency": "JPY"

The three-letter code (ISO 4217 format) for the currency that the customer used when they paid for their last order. Defaults to the shop currency. Returns the shop currency for test orders.

created_at
read-only
"created_at": "2013-06-27T08:48:27-04:00"

The date and time (ISO 8601 format) when the customer was created.

default_address
read-only
"default_address": {
  "address1": "Chestnut Street 92",
  "address2": "Apartment 2"