Get customer

Get full customers details referring to their ID in an Ecwid store.

Q: How to find customer emails I can use for promotions?

Use the acceptMarketing filter when searching for orders / customers or when getting order / customer details. If it is set to true or null, you can use their email for promotions in your app or customization. If it's set to false – you cannot send promotional emails to that person.

Headers

NameTypeDescription
AuthorizationstringoAuth token with mandatory Bearer before it. Example: Bearer e***s0, where e***s0 should be replaced with your oAuth token.

Q: How can I specify what fields I want to receive in response?

Add responseFields query param, specifying field names you want to receive.
Example: ?responseFields=id,email,taxId

Response

A JSON object of type 'Customer' with the following fields:

Customer

FieldTypeDescription
idnumberUnique internal customer ID
emailstringCustomer email
registeredstringRegistration date, e.g 2014-06-06 18:57:19 +0400
updatedstringLast updated date, e.g 2014-06-06 18:57:19 +0400
customerGroupIdnumberCustomer group ID
billingPersonPersonCustomer's billing name/address
shippingAddressesArray<ShippingAddress>Customer address book items (deprecated for new instant site customer accounts)
contactsArray<Contacts>Customer's contact information
customerGroupNamestringCustomer group name
taxIdstringCustomer tax ID
taxIdValidbooleantrue if customer tax ID is valid, false otherwise
b2b_b2cstringOrder type: business-to-business (b2b) or business-to-consumer (b2c)
fiscalCodestringFiscal code of a customer
electronicInvoicePecEmailstringPEC email for invoices
electronicInvoiceSdiCodestringSDI code for invoices
taxExemptbooleantrue if customer is tax exempt, false otherwise. Learn more
acceptMarketingbooleantrue if customer has accepted email marketing and you can use their email for promotions. If value is false, you can't use this email for promotions
langstringCustomer's language code (based on the language of the storefront).
stats<Stats>Customer's statistical information

Person

FieldTypeDescription
namestringCustomer full name
companyNamestringCustomer company name
streetstringStreet
citystringCity
countryCodestringCountry code (2-letter code)
countryNamestringCountry name
postalCodestringPostal code (zip code)
stateOrProvinceCodestringState/province code
stateOrProvinceNamestringState/province name
phonestringPhone number

ShippingAddress

FieldTypeDescription
idnumberInternal address ID
namestringCustomer full name
companyNamestringCustomer company name
streetstringStreet
citystringCity
countryCodestringCountry (2-digits code)
countryNamestringCountry name
postalCodestringPostal code (zip code)
stateOrProvinceCodestringState/province code
stateOrProvinceNamestringState/province name
phonestringPhone number

Contacts

FieldTypeDescription
idnumberUnique contact Id
contactstringCustomer's contact data (email, phone, etc)
typestringType of contact data. Values: EMAIL, PHONE, WHATSAPP, TELEGRAM, VIBER, FACEBOOK, INSTAGRAM, TWITTER, TIKTOK, URL, OTHER
handlestringShort customer's id for social contacts
defaultbooleantrue if the contact is primary (default). Only one contact of each type (EMAIL, PHONE) can be default.
notestringMerchant's comments about a contact
orderBynumberSort position
timestampstringDate of creating/updating the contact

Stats

FieldTypeDescription
numberOfOrdersnumberNumber of customer orders in the store
salesValuenumberTotal revenue received from the customer
averageOrderValuenumberAverage revenue received from the customer
firstOrderDatestringDate the customer placed the first order in the store
lastOrderDatestringDate the customer placed the latest order in the store

Errors

In case of error, Ecwid responds with an error HTTP status code and, optionally, JSON-formatted body containing error description

HTTP codes

HTTP StatusMeaning
404Customer is not found
500Cannot retrieve the customer info because of an error on the server

Error response body (optional)

FieldTypeDescription
errorMessagestringError message
Language
Authorization
Query