Haravan — Khách hàng
Danh sách khách hàng (List customers) — haravan.list_customers
List customers, optionally created or updated in a date range.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
created_at_min | Tạo từ | string | không | Created at or after (ISO 8601). |
created_at_max | Tạo đến | string | không | Created at or before (ISO 8601). |
updated_at_min | Cập nhật từ | string | không | Updated at or after (ISO 8601). |
since_id | Sau mã khách | integer | không | Only customers after this id. Min 1. |
page | Trang | integer | không | Page number, from 1. Min 1. |
limit | Số kết quả mỗi trang | integer | không | Items per page (1-50, default 50). Min 1. Max 50. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
customers | Danh sách khách hàng | array of object | Customers. |
customers[].id | integer | Customer id. | |
customers[].email | string | null | Email. | |
customers[].phone | string | null | Phone number. | |
customers[].first_name | string | null | First name. | |
customers[].last_name | string | null | Last name. | |
customers[].accepts_marketing | boolean | Whether the customer accepts marketing. | |
customers[].tags | string | null | Comma-separated tags. | |
customers[].note | string | null | Note about the customer. | |
customers[].state | string | Account state. | |
customers[].orders_count | integer | Number of orders. | |
customers[].total_spent | number | Total spent, VND. | |
customers[].last_order_id | integer | null | Latest order id. | |
customers[].last_order_name | string | null | Latest order name. | |
customers[].default_address | object | null | Default address; null when the customer has none. | |
customers[].default_address.id | integer | Address id. | |
customers[].default_address.name | string | Full name of the person at this address. | |
customers[].default_address.first_name | string | First name. | |
customers[].default_address.last_name | string | Last name. | |
customers[].default_address.company | string | Company name. | |
customers[].default_address.phone | string | Phone number. | |
customers[].default_address.address1 | string | Street address: house number and street. | |
customers[].default_address.address2 | string | Second address line. | |
customers[].default_address.city | string | City, town or village. | |
customers[].default_address.province | string | Province or city name. | |
customers[].default_address.province_code | string | Province code; matches list_provinces. | |
customers[].default_address.district | string | Ward name under the two-level model (district name before). | |
customers[].default_address.district_code | string | Ward code; matches list_wards. | |
customers[].default_address.ward | string | Ward name under the three-level model; usually empty now. | |
customers[].default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
customers[].default_address.country | string | Country name. | |
customers[].default_address.country_code | string | Two-letter country code, e.g. VN. | |
customers[].default_address.zip | string | Postal code. | |
customers[].default_address.latitude | number | Latitude, if known. | |
customers[].default_address.longitude | number | Longitude, if known. | |
customers[].default_address.default | boolean | True when this is the default address. | |
customers[].default_address.customer_id | integer | Id of the customer the address belongs to. | |
customers[].default_address.country_name | string | Normalized country name. | |
customers[].addresses | array of object | The ten most recently updated addresses. | |
customers[].addresses[].id | integer | Address id. | |
customers[].addresses[].name | string | Full name of the person at this address. | |
customers[].addresses[].first_name | string | First name. | |
customers[].addresses[].last_name | string | Last name. | |
customers[].addresses[].company | string | Company name. | |
customers[].addresses[].phone | string | Phone number. | |
customers[].addresses[].address1 | string | Street address: house number and street. | |
customers[].addresses[].address2 | string | Second address line. | |
customers[].addresses[].city | string | City, town or village. | |
customers[].addresses[].province | string | Province or city name. | |
customers[].addresses[].province_code | string | Province code; matches list_provinces. | |
customers[].addresses[].district | string | Ward name under the two-level model (district name before). | |
customers[].addresses[].district_code | string | Ward code; matches list_wards. | |
customers[].addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
customers[].addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
customers[].addresses[].country | string | Country name. | |
customers[].addresses[].country_code | string | Two-letter country code, e.g. VN. | |
customers[].addresses[].zip | string | Postal code. | |
customers[].addresses[].latitude | number | Latitude, if known. | |
customers[].addresses[].longitude | number | Longitude, if known. | |
customers[].addresses[].default | boolean | True when this is the default address. | |
customers[].addresses[].customer_id | integer | Id of the customer the address belongs to. | |
customers[].addresses[].country_name | string | Normalized country name. | |
customers[].created_at | string | When it was created (ISO 8601). | |
customers[].updated_at | string | When it was last updated (ISO 8601). | |
customers[].verified_email | boolean | Whether the customer has verified their email. | |
customers[].birthday | string | null | Date of birth (ISO 8601); null when unknown. | |
customers[].gender | integer | null | Gender: 0 female, 1 male, 2 other; null when unknown. | |
customers[].last_order_date | string | null | When the customer last ordered (ISO 8601); null when never. | |
customers[].multipass_identifier | boolean | null | Identifier for Multipass login. The reference types it as boolean; its samples only show null. |
Tìm khách hàng (Search customers) — haravan.search_customers
Find customers by name, phone number or email.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
query | Từ khoá | string | có | Name, phone or email to search for. |
page | Trang | integer | không | Page number, from 1. Min 1. |
limit | Số kết quả mỗi trang | integer | không | Items per page (1-50, default 50). Min 1. Max 50. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
customers | Khách hàng | array of object | Matching customers. |
customers[].id | integer | Customer id. | |
customers[].email | string | null | Email. | |
customers[].phone | string | null | Phone number. | |
customers[].first_name | string | null | First name. | |
customers[].last_name | string | null | Last name. | |
customers[].accepts_marketing | boolean | Whether the customer accepts marketing. | |
customers[].tags | string | null | Comma-separated tags. | |
customers[].note | string | null | Note about the customer. | |
customers[].state | string | Account state. | |
customers[].orders_count | integer | Number of orders. | |
customers[].total_spent | number | Total spent, VND. | |
customers[].last_order_id | integer | null | Latest order id. | |
customers[].last_order_name | string | null | Latest order name. | |
customers[].default_address | object | null | Default address; null when the customer has none. | |
customers[].default_address.id | integer | Address id. | |
customers[].default_address.name | string | Full name of the person at this address. | |
customers[].default_address.first_name | string | First name. | |
customers[].default_address.last_name | string | Last name. | |
customers[].default_address.company | string | Company name. | |
customers[].default_address.phone | string | Phone number. | |
customers[].default_address.address1 | string | Street address: house number and street. | |
customers[].default_address.address2 | string | Second address line. | |
customers[].default_address.city | string | City, town or village. | |
customers[].default_address.province | string | Province or city name. | |
customers[].default_address.province_code | string | Province code; matches list_provinces. | |
customers[].default_address.district | string | Ward name under the two-level model (district name before). | |
customers[].default_address.district_code | string | Ward code; matches list_wards. | |
customers[].default_address.ward | string | Ward name under the three-level model; usually empty now. | |
customers[].default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
customers[].default_address.country | string | Country name. | |
customers[].default_address.country_code | string | Two-letter country code, e.g. VN. | |
customers[].default_address.zip | string | Postal code. | |
customers[].default_address.latitude | number | Latitude, if known. | |
customers[].default_address.longitude | number | Longitude, if known. | |
customers[].default_address.default | boolean | True when this is the default address. | |
customers[].default_address.customer_id | integer | Id of the customer the address belongs to. | |
customers[].default_address.country_name | string | Normalized country name. | |
customers[].addresses | array of object | The ten most recently updated addresses. | |
customers[].addresses[].id | integer | Address id. | |
customers[].addresses[].name | string | Full name of the person at this address. | |
customers[].addresses[].first_name | string | First name. | |
customers[].addresses[].last_name | string | Last name. | |
customers[].addresses[].company | string | Company name. | |
customers[].addresses[].phone | string | Phone number. | |
customers[].addresses[].address1 | string | Street address: house number and street. | |
customers[].addresses[].address2 | string | Second address line. | |
customers[].addresses[].city | string | City, town or village. | |
customers[].addresses[].province | string | Province or city name. | |
customers[].addresses[].province_code | string | Province code; matches list_provinces. | |
customers[].addresses[].district | string | Ward name under the two-level model (district name before). | |
customers[].addresses[].district_code | string | Ward code; matches list_wards. | |
customers[].addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
customers[].addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
customers[].addresses[].country | string | Country name. | |
customers[].addresses[].country_code | string | Two-letter country code, e.g. VN. | |
customers[].addresses[].zip | string | Postal code. | |
customers[].addresses[].latitude | number | Latitude, if known. | |
customers[].addresses[].longitude | number | Longitude, if known. | |
customers[].addresses[].default | boolean | True when this is the default address. | |
customers[].addresses[].customer_id | integer | Id of the customer the address belongs to. | |
customers[].addresses[].country_name | string | Normalized country name. | |
customers[].created_at | string | When it was created (ISO 8601). | |
customers[].updated_at | string | When it was last updated (ISO 8601). | |
customers[].verified_email | boolean | Whether the customer has verified their email. | |
customers[].birthday | string | null | Date of birth (ISO 8601); null when unknown. | |
customers[].gender | integer | null | Gender: 0 female, 1 male, 2 other; null when unknown. | |
customers[].last_order_date | string | null | When the customer last ordered (ISO 8601); null when never. | |
customers[].multipass_identifier | boolean | null | Identifier for Multipass login. The reference types it as boolean; its samples only show null. |
Xem khách hàng (Get customer) — haravan.get_customer
Get one customer with contact details, addresses and order totals.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
customer_id | Mã khách hàng | integer | có | Haravan customer id. Min 1. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
customer | Khách hàng | object | The customer. |
customer.id | integer | Customer id. | |
customer.email | string | null | Email. | |
customer.phone | string | null | Phone number. | |
customer.first_name | string | null | First name. | |
customer.last_name | string | null | Last name. | |
customer.accepts_marketing | boolean | Whether the customer accepts marketing. | |
customer.tags | string | null | Comma-separated tags. | |
customer.note | string | null | Note about the customer. | |
customer.state | string | Account state. | |
customer.orders_count | integer | Number of orders. | |
customer.total_spent | number | Total spent, VND. | |
customer.last_order_id | integer | null | Latest order id. | |
customer.last_order_name | string | null | Latest order name. | |
customer.default_address | object | null | Default address; null when the customer has none. | |
customer.default_address.id | integer | Address id. | |
customer.default_address.name | string | Full name of the person at this address. | |
customer.default_address.first_name | string | First name. | |
customer.default_address.last_name | string | Last name. | |
customer.default_address.company | string | Company name. | |
customer.default_address.phone | string | Phone number. | |
customer.default_address.address1 | string | Street address: house number and street. | |
customer.default_address.address2 | string | Second address line. | |
customer.default_address.city | string | City, town or village. | |
customer.default_address.province | string | Province or city name. | |
customer.default_address.province_code | string | Province code; matches list_provinces. | |
customer.default_address.district | string | Ward name under the two-level model (district name before). | |
customer.default_address.district_code | string | Ward code; matches list_wards. | |
customer.default_address.ward | string | Ward name under the three-level model; usually empty now. | |
customer.default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
customer.default_address.country | string | Country name. | |
customer.default_address.country_code | string | Two-letter country code, e.g. VN. | |
customer.default_address.zip | string | Postal code. | |
customer.default_address.latitude | number | Latitude, if known. | |
customer.default_address.longitude | number | Longitude, if known. | |
customer.default_address.default | boolean | True when this is the default address. | |
customer.default_address.customer_id | integer | Id of the customer the address belongs to. | |
customer.default_address.country_name | string | Normalized country name. | |
customer.addresses | array of object | The ten most recently updated addresses. | |
customer.addresses[].id | integer | Address id. | |
customer.addresses[].name | string | Full name of the person at this address. | |
customer.addresses[].first_name | string | First name. | |
customer.addresses[].last_name | string | Last name. | |
customer.addresses[].company | string | Company name. | |
customer.addresses[].phone | string | Phone number. | |
customer.addresses[].address1 | string | Street address: house number and street. | |
customer.addresses[].address2 | string | Second address line. | |
customer.addresses[].city | string | City, town or village. | |
customer.addresses[].province | string | Province or city name. | |
customer.addresses[].province_code | string | Province code; matches list_provinces. | |
customer.addresses[].district | string | Ward name under the two-level model (district name before). | |
customer.addresses[].district_code | string | Ward code; matches list_wards. | |
customer.addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
customer.addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
customer.addresses[].country | string | Country name. | |
customer.addresses[].country_code | string | Two-letter country code, e.g. VN. | |
customer.addresses[].zip | string | Postal code. | |
customer.addresses[].latitude | number | Latitude, if known. | |
customer.addresses[].longitude | number | Longitude, if known. | |
customer.addresses[].default | boolean | True when this is the default address. | |
customer.addresses[].customer_id | integer | Id of the customer the address belongs to. | |
customer.addresses[].country_name | string | Normalized country name. | |
customer.created_at | string | When it was created (ISO 8601). | |
customer.updated_at | string | When it was last updated (ISO 8601). | |
customer.verified_email | boolean | Whether the customer has verified their email. | |
customer.birthday | string | null | Date of birth (ISO 8601); null when unknown. | |
customer.gender | integer | null | Gender: 0 female, 1 male, 2 other; null when unknown. | |
customer.last_order_date | string | null | When the customer last ordered (ISO 8601); null when never. | |
customer.multipass_identifier | boolean | null | Identifier for Multipass login. The reference types it as boolean; its samples only show null. |
Tạo khách hàng (Create customer) — haravan.create_customer
Create a customer. Look up province_code with list_provinces and the ward code (sent as district_code) with list_wards first.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | com.write_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
customer | Khách hàng | object | có | The customer. Other Haravan customer fields are also accepted. |
customer.first_name | string | không | First (given) name. | |
customer.last_name | string | không | Last (family) name. | |
customer.email | string | không | Email. | |
customer.phone | string | không | Phone number. | |
customer.note | string | không | Internal note. | |
customer.tags | string | không | Comma-separated tags. | |
customer.accepts_marketing | boolean | không | Agrees to receive marketing. | |
customer.addresses | array of object | không | Addresses. | |
customer.addresses[].name | string | không | Recipient full name. | |
customer.addresses[].phone | string | không | Recipient phone number. | |
customer.addresses[].address1 | string | không | Street address: house number and street. | |
customer.addresses[].province_code | string | không | Province code from list_provinces. | |
customer.addresses[].district_code | string | không | New ward code from list_wards (two-level model). | |
customer.addresses[].ward_code | string | không | Leave empty under the two-level model. | |
customer.addresses[].country_code | string | không | Country code, VN for Vietnam. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
customer | Khách hàng | object | The customer. |
customer.id | integer | Customer id. | |
customer.email | string | null | Email. | |
customer.phone | string | null | Phone number. | |
customer.first_name | string | null | First name. | |
customer.last_name | string | null | Last name. | |
customer.accepts_marketing | boolean | Whether the customer accepts marketing. | |
customer.tags | string | null | Comma-separated tags. | |
customer.note | string | null | Note about the customer. | |
customer.state | string | Account state. | |
customer.orders_count | integer | Number of orders. | |
customer.total_spent | number | Total spent, VND. | |
customer.last_order_id | integer | null | Latest order id. | |
customer.last_order_name | string | null | Latest order name. | |
customer.default_address | object | null | Default address; null when the customer has none. | |
customer.default_address.id | integer | Address id. | |
customer.default_address.name | string | Full name of the person at this address. | |
customer.default_address.first_name | string | First name. | |
customer.default_address.last_name | string | Last name. | |
customer.default_address.company | string | Company name. | |
customer.default_address.phone | string | Phone number. | |
customer.default_address.address1 | string | Street address: house number and street. | |
customer.default_address.address2 | string | Second address line. | |
customer.default_address.city | string | City, town or village. | |
customer.default_address.province | string | Province or city name. | |
customer.default_address.province_code | string | Province code; matches list_provinces. | |
customer.default_address.district | string | Ward name under the two-level model (district name before). | |
customer.default_address.district_code | string | Ward code; matches list_wards. | |
customer.default_address.ward | string | Ward name under the three-level model; usually empty now. | |
customer.default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
customer.default_address.country | string | Country name. | |
customer.default_address.country_code | string | Two-letter country code, e.g. VN. | |
customer.default_address.zip | string | Postal code. | |
customer.default_address.latitude | number | Latitude, if known. | |
customer.default_address.longitude | number | Longitude, if known. | |
customer.default_address.default | boolean | True when this is the default address. | |
customer.default_address.customer_id | integer | Id of the customer the address belongs to. | |
customer.default_address.country_name | string | Normalized country name. | |
customer.addresses | array of object | The ten most recently updated addresses. | |
customer.addresses[].id | integer | Address id. | |
customer.addresses[].name | string | Full name of the person at this address. | |
customer.addresses[].first_name | string | First name. | |
customer.addresses[].last_name | string | Last name. | |
customer.addresses[].company | string | Company name. | |
customer.addresses[].phone | string | Phone number. | |
customer.addresses[].address1 | string | Street address: house number and street. | |
customer.addresses[].address2 | string | Second address line. | |
customer.addresses[].city | string | City, town or village. | |
customer.addresses[].province | string | Province or city name. | |
customer.addresses[].province_code | string | Province code; matches list_provinces. | |
customer.addresses[].district | string | Ward name under the two-level model (district name before). | |
customer.addresses[].district_code | string | Ward code; matches list_wards. | |
customer.addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
customer.addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
customer.addresses[].country | string | Country name. | |
customer.addresses[].country_code | string | Two-letter country code, e.g. VN. | |
customer.addresses[].zip | string | Postal code. | |
customer.addresses[].latitude | number | Latitude, if known. | |
customer.addresses[].longitude | number | Longitude, if known. | |
customer.addresses[].default | boolean | True when this is the default address. | |
customer.addresses[].customer_id | integer | Id of the customer the address belongs to. | |
customer.addresses[].country_name | string | Normalized country name. | |
customer.created_at | string | When it was created (ISO 8601). | |
customer.updated_at | string | When it was last updated (ISO 8601). | |
customer.verified_email | boolean | Whether the customer has verified their email. | |
customer.birthday | string | null | Date of birth (ISO 8601); null when unknown. | |
customer.gender | integer | null | Gender: 0 female, 1 male, 2 other; null when unknown. | |
customer.last_order_date | string | null | When the customer last ordered (ISO 8601); null when never. | |
customer.multipass_identifier | boolean | null | Identifier for Multipass login. The reference types it as boolean; its samples only show null. |
Cập nhật khách hàng (Update customer) — haravan.update_customer
Update a customer's name, contact details, note, tags or marketing consent.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | có | com.write_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
customer_id | Mã khách hàng | integer | có | Haravan customer id. Min 1. |
customer | Thông tin cập nhật | object | có | Fields to change. |
customer.first_name | string | không | First (given) name. | |
customer.last_name | string | không | Last (family) name. | |
customer.email | string | không | Email. | |
customer.phone | string | không | Phone number. | |
customer.note | string | không | Internal note. | |
customer.tags | string | không | Comma-separated tags. | |
customer.accepts_marketing | boolean | không | Agrees to receive marketing. | |
customer.addresses | array of object | không | Addresses. | |
customer.addresses[].name | string | không | Recipient full name. | |
customer.addresses[].phone | string | không | Recipient phone number. | |
customer.addresses[].address1 | string | không | Street address: house number and street. | |
customer.addresses[].province_code | string | không | Province code from list_provinces. | |
customer.addresses[].district_code | string | không | New ward code from list_wards (two-level model). | |
customer.addresses[].ward_code | string | không | Leave empty under the two-level model. | |
customer.addresses[].country_code | string | không | Country code, VN for Vietnam. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
customer | Khách hàng | object | The customer. |
customer.id | integer | Customer id. | |
customer.email | string | null | Email. | |
customer.phone | string | null | Phone number. | |
customer.first_name | string | null | First name. | |
customer.last_name | string | null | Last name. | |
customer.accepts_marketing | boolean | Whether the customer accepts marketing. | |
customer.tags | string | null | Comma-separated tags. | |
customer.note | string | null | Note about the customer. | |
customer.state | string | Account state. | |
customer.orders_count | integer | Number of orders. | |
customer.total_spent | number | Total spent, VND. | |
customer.last_order_id | integer | null | Latest order id. | |
customer.last_order_name | string | null | Latest order name. | |
customer.default_address | object | null | Default address; null when the customer has none. | |
customer.default_address.id | integer | Address id. | |
customer.default_address.name | string | Full name of the person at this address. | |
customer.default_address.first_name | string | First name. | |
customer.default_address.last_name | string | Last name. | |
customer.default_address.company | string | Company name. | |
customer.default_address.phone | string | Phone number. | |
customer.default_address.address1 | string | Street address: house number and street. | |
customer.default_address.address2 | string | Second address line. | |
customer.default_address.city | string | City, town or village. | |
customer.default_address.province | string | Province or city name. | |
customer.default_address.province_code | string | Province code; matches list_provinces. | |
customer.default_address.district | string | Ward name under the two-level model (district name before). | |
customer.default_address.district_code | string | Ward code; matches list_wards. | |
customer.default_address.ward | string | Ward name under the three-level model; usually empty now. | |
customer.default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
customer.default_address.country | string | Country name. | |
customer.default_address.country_code | string | Two-letter country code, e.g. VN. | |
customer.default_address.zip | string | Postal code. | |
customer.default_address.latitude | number | Latitude, if known. | |
customer.default_address.longitude | number | Longitude, if known. | |
customer.default_address.default | boolean | True when this is the default address. | |
customer.default_address.customer_id | integer | Id of the customer the address belongs to. | |
customer.default_address.country_name | string | Normalized country name. | |
customer.addresses | array of object | The ten most recently updated addresses. | |
customer.addresses[].id | integer | Address id. | |
customer.addresses[].name | string | Full name of the person at this address. | |
customer.addresses[].first_name | string | First name. | |
customer.addresses[].last_name | string | Last name. | |
customer.addresses[].company | string | Company name. | |
customer.addresses[].phone | string | Phone number. | |
customer.addresses[].address1 | string | Street address: house number and street. | |
customer.addresses[].address2 | string | Second address line. | |
customer.addresses[].city | string | City, town or village. | |
customer.addresses[].province | string | Province or city name. | |
customer.addresses[].province_code | string | Province code; matches list_provinces. | |
customer.addresses[].district | string | Ward name under the two-level model (district name before). | |
customer.addresses[].district_code | string | Ward code; matches list_wards. | |
customer.addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
customer.addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
customer.addresses[].country | string | Country name. | |
customer.addresses[].country_code | string | Two-letter country code, e.g. VN. | |
customer.addresses[].zip | string | Postal code. | |
customer.addresses[].latitude | number | Latitude, if known. | |
customer.addresses[].longitude | number | Longitude, if known. | |
customer.addresses[].default | boolean | True when this is the default address. | |
customer.addresses[].customer_id | integer | Id of the customer the address belongs to. | |
customer.addresses[].country_name | string | Normalized country name. | |
customer.created_at | string | When it was created (ISO 8601). | |
customer.updated_at | string | When it was last updated (ISO 8601). | |
customer.verified_email | boolean | Whether the customer has verified their email. | |
customer.birthday | string | null | Date of birth (ISO 8601); null when unknown. | |
customer.gender | integer | null | Gender: 0 female, 1 male, 2 other; null when unknown. | |
customer.last_order_date | string | null | When the customer last ordered (ISO 8601); null when never. | |
customer.multipass_identifier | boolean | null | Identifier for Multipass login. The reference types it as boolean; its samples only show null. |
Xoá khách hàng (Delete customer) — haravan.delete_customer
Delete a customer. Customers with orders cannot be deleted.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | có | có | com.write_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
customer_id | Mã khách hàng | integer | có | Haravan customer id. Min 1. |
Field thêm: bỏ qua.
Output
Trả về object rỗng.
Thêm thẻ khách hàng (Add customer tags) — haravan.add_customer_tags
Add tags to a customer; existing tags are kept.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | com.write_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
customer_id | Mã khách hàng | integer | có | Haravan customer id. Min 1. |
tags | Thẻ | string | có | Comma-separated tags, e.g. 'vip,zalo'. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
tags | Thẻ | string | null | Customer tags after the change. |
Xoá thẻ khách hàng (Remove customer tags) — haravan.remove_customer_tags
Remove tags from a customer.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | có | com.write_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
customer_id | Mã khách hàng | integer | có | Haravan customer id. Min 1. |
tags | Thẻ | string | có | Comma-separated tags, e.g. 'vip,zalo'. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
tags | Thẻ | string | null | Customer tags after the change. |
Danh sách địa chỉ khách hàng (List customer addresses) — haravan.list_customer_addresses
List a customer's saved addresses.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
customer_id | Mã khách hàng | integer | có | Haravan customer id. Min 1. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
addresses | Danh sách địa chỉ | array of object | Addresses. |
addresses[].id | integer | Address id. | |
addresses[].name | string | Full name of the person at this address. | |
addresses[].first_name | string | First name. | |
addresses[].last_name | string | Last name. | |
addresses[].company | string | Company name. | |
addresses[].phone | string | Phone number. | |
addresses[].address1 | string | Street address: house number and street. | |
addresses[].address2 | string | Second address line. | |
addresses[].city | string | City, town or village. | |
addresses[].province | string | Province or city name. | |
addresses[].province_code | string | Province code; matches list_provinces. | |
addresses[].district | string | Ward name under the two-level model (district name before). | |
addresses[].district_code | string | Ward code; matches list_wards. | |
addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
addresses[].country | string | Country name. | |
addresses[].country_code | string | Two-letter country code, e.g. VN. | |
addresses[].zip | string | Postal code. | |
addresses[].latitude | number | Latitude, if known. | |
addresses[].longitude | number | Longitude, if known. | |
addresses[].default | boolean | True when this is the default address. | |
addresses[].customer_id | integer | Id of the customer the address belongs to. | |
addresses[].country_name | string | Normalized country name. |
Thêm địa chỉ khách hàng (Add customer address) — haravan.create_customer_address
Save a new address for a customer. Look up province_code with list_provinces and the ward code (sent as district_code) with list_wards first.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | com.write_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
customer_id | Mã khách hàng | integer | có | Haravan customer id. Min 1. |
address | Địa chỉ | object | có | The address. |
address.name | string | không | Recipient full name. | |
address.phone | string | không | Recipient phone number. | |
address.address1 | string | không | Street address: house number and street. | |
address.province_code | string | không | Province code from list_provinces. | |
address.district_code | string | không | New ward code from list_wards (two-level model). | |
address.ward_code | string | không | Leave empty under the two-level model. | |
address.country_code | string | không | Country code, VN for Vietnam. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
customer_address | Địa chỉ | object | The address. |
customer_address.id | integer | Address id. | |
customer_address.name | string | Full name of the person at this address. | |
customer_address.first_name | string | First name. | |
customer_address.last_name | string | Last name. | |
customer_address.company | string | Company name. | |
customer_address.phone | string | Phone number. | |
customer_address.address1 | string | Street address: house number and street. | |
customer_address.address2 | string | Second address line. | |
customer_address.city | string | City, town or village. | |
customer_address.province | string | Province or city name. | |
customer_address.province_code | string | Province code; matches list_provinces. | |
customer_address.district | string | Ward name under the two-level model (district name before). | |
customer_address.district_code | string | Ward code; matches list_wards. | |
customer_address.ward | string | Ward name under the three-level model; usually empty now. | |
customer_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
customer_address.country | string | Country name. | |
customer_address.country_code | string | Two-letter country code, e.g. VN. | |
customer_address.zip | string | Postal code. | |
customer_address.latitude | number | Latitude, if known. | |
customer_address.longitude | number | Longitude, if known. | |
customer_address.default | boolean | True when this is the default address. | |
customer_address.customer_id | integer | Id of the customer the address belongs to. | |
customer_address.country_name | string | Normalized country name. |
Cập nhật địa chỉ khách hàng (Update customer address) — haravan.update_customer_address
Change a saved customer address. Look up province_code with list_provinces and the ward code (sent as district_code) with list_wards first.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | có | com.write_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
customer_id | Mã khách hàng | integer | có | Haravan customer id. Min 1. |
address_id | Mã địa chỉ | integer | có | Customer address id. Min 1. |
address | Địa chỉ | object | có | Fields to change. |
address.name | string | không | Recipient full name. | |
address.phone | string | không | Recipient phone number. | |
address.address1 | string | không | Street address: house number and street. | |
address.province_code | string | không | Province code from list_provinces. | |
address.district_code | string | không | New ward code from list_wards (two-level model). | |
address.ward_code | string | không | Leave empty under the two-level model. | |
address.country_code | string | không | Country code, VN for Vietnam. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
customer_address | Địa chỉ | object | The address. |
customer_address.id | integer | Address id. | |
customer_address.name | string | Full name of the person at this address. | |
customer_address.first_name | string | First name. | |
customer_address.last_name | string | Last name. | |
customer_address.company | string | Company name. | |
customer_address.phone | string | Phone number. | |
customer_address.address1 | string | Street address: house number and street. | |
customer_address.address2 | string | Second address line. | |
customer_address.city | string | City, town or village. | |
customer_address.province | string | Province or city name. | |
customer_address.province_code | string | Province code; matches list_provinces. | |
customer_address.district | string | Ward name under the two-level model (district name before). | |
customer_address.district_code | string | Ward code; matches list_wards. | |
customer_address.ward | string | Ward name under the three-level model; usually empty now. | |
customer_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
customer_address.country | string | Country name. | |
customer_address.country_code | string | Two-letter country code, e.g. VN. | |
customer_address.zip | string | Postal code. | |
customer_address.latitude | number | Latitude, if known. | |
customer_address.longitude | number | Longitude, if known. | |
customer_address.default | boolean | True when this is the default address. | |
customer_address.customer_id | integer | Id of the customer the address belongs to. | |
customer_address.country_name | string | Normalized country name. |
Xoá địa chỉ khách hàng (Delete customer address) — haravan.delete_customer_address
Delete a saved customer address. The default address cannot be deleted.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | có | có | com.write_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
customer_id | Mã khách hàng | integer | có | Haravan customer id. Min 1. |
address_id | Mã địa chỉ | integer | có | Customer address id. Min 1. |
Field thêm: bỏ qua.
Output
Trả về object rỗng.
Đặt địa chỉ mặc định (Set default customer address) — haravan.set_default_customer_address
Make a saved address the customer's default address.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | có | com.write_customers |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
customer_id | Mã khách hàng | integer | có | Haravan customer id. Min 1. |
address_id | Mã địa chỉ | integer | có | Customer address id. Min 1. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
customer_address | Địa chỉ | object | The address. |
customer_address.id | integer | Address id. | |
customer_address.name | string | Full name of the person at this address. | |
customer_address.first_name | string | First name. | |
customer_address.last_name | string | Last name. | |
customer_address.company | string | Company name. | |
customer_address.phone | string | Phone number. | |
customer_address.address1 | string | Street address: house number and street. | |
customer_address.address2 | string | Second address line. | |
customer_address.city | string | City, town or village. | |
customer_address.province | string | Province or city name. | |
customer_address.province_code | string | Province code; matches list_provinces. | |
customer_address.district | string | Ward name under the two-level model (district name before). | |
customer_address.district_code | string | Ward code; matches list_wards. | |
customer_address.ward | string | Ward name under the three-level model; usually empty now. | |
customer_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
customer_address.country | string | Country name. | |
customer_address.country_code | string | Two-letter country code, e.g. VN. | |
customer_address.zip | string | Postal code. | |
customer_address.latitude | number | Latitude, if known. | |
customer_address.longitude | number | Longitude, if known. | |
customer_address.default | boolean | True when this is the default address. | |
customer_address.customer_id | integer | Id of the customer the address belongs to. | |
customer_address.country_name | string | Normalized country name. |