The customer profile is information related to customers, including basic information, membership class, customer's accumulated points...

Authenticated access scopes: loy.read_profiles

Customer Profile properties

id

"id": 207119551 

A unique numeric identifier for the customer profile.

first_name

"first_name": "John" 

The customer's first name.

last_name

"last_name": "Smit" 

The customer's last name.

phone

"phone": "0909977921" 

The customer's phone.

email

"email": "john@example.com" 

The customer's email.

gender

"gender": "male" 

Gender of customer. Default value: null. Valid values:

  • unknow: Empty info.
  • male: The customer is male.
  • female: The customer is female.

birthday

"birthday": "1901-01-01" 

The date (format YYYY-MM-DD) when the customer was born. Default value: null when empty info.

address

"address": "Số 1 đường Nguyễn Huệ" 

The customer's address.

country_code

"country_code": "VN" 

The two-letter country code corresponding to the customer's country.

country_name

"country_name": "Viet Nam" 

The customer's normalized country name.

province_code

"province_code": "HC" 

The two-letter province code for the customer's region.

province_name

"province_name": "Hồ Chí Minh" 

The customer's region name. Typically a province, a state, or a prefecture.

district_code

"district_code": "HC466" 

The standard abbreviation for the state or district.

district_name

"district_name": "Quận 1" 

The full name of the state or district.

ward_code

"ward_code": "26734" 

The standard abbreviation for the ward.

ward_name

"ward_name": "Phường Bến Thành" 

The customer's ward name.

point_used

"point_used": 900

Customer's bonus points have been used.

point_available

"point_available": 100 

Customer's bonus points can be used.

point_incoming

"point_incoming": 0

Customer Rewards Points are pending.

point_ranking

"point_ranking": 10000

Customer's membership score.

level_id

"level_id": 2020

A unique numeric identifier for the rank membership.

level_name

"level_name": "Member"

The name of rank member.

total_spent

"total_spent": 1000000

The total amount of money that the customer has spent across their order history.

total_order

"total_order": 10

The number of customer order history.

status

"status": "enabled"

Customer operation status. Default value: "enabled". Valid values:

  • enabled: The customer is active.
  • disabled: The customer is not active.

last_order_at

"last_order_at": "2020-05-08T04:08:06.000000Z"

The last time the customer made a purchase (ISO 8601 format). Default value: null.

created_at

"created_at": "2020-05-08T04:08:06.000000Z"

The date and time (ISO 8601 format) when the customer profile was created.

updated_at

"updated_at":"2020-05-08T04:08:06.000000Z"

The date and time (ISO 8601 format) when the customer profile was last updated.

attributes

"attributes": [

  {

    "id"207119551 ,

    "key""ref_id",

    "value""1010"

  }

]

Extra information that is added to the customer profile. Each array entry must contain a hash with key and value.

Endpoints

GET https://apis.haravan.com/loy/profiles.json

Retrieves a list of all customer profiles. You can filter resources by params.

since_id

Restrict results to after the specified ID

fields

comma-separated list of fields to include in the response.

phone

Restrict results by customer's phone.

updated_at_min

Show customer profile last updated after date (format: 2021-10-20T14:07:45.084Z).

updated_at_max

Show customer profile last updated befor date (format: 2021-10-20T14:07:45.084Z).

page

Page to show the result..

limit

integer ≤ 50 default 20

The maximum number of results to show on a page.

Retrieves a list of all customer profiles by first page.

GET https://apis.haravan.com/loy/profiles.json?page=1&limit=10

View response

HTTP/1.1 200 OK

{ "profiles": [ { "id": 360455, "first_name": "", "last_name": "test", "gender": "unknown", "birthday": null, "profile_card_number": "100006037116", "phone": "", "email": "customerkh@gmail.com", "address": "", "country_code": "vn", "country_name": "Vietnam", "province_code": "", "province_name": "", "district_code": "", "district_name": "", "ward_code": "", "ward_name": "", "point_used": 900, "point_available": 6100, "point_ranking": 10350, "point_incoming": 0, "level_id": 2106, "level_name": "Member", "total_spent": 1035000, "total_order": 6, "status": "enabled", "last_order_at": "2020-05-08T04:08:06.000000Z", "created_at": "2020-04-15T09:28:57.000000Z", "updated_at": "2020-07-21T08:33:36.000000Z" } ] }
GET https://apis.haravan.com/loy/profiles/{profile_id}.json

Retrieves single the customer profile.

Retrieves single the customer profile.

GET https://apis.haravan.com/loy/profiles/360455.json

View response

HTTP/1.1 200 OK

{ "profile": { "id": 360455, "first_name": "", "last_name": "test", "gender": "unknown", "birthday": null, "profile_card_number": "100006037116", "phone": "", "email": "customerkh@gmail.com", "address": "", "country_code": "vn", "country_name": "Vietnam", "province_code": "", "province_name": "", "district_code": "", "district_name": "", "ward_code": "", "ward_name": "", "point_used": 900, "point_available": 6100, "point_ranking": 10350, "point_incoming": 0, "level_id": 2106, "level_name": "Member", "total_spent": 1035000, "total_order": 6, "status": "enabled", "last_order_at": "2020-05-08T04:08:06.000000Z", "created_at": "2020-04-15T09:28:57.000000Z", "updated_at": "2020-07-21T08:33:36.000000Z" } }

Retrieves tags of customer.

GET https://apis.haravan.com/loy/profiles/360455/tags.json

View response

HTTP/1.1 200 OK

{ "profile": { "tags": "MUA_HANG_KM,Online,Facebook" } }

Retrieves attributes of customer.

GET https://apis.haravan.com/loy/profiles/360455/attributes.json

View response

HTTP/1.1 200 OK

{ "profile": { "attributes": [ { "id": 1210, "key": "ref_id", "value": "1010" }, { "id": 1211, "key": "customer_level_prev_id", "value": "2991" } ] } }