Get Customer
Function
To get detailed information for a specific customer with its ID
使用顧客ID獲取特定一個顧客的詳細資料
URL
GET <<api_domain>>/v1/customers/:id
Request parameters
Parameter | Type | Description | Example |
|---|---|---|---|
id *Required |
| Customer unique ID | |
excludes[] |
| Could exclude certain parameters in the response |
|
fields[] |
| Could only show certain parameters in the response [Parameters] |
|
include_fields[] |
| Provide additional attributes in the response [Parameters]
|
|
Response fields
Field | Type | Description | Example |
|---|---|---|---|
id |
| Customer Unique ID | 5ce0d084e388096bdb229a59 |
name |
| Customer Name | Shopline User |
| Customer Email | ||
gender |
| Customer Gender | male |
birthday |
| Customer Birthday
此欄位為舊版相容用,請使用 birth_year, birth_month, birth_day 代替。 If birth_year is null, then the default year is 1904. If birth_month is null, then the default month is 1. If birth_day is null, then the default day is 1. If birth_year, birth_month, birth_day are all null, then fallback to original birthday. | 2013-06-01 |
birth_year |
| Customer Birth Year | 2000 |
birth_month |
| Customer Birth Month | 6 |
birth_day |
| Customer Birth Day | 1 |
memo |
| Customer memo | 高級客戶 |
phones |
| Customer Phones | |
mobile_phone |
| Customer Mobile Phone | 0910000123 |
mobile_phone_verified |
| Mobile Phone is Verified or not | true |
mobile_phone_country_calling_code |
| Country Code of Mobile Phone | 886 |
locale_code |
| Customer Locale Code | zh-hant |
order_count |
| Customer Order Number | 1 |
orders_total_sum | Customer Orders Total Sum | Please check the link on the left | |
is_member |
| Is the customer a member? | true |
is_blacklisted |
| Is the customer in black-list? | false |
is_subscribed_marketing_email |
| Does the customer subscribe marketing email? Note: 訂閱資訊請參考 | true |
credit_balance |
| Current Customer Credits | 500 |
member_point_balance |
| Current Member Points | 30 |
custom_data | Custom Field Data | Please check the link on the left | |
membership_tier | Membership Tier Data
| Please check the link on the left | |
delivery_addresses | DeliveryAddress | Customer's Delivery Addresses | Please check the link on the left |
subscribed_email_types |
| Subscribed Email Types | marketing news |
subscriptions |
| subscriptions 訂閱資訊 | subscriptions: |
ref_user_id |
| For third party to put custom user_id | SL001 |
line_id |
| LINE ID | null |
facebook_id |
| FACEBOOK ID | |
google_id | String | GOOGLE ID | null |
updated_at |
| Customer Last Updated Time
| 2018-07-31T03:57:36.409+00:00 |
created_at |
| Customer Created Time
| 2018-01-10T06:33:45.231+00:00 |
current_sign_in_at |
| Timestamp updated when customers sign in
| 2018-07-31T03:49:52.725+00:00 |
last_sign_in_at |
| Holds the timestamp of the previous sign in
| 2018-04-02T04:02:23.391+00:00 |
registered_at |
| Customer register's Date and time
| 2018-01-10T06:33:45.231+00:00 |
registered_from_channel | Registration Channel | ||
created_by |
| 顧客建立來源 | shop |
tags |
| 自定義標籤 |
|
tier_expires_at |
| Membership expiry date
| "2021-12-18T15:59:59.999+00:00" |
offline_referral_registered_at |
| 門市綁定日期時間 | (只有使用 Smart OMO 服務的店家會有此欄位的值) |
offline_referral_channel_id |
| 門市 ID | (只有使用 Smart OMO 服務的店家會有此欄位的值) |
offline_referral_agent_id |
| 門市推薦人 ID | (只有使用 Smart OMO 服務的店家會有此欄位的值) |
confirmed_at |
| timestamp of the email verification
|
|
membership_tier_gap | Next membership tier's info | ||
current_membership_tier_info | Current membership tier's info Note:Members without a membership level (i.e., regular members) will not receive this field in the response. | ||
mobile_phone_verified |
| Mobile Phone Verification Status | |
email_verified |
| Email Verification Status | |
unconfirmed_email |
| Pending to verify Email | nil |
customer_authentication_linkings |
| 3rd Party Customer Authentication (SSO) 備註:串接 SSO 的會員 ID 不會存在 | "customer_authentication_linkings": [ |
membership_tier_gap entity
Field | Type | Description | Example |
|---|---|---|---|
next_tier | Information on the next membership tier.
| ||
next_discount |
| Discount for the next membership tier.
| 20 |
user_spending |
| The amount used to determine if a member meets the upgrade criteria, based on the "Membership Upgrade Condition" in the SHOPLINE Admin:
| 2000 The number is same as cents in the currency |
user_spendings_for_extend |
| The amount used to determine if a member meets the extend criteria, based on the "Membership extension condition" in the SHOPLINE Admin:
| 0 The number is same as cents in the currency |
next_total_spending |
| The amount of upgrading to next membership tier.
| 5000 The number is same as cents in the currency |
extend_total_spending |
| The amount of extending in current membership tier.
| 3000 The number is same as cents in the currency |
會員升級/續會差額計算方式 Calculating membership upgrade/renewal balance
If the condition is "Single Purchase":
- Upgrade Difference:
- If
user_spending> 0, it means the upgrade threshold has been met. The system will return the order with the highest amount among the qualifying orders. - If
user_spending= 0, then the difference =next_total_spending-user_spending— which is essentially equal tonext_total_spending, since the latter is 0.
- If
- Extension Difference:
- If
user_spendings_for_extend> 0, it means the extension threshold has been met. The system will return the order with the highest amount among the qualifying orders. - If
user_spendings_for_extend= 0, then the difference =extend_total_spending-user_spendings_for_extend— which is essentially equal toextend_total_spending, since the latter is 0.
- If
- Note: Neither
user_spendingnoruser_spendings_for_extendcan be less than 0.
If the condition is "Spending within a specified period":
- Upgrade Difference =
next_total_spending-user_spending - Extension Difference =
extend_total_spending-user_spendings_for_extend
若條件為 「單次購物」:
- 升級差額:
- 若
user_spending> 0,表示已達升級門檻,此時會回傳達門檻訂單中金額最高者; - 若
user_spending= 0,差額 =next_total_spending-user_spending- 其實就等同於
next_total_spending,因為要減去的後者是 0
- 其實就等同於
- 若
- 續會差額:
- 若
user_spendings_for_extend> 0,表示已達續會門檻,此時會回傳達門檻訂單中金額最高者; - 若
user_spendings_for_extend= 0,差額 =extend_total_spending-user_spendings_for_extend- 其實就等同於
extend_total_spending,因為要減去的後者是 0
- 其實就等同於
- 若
- 補充:
user_spending和user_spendings_for_extend不會有 <0 的情況
若條件為 「指定期限內購物」:
- 升級差額 =
next_total_spending-user_spending - 續會差額 =
extend_total_spending-user_spendings_for_extend
current_membership_tier_info entity
Field | Type | Description | Example |
|---|---|---|---|
|
| Membership tier's ID | "66f27419fe4e57003f7017b6" |
level |
| Level of Current Membership Tier | 4 |
name_translations | object | Json Object with key is the language code and value is the translation string |
|
merchant_id |
| Merchant ID | "5e958a8f12743200434653fc" |
member_count |
| Number of members in this membership tier | 1 |
exclusive_product_count |
| Number of exlcusive products in this membership tier | 0 |
promotion_count |
| Number of promotions in this membership tier | 1 |
member_discount_percentage |
| 這個會員等級適用的折扣優惠 | 40.0 |
valid_period | object | Valid period of this membership tier |
|
membership_tier_rules |
| Rules of the member tier |
|
created_at |
| "2024-09-24T08:11:05.029Z" | |
updated_at |
| "2025-03-20T03:35:59.353Z" |
Response Example
JSON sample
JSON example with mobile_phone without phones
Updated 19 days ago