Search customers

Search customers by a keyword or basic filters: number of orders made, name, email, customer group and more.

Request and response example

Request:

curl --location 'https://app.ecwid.com/api/v3/1003/customers' \
--header 'Authorization: Bearer secret_ab***cd'

Response:

{
    "total": 2,
    "count": 2,
    "offset": 0,
    "limit": 100,
    "items": [
        {
            "id": 177737165,
            "name": "Support team",
            "email": "[email protected]",
            "registered": "2021-12-21 06:05:58 +0000",
            "updated": "2024-06-04 21:15:10 +0000",
            "totalOrderCount": 0,
            "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": []
        },
        {
            "id": 277137633,
            "name": "test",
            "email": "[email protected]",
            "registered": "2024-08-21 07:52:09 +0000",
            "updated": "2024-08-21 07:52:09 +0000",
            "totalOrderCount": 0,
            "customerGroupId": 0,
            "customerGroupName": "General",
            "billingPerson": {
                "name": "test"
            },
            "shippingAddresses": [
                {
                    "id": 193416515,
                    "name": "test",
                    "companyName": "test",
                    "street": "test",
                    "city": "test",
                    "countryCode": "GE",
                    "countryName": "Georgia",
                    "stateOrProvinceCode": "TB",
                    "stateOrProvinceName": "Tbilisi",
                    "phone": "00000000000",
                    "createdDate": "2024-08-21 07:52:09 +0000",
                    "defaultAddress": true,
                    "orderBy": 0,
                    "addressFormatted": "test, test, test Tbilisi, Georgia"
                }
            ],
            "contacts": [
                {
                    "id": 176135453,
                    "contact": "00000000000",
                    "type": "PHONE",
                    "default": true,
                    "orderBy": 0,
                    "timestamp": "2024-08-21 07:52:09 +0000"
                },
                {
                    "id": 176135452,
                    "contact": "[email protected]",
                    "type": "EMAIL",
                    "default": true,
                    "orderBy": 0,
                    "timestamp": "2024-08-21 07:52:09 +0000"
                }
            ],
            "taxExempt": false,
            "taxId": "",
            "taxIdValid": true,
            "b2b_b2c": "b2c",
            "fiscalCode": "",
            "electronicInvoicePecEmail": "",
            "electronicInvoiceSdiCode": "",
            "lang": "en",
            "stats": {
                "numberOfOrders": 1,
                "salesValue": 97,
                "averageOrderValue": 97,
                "firstOrderDate": "2024-08-21 07:52:09 +0000",
                "lastOrderDate": "2024-08-21 07:52:09 +0000"
            },
            "privateAdminNotes": "",
            "favorites": []
        }
    ],
    "allCustomerCount": 2
}

Access scopes

Requires the following access scope: read_customers

Path params

ParamTypeDescription
storeIdnumberEcwid store ID.

Query params

All query params are optional.

ParamTypeDescription
namestringSearch term for customer name.
emailstringSearch term for customer email address.
keywordstringSearch term for both customer name and email. Special characters must be URI-encoded.
customerGroupnumberSearch by a single customer group ID, e.g. 123456.
customerGroupIdsnumberSearch by multiple customer group IDs, e.g. 123456,234567.
minOrderCountnumberSearch term for the minimum number of orders placed by customers.
maxOrderCountnumberSearch term for the maximum number of orders placed by customers.
minSalesValuenumberSearch term for the minimum total order value from orders placed by a customer.
maxSalesValuenumberSearch term for the maximum total order value from orders placed by a customer.
purchasedProductIdsnumberSearch by product IDs in orders placed by a customer.
countryCodesstringSet a list of country codes to find customers. Find available values in Dictionaries.
acceptMarketingbooleanSet true to search customers who accepted receiving marketing emails. Set false to find customers who rejected such emails.
b2b_b2cstringOrder type: business-to-business (b2b) or business-to-consumer (b2c)
electronicInvoicePecEmailstringSearch term for invoice PEC email.
electronicInvoiceSdiCodestringSearch term for invoice SDI code.
fiscalCodestringCustomer's Fiscale Code (only for Italy).
taxExemptbooleanSet true to search only for tax-exempt customers. Set false to search customers without tax exemption.
createdFromstringCustomer creation date/time (lower bound). Supported formats: UNIX timestamp, date/time. Examples: 1447804800, 2023-01-15 19:27:50
createdTostringCustomer creation date/time (upper bound). Supported formats: UNIX timestamp, date/time. Examples: 1447804800, 2023-01-15 19:27:50
updatedFromstringCustomer update date/time (lower bound). Supported formats: UNIX timestamp, date/time. Examples: 1447804800, 2023-01-15 19:27:50
updatedTostringCustomer update date/time (upper bound). Supported formats: UNIX timestamp, date/time. Examples: 1447804800, 2023-01-15 19:27:50
sortBystringSort order. Supported values: NAME_ASC, NAME_DESC, EMAIL_ASC, EMAIL_DESC, ORDER_COUNT_ASC, ORDER_COUNT_DESC, REGISTERED_DATE_DESC, REGISTERED_DATE_ASC, UPDATED_DATE_DESC, UPDATED_DATE_ASC, SALES_VALUE_ASC, SALES_VALUE_DESC, FIRST_ORDER_DATE_ASC, FIRST_ORDER_DATE_DESC, LAST_ORDER_DATE_ASC, LAST_ORDER_DATE_DESC.
offsetnumber
limitnumberMaximum number of returned items. Maximum and default value is 100.
responseFieldsstringLimit JSON response by specific fields. If specified, all missing fields will be removed from the response body.
Example: ?responseFields=total,items(id,name,email)

Example of using responseFields param:

curl --location 'https://app.ecwid.com/api/v3/1003/customers?responseFields=total,items(id,name,email)' \
--header 'Authorization: Bearer secret_ab***cd'
{
    "total": 2,
    "items": [
        {
            "id": 177737165,
            "name": "Support team",
            "email": "[email protected]"
        },
        {
            "id": 277137633,
            "name": "TEST",
            "email": "[email protected]"
        }
    ]
}

Headers

The Authorization header with a secret access token is required.

HeaderFormatDescription
AuthorizationBearer secret_ab***cdAccess token of the application.

Response

A JSON object with the following fields:

FieldTypeDescription
totalnumberThe total number of found items (might be more than the number of returned items)
countnumberThe number of returned items
offsetnumberOffset from the beginning of the returned items list (for paging)
limitnumberMaximum number of returned items. Maximum allowed value: 100. Default value: 100
itemsArray itemsDetailed information about found customers.
allCustomerCountnumberTotal count of unique customers in the store.

items

FieldTypeDescription
idnumberUnique internal customer ID.
emailstringCustomer email.
namestringCustomer full name.
totalOrderCountnumberCount of customer's orders.
registeredstringRegistration date, e.g 2014-06-06 18:57:19 +0400
updatedstringLast updated date, e.g 2014-06-06 18:57:19 +0400
billingPersonObject billingPersonCustomer's billing name/address
shippingAddressesArray shippingAddressesList of saved shipping addresses for the customer.
contactsArray contactsCustomer's contact information: email, phone, social media links.
customerGroupIdnumberCustomer group ID.
customerGroupNamestringCustomer group name.
taxIdstringCustomer tax ID.
taxIdValidbooleantrue if customer tax ID is valid, false otherwise
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).
statsObject statsCustomer's sales stats: number of orders, total revenue, first order date, etc.
privateAdminNotesstringPersonal notes about the customer. Visible only to the store owner.
favoritesArray favoritesList of customer's favorite products.

billingPerson

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

shippingAddresses

Array of objects, where each object contains the following fields:

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
addressFormattedstringFormatted full address. Includes street, city, state, and country names.

contacts

Array of objects, where each object contains the following fields:

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
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

favorites

FieldTypeDescription
productIdnumberID of the favorited product, e.g. 689454040
addedTimestampstringDatetime when the product was added to favorites, e.g. "2024-09-11 06:43:02 +0000"
Language
Click Try It! to start a request and see the response here!