Get Customers

Function

To get detailed information of couple customers sorted by time
利用時間範圍選取與排序獲取數筆顧客資料

URL

GET <<api_domain>>/v1/customers

Request parameters

Parameter

Type

Description

Example

updated_after

DateTime

Filter data by updated_at after.
取得 updated_at 大於某段時間的 Date.(包含指定時間)

  • should use UTC time
ruby
updated_after=2018-01-01 00:00:00 

updated_before

DateTime

Filter data by updated_at before.
取得 updated_at 小於某段時間的 Date.(包含指定時間)

  • should use UTC time
ruby
updated_before=2018-01-01 00:00:00 

per_page

Integer

Numbers of Customers per Page
每頁顯示 n 筆資料
(Default: 24)

ruby
per_page: 24

page

Integer

Page Number
頁數
(Default: 1)

Should use either page or previous_id

ruby
page: 1

sort_by

String

Setting sort by created time
設定創建時間排序
(Default: desc)

  • asc: asending 升冪
    desc: descending 降冪
ruby sort_by=desc sort_by=asc

previous_id

String

ID of last item in previous page
上一頁最後的item的id

Should use either page or previous_id

  • Note: 如果需要取得大量資料,建議使用這種 cursor based 分頁方式避免 timeout

previous_id=5f1e837c1be895004582ad47

Response fields

Field

Type

Description

Example

items

Get Customer

Customer Data
顧客資訊

Please check the link on the left

pagination

Pagination

Pagination Data
頁面資訊

Please check the link on the left

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