Get customer

GET https://app.ecwid.com/api/v3/{storeId}/customers/{customerId}

Request and response example

Request:

GET /api/v3/1003/customers/177737165 HTTP/1.1
Authorization: Bearer secret_token
Host: app.ecwid.com

Response:

{
  "id": 177737165,
  "name": "Support team",
  "email": "[email protected]",
  "registered": "2021-12-21 06:05:58 +0000",
  "updated": "2024-06-04 21:15:10 +0000",
  "customerGroupId": 0,
  "customerGroupName": "General",
  "billingPerson": {
    "name": "Support team",
    "firstName": "Support",
    "lastName": "team"
  },
  "shippingAddresses": [],
  "contacts": [
    {
      "id": 113861381,
      "contact": "[email protected]",
      "type": "EMAIL",
      "default": true,
      "orderBy": 0,
      "timestamp": "2024-06-04 21:15:10 +0000"
    }
  ],
  "taxExempt": false,
  "taxId": "",
  "taxIdValid": true,
  "b2b_b2c": "b2c",
  "fiscalCode": "",
  "electronicInvoicePecEmail": "",
  "electronicInvoiceSdiCode": "",
  "acceptMarketing": false,
  "stats": {
    "numberOfOrders": 0,
    "salesValue": 0,
    "averageOrderValue": 0
  },
  "privateAdminNotes": "",
  "favorites": []
}

Required access scopes

Your app must have the following access scopes to make this request: read_customers

Path params

All path params are required.

Param
Type
Description

storeId

number

Ecwid store ID.

customerId

number

Internal customer ID.

Query params

All query params are optional.

Name
Type
Description

responseFields

string

Specify the exact fields to receive in response JSON. If not specified, the response JSON will have all available fields for the entity. Example: ?responseFields=id,name,email

Example of using responseFields param:

curl --location 'https://app.ecwid.com/api/v3/1003/customers/177737165?responseFields=id,name,email' \
--header 'Authorization: Bearer secret_ab***cd'

Headers

The Authorization header is required.

Header
Format
Description

Authorization

Bearer secret_ab***cd

Access token of the application.

Response JSON

A JSON object with the following fields:

Field
Type
Description

id

number

Unique internal customer ID.

email

string

Customer's email.

registered

string

Customer's registration datetime, for example, 2014-06-06 18:57:19 +0400

updated

string

Datetime of the latest update of customer's details, for example, 2014-06-06 18:57:19 +0400

billingPerson

Customer's billing name/address.

shippingAddresses

array of objects shippingAddresses

List of saved shipping addresses for the customer.

contacts

array of objects contacts

Customer's contact information: email, phone, social media links.

customerGroupName

string

Name of the customer group the customer is assigned to.

customerGroupId

number

ID of the customer group the customer is assigned to.

b2b_b2c

string

Defines business-to-customer relation. One of: b2c - Business-to-customer (default) b2b - Business-to-business

taxId

string

Customer's tax ID.

taxIdValid

boolean

Defines if customer's tax ID is valid.

taxExempt

boolean

Defines if customer is tax exempt. Requires a valid tax ID. Read more about handling tax exempt customers in Help Center.

acceptMarketing

boolean

Defines if the customer has accepted email marketing. If true, you can use customer's email for promotions.

lang

string

Customer's language code. Customers see storefront and emails in this language. This language must be one of the translations enabled in the store.

stats

object stats

Customer's sales stats: number of orders, total revenue, first order date, etc.

privateAdminNotes

string

Personal notes about the customer. Visible only to the store owner.

favorites

array of objects favorites

List of customer's favorite products.

billingPerson

Field
Type
Description

name

string

Full name of the customer.

firstName

string

First name of the customer. Only shows when the name field has at least two words.

lastName

string

Last name of the customer. Only shows when the name field has at least two words.

companyName

string

Customer's company name.

street

string

Address line 1 and address line 2, separated by \n.

city

string

City.

countryCode

string

Two-letter country code.

countryName

string

Country name.

postalCode

string

Postal/ZIP code.

stateOrProvinceCode

string

State/province code, for example, NY.

stateOrProvinceName

string

State/province name.

phone

string

Customer's phone number.

shippingAddresses

Field
Type
Description

id

number

Internal ID of the saved address.

name

string

Full name of the customer.

companyName

string

Customer's company name.

street

string

Address line 1 and address line 2, separated by \n.

city

string

City.

countryCode

string

Two-letter country code.

countryName

string

Country name.

postalCode

string

Postal/ZIP code.

stateOrProvinceCode

string

State/province code, for example, NY.

stateOrProvinceName

string

State/province name.

phone

string

Customer's phone number.

addressFormatted

string

Formatted full address. Includes street, city, state, and country names.

contacts

Field
Type
Description

contact

string

Email or link to reach the contact. Examples:

  • [email protected] contact for EMAIL type.

  • https://www.facebook.com/myshop_page contact for FACEBOOK type.

Required

handle

string

Contact identifier on social media. For example, for FACEBOOK type of contact, it's a page slug: contact field: https://www.facebook.com/myshop_page handle field: myshop_page

note

string

Store owner's notes on the contact.

type

string

Contact type. Customer can have several contacts of the same type. One of:

EMAIL, PHONE, FACEBOOK, INSTAGRAM, TWITTER, YOUTUBE, TIKTOK, PINTEREST, VK, FB_MESSENGER, WHATSAPP, TELEGRAM, VIBER, URL, OTHER. Required

default

boolean

Defines if it's a default customer contact. Only one contact of the same type can be default.

orderBy

boolean

Sorting order for contacts on the customer details page. Starts with 0 and increments by 1.

timestamp

string

Datetime when the customer contact was created.

stats

Field
Type
Description

numberOfOrders

number

Count of customer's orders in the store.

salesValue

number

Total cost of orders placed by the customer.

averageOrderValue

number

Average total of orders placed by the customer.

firstOrderDate

string

Date the customer placed their first order.

lastOrderDate

string

Date the customer placed their last order.

favorites

Field
Type
Description

productId

number

Internal ID of the favorited product, for example, 689454040

addedTimestamp

string

Datetime when the product was added to favorites, favorites 2024-09-11 06:43:02 +0000

Last updated

Was this helpful?