Search Customers
Function
To search customers with specific conditions.
利用特殊條件搜尋顧客列表。
URL
GET <<api_domain>>/v1/customers/search
Request parameters
Parameter | Type | Description | Example |
|---|---|---|---|
page |
| Page | |
per_page |
| Numbers of Orders per page | |
query |
| Support searching fields below: | |
name |
| Customer's Name
| |
id |
| Customer's ID | |
email |
| Customer's Email
| |
phones |
| Customer's Phone
| |
mobile_phone |
| Customer's Mobile Phone
| |
gender |
| Customer's Gender
| |
membership_tier_id |
| Membership Tier
| |
created_at |
| Filter customers by created time
| |
updated_at |
| Filter customers by created time
| |
registered_at |
| Filter customers by registered time
| |
birthday |
| Filter customers by birthday
| |
birth_month |
| Filter customers by birth month
| |
credit_balance |
| Filter customers by credit balance
| |
is_member |
| Filter member customers. | |
is_blacklisted |
| Filter Blacklisted Customers. | |
is_subscribed_marketing_email |
| Filter Customers by Marketing Acceptance. | |
ref_user_id |
| Third party custom customer id | |
NotePlease note the following pagination limitations when using this API:
- The request will fail if
page*per_pageexceeds 10,000.- Example: If
per_page= 50, the maximum value forpageshould be 200. Exceeding this value will result in an error.使用此 API 時,請注意以下分頁限制:
- 當
page*per_page大於 10,000 時,請求將會失敗。- 範例:如果
per_page= 50,page最大值應為 200,超過此值請求將會失敗。
Response fields
| Field | Type | Description | Example |
|---|---|---|---|
| items | Get Customer | Array of customer | Please check the link on the left |
| pagination | Pagination | Pagination Data | Please check the link on the left |
Request Example ( Normal Case)
curl -X GET \
'<<api_domain>>/v1/customers/search?page=1&per_page=30&query=shopline&is_member=' \
-H 'Accept: application/json' \
-H 'Authorization: Bearar {access_token}' \
-H 'User-Agent: shopline'Request Example ( Search by specific fields)
You can pass search_fields parameter to specify search fields.
curl --location --request GET '<<api_domain>>/v1/customers/search?query=1232&search_fields[]=phones&search_fields[]=mobile_phone' \
--header 'Authorization: Bearer ${access_token}'Response Example
JSON sample
{
"items": [
{
"id": "5ce0d084e388096bdb229a59",
"name": "joanne+m12",
"email": "[email protected]",
"gender": null,
"birthday": "1996-03-05",
"birth_year": 1996,
"birth_month": 3,
"birth_day": 5,
"phones": [],
"mobile_phone": "0922165898",
"mobile_phone_verified": true,
"mobile_phone_country_calling_code": "886",
"locale_code": "zh-hant",
"order_count": 0,
"orders_total_sum": {
"cents": 0,
"currency_symbol": "NT$",
"currency_iso": "TWD",
"label": "",
"dollars": 0.0
},
"is_member": true,
"is_blacklisted": false,
"is_subscribed_marketing_email": true,
"credit_balance": 150,
"custom_data": [],
"membership_tier": null,
"delivery_addresses": [],
"subscribed_email_types": [
"marketing.news"
],
"ref_user_id": null,
"line_id": null,
"updated_at": "2019-06-27T16:04:23.012+00:00",
"created_at": "2019-05-19T03:41:56.670+00:00",
"current_sign_in_at": "2019-05-19T03:42:33.096+00:00",
"last_sign_in_at": "2019-05-19T03:42:33.096+00:00",
"registered_at": "2019-05-19T03:41:56.403+00:00",
"registered_from_channel": {
"id": "5c135ad0e388097eb33d8ae4",
"name": {
"zh-hant": "高雄店"
},
"platform": "shop_crm",
"merchant_id": "5b457ad9e388095dcb000006",
"updated_at": "2019-01-21T04:14:12.459+00:00",
"created_at": "2018-12-14T07:25:04.458+00:00",
"currency_code": "TWD"
},
"created_by": "shop_crm"
}],
"pagination": {
"current_page": 1,
"per_page": 24,
"total_pages": 1,
"total_count": 1
}
}Updated 13 days ago