Search Customers
Function
To search customers with specific conditions.
利用特殊條件搜尋顧客列表。
URL
GET API_DOMAIN/v1/customers/search
Request parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| page | Integer | Page 頁數 (Default: 1) | |
| per_page | Integer | Numbers of Orders per page 每頁顯示 n 筆資料 (Default: 24, Max: 999) | |
| query | String | Support searching fields below: 支援搜尋以下欄位: name phones mobile_phone | |
| name | String | Customer's Name 顧客姓名
| |
| id | array | Customer's ID 顧客編號 Multiple Owing to the limit of HTTP GET request, please limit the number of ID in around 200 複數 基於HTTP GET query string長度限制,請每次查詢約200個ID內. | |
emailString | String | Customer's Email 顧客Email
| |
| phones | String | Customer's Phone 顧客電話
| |
| mobile_phone | String | Customer's Mobile Phone 顧客手機
| |
| gender | String | Customer's Gender 顧客性別
| |
| membership_tier_id | String | Membership Tier 顧客等級
| |
| created_at | String | Filter customers by created time 以顧客創造時間作為搜尋依據
| |
| updated_at | String | Filter customers by created time 以顧客更新時間作為搜尋依據
| |
| registered_at | String | Filter customers by registered time 以顧客註冊時間作為搜尋依據
| |
| birthday | String | Filter customers by birthday 以顧客生日作為搜尋依據
| |
| birth_month | Integer | Filter customers by birth month 以顧客生日月份作為搜尋依據
| |
| credit_balance | String | Filter customers by credit balance 以購物金作為搜尋依據
| |
| is_member | String | Filter member customers. 搜尋是會員的顧客 | |
| is_blacklisted | String | Filter Blacklisted Customers. 搜尋是黑名單的顧客 | |
| is_subscribed_marketing_email | String | Filter Customers by Marketing Acceptance. 搜尋接受優惠宣傳的顧客 | |
| ref_user_id | String | Third party custom customer id 第三儲存之顧客ID | |
| tags | String | Custom tags 自定義標籤 |
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 3 months ago
Did this page help you?
