Skip to content

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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcócom.read_customers

Input

FieldNhãnKiểuBắt buộcMô tả
created_at_minTạo từstringkhôngCreated at or after (ISO 8601).
created_at_maxTạo đếnstringkhôngCreated at or before (ISO 8601).
updated_at_minCập nhật từstringkhôngUpdated at or after (ISO 8601).
since_idSau mã kháchintegerkhôngOnly customers after this id. Min 1.
pageTrangintegerkhôngPage number, from 1. Min 1.
limitSố kết quả mỗi trangintegerkhôngItems per page (1-50, default 50). Min 1. Max 50.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
customersDanh sách khách hàngarray of objectCustomers.
customers[].idintegerCustomer id.
customers[].emailstring | nullEmail.
customers[].phonestring | nullPhone number.
customers[].first_namestring | nullFirst name.
customers[].last_namestring | nullLast name.
customers[].accepts_marketingbooleanWhether the customer accepts marketing.
customers[].tagsstring | nullComma-separated tags.
customers[].notestring | nullNote about the customer.
customers[].statestringAccount state.
customers[].orders_countintegerNumber of orders.
customers[].total_spentnumberTotal spent, VND.
customers[].last_order_idinteger | nullLatest order id.
customers[].last_order_namestring | nullLatest order name.
customers[].default_addressobject | nullDefault address; null when the customer has none.
customers[].default_address.idintegerAddress id.
customers[].default_address.namestringFull name of the person at this address.
customers[].default_address.first_namestringFirst name.
customers[].default_address.last_namestringLast name.
customers[].default_address.companystringCompany name.
customers[].default_address.phonestringPhone number.
customers[].default_address.address1stringStreet address: house number and street.
customers[].default_address.address2stringSecond address line.
customers[].default_address.citystringCity, town or village.
customers[].default_address.provincestringProvince or city name.
customers[].default_address.province_codestringProvince code; matches list_provinces.
customers[].default_address.districtstringWard name under the two-level model (district name before).
customers[].default_address.district_codestringWard code; matches list_wards.
customers[].default_address.wardstringWard name under the three-level model; usually empty now.
customers[].default_address.ward_codestringWard code under the three-level model; usually empty now.
customers[].default_address.countrystringCountry name.
customers[].default_address.country_codestringTwo-letter country code, e.g. VN.
customers[].default_address.zipstringPostal code.
customers[].default_address.latitudenumberLatitude, if known.
customers[].default_address.longitudenumberLongitude, if known.
customers[].default_address.defaultbooleanTrue when this is the default address.
customers[].default_address.customer_idintegerId of the customer the address belongs to.
customers[].default_address.country_namestringNormalized country name.
customers[].addressesarray of objectThe ten most recently updated addresses.
customers[].addresses[].idintegerAddress id.
customers[].addresses[].namestringFull name of the person at this address.
customers[].addresses[].first_namestringFirst name.
customers[].addresses[].last_namestringLast name.
customers[].addresses[].companystringCompany name.
customers[].addresses[].phonestringPhone number.
customers[].addresses[].address1stringStreet address: house number and street.
customers[].addresses[].address2stringSecond address line.
customers[].addresses[].citystringCity, town or village.
customers[].addresses[].provincestringProvince or city name.
customers[].addresses[].province_codestringProvince code; matches list_provinces.
customers[].addresses[].districtstringWard name under the two-level model (district name before).
customers[].addresses[].district_codestringWard code; matches list_wards.
customers[].addresses[].wardstringWard name under the three-level model; usually empty now.
customers[].addresses[].ward_codestringWard code under the three-level model; usually empty now.
customers[].addresses[].countrystringCountry name.
customers[].addresses[].country_codestringTwo-letter country code, e.g. VN.
customers[].addresses[].zipstringPostal code.
customers[].addresses[].latitudenumberLatitude, if known.
customers[].addresses[].longitudenumberLongitude, if known.
customers[].addresses[].defaultbooleanTrue when this is the default address.
customers[].addresses[].customer_idintegerId of the customer the address belongs to.
customers[].addresses[].country_namestringNormalized country name.
customers[].created_atstringWhen it was created (ISO 8601).
customers[].updated_atstringWhen it was last updated (ISO 8601).
customers[].verified_emailbooleanWhether the customer has verified their email.
customers[].birthdaystring | nullDate of birth (ISO 8601); null when unknown.
customers[].genderinteger | nullGender: 0 female, 1 male, 2 other; null when unknown.
customers[].last_order_datestring | nullWhen the customer last ordered (ISO 8601); null when never.
customers[].multipass_identifierboolean | nullIdentifier 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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcócom.read_customers

Input

FieldNhãnKiểuBắt buộcMô tả
queryTừ khoástringcóName, phone or email to search for.
pageTrangintegerkhôngPage number, from 1. Min 1.
limitSố kết quả mỗi trangintegerkhôngItems per page (1-50, default 50). Min 1. Max 50.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
customersKhách hàngarray of objectMatching customers.
customers[].idintegerCustomer id.
customers[].emailstring | nullEmail.
customers[].phonestring | nullPhone number.
customers[].first_namestring | nullFirst name.
customers[].last_namestring | nullLast name.
customers[].accepts_marketingbooleanWhether the customer accepts marketing.
customers[].tagsstring | nullComma-separated tags.
customers[].notestring | nullNote about the customer.
customers[].statestringAccount state.
customers[].orders_countintegerNumber of orders.
customers[].total_spentnumberTotal spent, VND.
customers[].last_order_idinteger | nullLatest order id.
customers[].last_order_namestring | nullLatest order name.
customers[].default_addressobject | nullDefault address; null when the customer has none.
customers[].default_address.idintegerAddress id.
customers[].default_address.namestringFull name of the person at this address.
customers[].default_address.first_namestringFirst name.
customers[].default_address.last_namestringLast name.
customers[].default_address.companystringCompany name.
customers[].default_address.phonestringPhone number.
customers[].default_address.address1stringStreet address: house number and street.
customers[].default_address.address2stringSecond address line.
customers[].default_address.citystringCity, town or village.
customers[].default_address.provincestringProvince or city name.
customers[].default_address.province_codestringProvince code; matches list_provinces.
customers[].default_address.districtstringWard name under the two-level model (district name before).
customers[].default_address.district_codestringWard code; matches list_wards.
customers[].default_address.wardstringWard name under the three-level model; usually empty now.
customers[].default_address.ward_codestringWard code under the three-level model; usually empty now.
customers[].default_address.countrystringCountry name.
customers[].default_address.country_codestringTwo-letter country code, e.g. VN.
customers[].default_address.zipstringPostal code.
customers[].default_address.latitudenumberLatitude, if known.
customers[].default_address.longitudenumberLongitude, if known.
customers[].default_address.defaultbooleanTrue when this is the default address.
customers[].default_address.customer_idintegerId of the customer the address belongs to.
customers[].default_address.country_namestringNormalized country name.
customers[].addressesarray of objectThe ten most recently updated addresses.
customers[].addresses[].idintegerAddress id.
customers[].addresses[].namestringFull name of the person at this address.
customers[].addresses[].first_namestringFirst name.
customers[].addresses[].last_namestringLast name.
customers[].addresses[].companystringCompany name.
customers[].addresses[].phonestringPhone number.
customers[].addresses[].address1stringStreet address: house number and street.
customers[].addresses[].address2stringSecond address line.
customers[].addresses[].citystringCity, town or village.
customers[].addresses[].provincestringProvince or city name.
customers[].addresses[].province_codestringProvince code; matches list_provinces.
customers[].addresses[].districtstringWard name under the two-level model (district name before).
customers[].addresses[].district_codestringWard code; matches list_wards.
customers[].addresses[].wardstringWard name under the three-level model; usually empty now.
customers[].addresses[].ward_codestringWard code under the three-level model; usually empty now.
customers[].addresses[].countrystringCountry name.
customers[].addresses[].country_codestringTwo-letter country code, e.g. VN.
customers[].addresses[].zipstringPostal code.
customers[].addresses[].latitudenumberLatitude, if known.
customers[].addresses[].longitudenumberLongitude, if known.
customers[].addresses[].defaultbooleanTrue when this is the default address.
customers[].addresses[].customer_idintegerId of the customer the address belongs to.
customers[].addresses[].country_namestringNormalized country name.
customers[].created_atstringWhen it was created (ISO 8601).
customers[].updated_atstringWhen it was last updated (ISO 8601).
customers[].verified_emailbooleanWhether the customer has verified their email.
customers[].birthdaystring | nullDate of birth (ISO 8601); null when unknown.
customers[].genderinteger | nullGender: 0 female, 1 male, 2 other; null when unknown.
customers[].last_order_datestring | nullWhen the customer last ordered (ISO 8601); null when never.
customers[].multipass_identifierboolean | nullIdentifier 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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcócom.read_customers

Input

FieldNhãnKiểuBắt buộcMô tả
customer_idMã khách hàngintegercóHaravan customer id. Min 1.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
customerKhách hàngobjectThe customer.
customer.idintegerCustomer id.
customer.emailstring | nullEmail.
customer.phonestring | nullPhone number.
customer.first_namestring | nullFirst name.
customer.last_namestring | nullLast name.
customer.accepts_marketingbooleanWhether the customer accepts marketing.
customer.tagsstring | nullComma-separated tags.
customer.notestring | nullNote about the customer.
customer.statestringAccount state.
customer.orders_countintegerNumber of orders.
customer.total_spentnumberTotal spent, VND.
customer.last_order_idinteger | nullLatest order id.
customer.last_order_namestring | nullLatest order name.
customer.default_addressobject | nullDefault address; null when the customer has none.
customer.default_address.idintegerAddress id.
customer.default_address.namestringFull name of the person at this address.
customer.default_address.first_namestringFirst name.
customer.default_address.last_namestringLast name.
customer.default_address.companystringCompany name.
customer.default_address.phonestringPhone number.
customer.default_address.address1stringStreet address: house number and street.
customer.default_address.address2stringSecond address line.
customer.default_address.citystringCity, town or village.
customer.default_address.provincestringProvince or city name.
customer.default_address.province_codestringProvince code; matches list_provinces.
customer.default_address.districtstringWard name under the two-level model (district name before).
customer.default_address.district_codestringWard code; matches list_wards.
customer.default_address.wardstringWard name under the three-level model; usually empty now.
customer.default_address.ward_codestringWard code under the three-level model; usually empty now.
customer.default_address.countrystringCountry name.
customer.default_address.country_codestringTwo-letter country code, e.g. VN.
customer.default_address.zipstringPostal code.
customer.default_address.latitudenumberLatitude, if known.
customer.default_address.longitudenumberLongitude, if known.
customer.default_address.defaultbooleanTrue when this is the default address.
customer.default_address.customer_idintegerId of the customer the address belongs to.
customer.default_address.country_namestringNormalized country name.
customer.addressesarray of objectThe ten most recently updated addresses.
customer.addresses[].idintegerAddress id.
customer.addresses[].namestringFull name of the person at this address.
customer.addresses[].first_namestringFirst name.
customer.addresses[].last_namestringLast name.
customer.addresses[].companystringCompany name.
customer.addresses[].phonestringPhone number.
customer.addresses[].address1stringStreet address: house number and street.
customer.addresses[].address2stringSecond address line.
customer.addresses[].citystringCity, town or village.
customer.addresses[].provincestringProvince or city name.
customer.addresses[].province_codestringProvince code; matches list_provinces.
customer.addresses[].districtstringWard name under the two-level model (district name before).
customer.addresses[].district_codestringWard code; matches list_wards.
customer.addresses[].wardstringWard name under the three-level model; usually empty now.
customer.addresses[].ward_codestringWard code under the three-level model; usually empty now.
customer.addresses[].countrystringCountry name.
customer.addresses[].country_codestringTwo-letter country code, e.g. VN.
customer.addresses[].zipstringPostal code.
customer.addresses[].latitudenumberLatitude, if known.
customer.addresses[].longitudenumberLongitude, if known.
customer.addresses[].defaultbooleanTrue when this is the default address.
customer.addresses[].customer_idintegerId of the customer the address belongs to.
customer.addresses[].country_namestringNormalized country name.
customer.created_atstringWhen it was created (ISO 8601).
customer.updated_atstringWhen it was last updated (ISO 8601).
customer.verified_emailbooleanWhether the customer has verified their email.
customer.birthdaystring | nullDate of birth (ISO 8601); null when unknown.
customer.genderinteger | nullGender: 0 female, 1 male, 2 other; null when unknown.
customer.last_order_datestring | nullWhen the customer last ordered (ISO 8601); null when never.
customer.multipass_identifierboolean | nullIdentifier 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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumcókhôngcom.write_customers

Input

FieldNhãnKiểuBắt buộcMô tả
customerKhách hàngobjectcóThe customer. Other Haravan customer fields are also accepted.
customer.first_namestringkhôngFirst (given) name.
customer.last_namestringkhôngLast (family) name.
customer.emailstringkhôngEmail.
customer.phonestringkhôngPhone number.
customer.notestringkhôngInternal note.
customer.tagsstringkhôngComma-separated tags.
customer.accepts_marketingbooleankhôngAgrees to receive marketing.
customer.addressesarray of objectkhôngAddresses.
customer.addresses[].namestringkhôngRecipient full name.
customer.addresses[].phonestringkhôngRecipient phone number.
customer.addresses[].address1stringkhôngStreet address: house number and street.
customer.addresses[].province_codestringkhôngProvince code from list_provinces.
customer.addresses[].district_codestringkhôngNew ward code from list_wards (two-level model).
customer.addresses[].ward_codestringkhôngLeave empty under the two-level model.
customer.addresses[].country_codestringkhôngCountry code, VN for Vietnam.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
customerKhách hàngobjectThe customer.
customer.idintegerCustomer id.
customer.emailstring | nullEmail.
customer.phonestring | nullPhone number.
customer.first_namestring | nullFirst name.
customer.last_namestring | nullLast name.
customer.accepts_marketingbooleanWhether the customer accepts marketing.
customer.tagsstring | nullComma-separated tags.
customer.notestring | nullNote about the customer.
customer.statestringAccount state.
customer.orders_countintegerNumber of orders.
customer.total_spentnumberTotal spent, VND.
customer.last_order_idinteger | nullLatest order id.
customer.last_order_namestring | nullLatest order name.
customer.default_addressobject | nullDefault address; null when the customer has none.
customer.default_address.idintegerAddress id.
customer.default_address.namestringFull name of the person at this address.
customer.default_address.first_namestringFirst name.
customer.default_address.last_namestringLast name.
customer.default_address.companystringCompany name.
customer.default_address.phonestringPhone number.
customer.default_address.address1stringStreet address: house number and street.
customer.default_address.address2stringSecond address line.
customer.default_address.citystringCity, town or village.
customer.default_address.provincestringProvince or city name.
customer.default_address.province_codestringProvince code; matches list_provinces.
customer.default_address.districtstringWard name under the two-level model (district name before).
customer.default_address.district_codestringWard code; matches list_wards.
customer.default_address.wardstringWard name under the three-level model; usually empty now.
customer.default_address.ward_codestringWard code under the three-level model; usually empty now.
customer.default_address.countrystringCountry name.
customer.default_address.country_codestringTwo-letter country code, e.g. VN.
customer.default_address.zipstringPostal code.
customer.default_address.latitudenumberLatitude, if known.
customer.default_address.longitudenumberLongitude, if known.
customer.default_address.defaultbooleanTrue when this is the default address.
customer.default_address.customer_idintegerId of the customer the address belongs to.
customer.default_address.country_namestringNormalized country name.
customer.addressesarray of objectThe ten most recently updated addresses.
customer.addresses[].idintegerAddress id.
customer.addresses[].namestringFull name of the person at this address.
customer.addresses[].first_namestringFirst name.
customer.addresses[].last_namestringLast name.
customer.addresses[].companystringCompany name.
customer.addresses[].phonestringPhone number.
customer.addresses[].address1stringStreet address: house number and street.
customer.addresses[].address2stringSecond address line.
customer.addresses[].citystringCity, town or village.
customer.addresses[].provincestringProvince or city name.
customer.addresses[].province_codestringProvince code; matches list_provinces.
customer.addresses[].districtstringWard name under the two-level model (district name before).
customer.addresses[].district_codestringWard code; matches list_wards.
customer.addresses[].wardstringWard name under the three-level model; usually empty now.
customer.addresses[].ward_codestringWard code under the three-level model; usually empty now.
customer.addresses[].countrystringCountry name.
customer.addresses[].country_codestringTwo-letter country code, e.g. VN.
customer.addresses[].zipstringPostal code.
customer.addresses[].latitudenumberLatitude, if known.
customer.addresses[].longitudenumberLongitude, if known.
customer.addresses[].defaultbooleanTrue when this is the default address.
customer.addresses[].customer_idintegerId of the customer the address belongs to.
customer.addresses[].country_namestringNormalized country name.
customer.created_atstringWhen it was created (ISO 8601).
customer.updated_atstringWhen it was last updated (ISO 8601).
customer.verified_emailbooleanWhether the customer has verified their email.
customer.birthdaystring | nullDate of birth (ISO 8601); null when unknown.
customer.genderinteger | nullGender: 0 female, 1 male, 2 other; null when unknown.
customer.last_order_datestring | nullWhen the customer last ordered (ISO 8601); null when never.
customer.multipass_identifierboolean | nullIdentifier 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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumcócócom.write_customers

Input

FieldNhãnKiểuBắt buộcMô tả
customer_idMã khách hàngintegercóHaravan customer id. Min 1.
customerThông tin cập nhậtobjectcóFields to change.
customer.first_namestringkhôngFirst (given) name.
customer.last_namestringkhôngLast (family) name.
customer.emailstringkhôngEmail.
customer.phonestringkhôngPhone number.
customer.notestringkhôngInternal note.
customer.tagsstringkhôngComma-separated tags.
customer.accepts_marketingbooleankhôngAgrees to receive marketing.
customer.addressesarray of objectkhôngAddresses.
customer.addresses[].namestringkhôngRecipient full name.
customer.addresses[].phonestringkhôngRecipient phone number.
customer.addresses[].address1stringkhôngStreet address: house number and street.
customer.addresses[].province_codestringkhôngProvince code from list_provinces.
customer.addresses[].district_codestringkhôngNew ward code from list_wards (two-level model).
customer.addresses[].ward_codestringkhôngLeave empty under the two-level model.
customer.addresses[].country_codestringkhôngCountry code, VN for Vietnam.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
customerKhách hàngobjectThe customer.
customer.idintegerCustomer id.
customer.emailstring | nullEmail.
customer.phonestring | nullPhone number.
customer.first_namestring | nullFirst name.
customer.last_namestring | nullLast name.
customer.accepts_marketingbooleanWhether the customer accepts marketing.
customer.tagsstring | nullComma-separated tags.
customer.notestring | nullNote about the customer.
customer.statestringAccount state.
customer.orders_countintegerNumber of orders.
customer.total_spentnumberTotal spent, VND.
customer.last_order_idinteger | nullLatest order id.
customer.last_order_namestring | nullLatest order name.
customer.default_addressobject | nullDefault address; null when the customer has none.
customer.default_address.idintegerAddress id.
customer.default_address.namestringFull name of the person at this address.
customer.default_address.first_namestringFirst name.
customer.default_address.last_namestringLast name.
customer.default_address.companystringCompany name.
customer.default_address.phonestringPhone number.
customer.default_address.address1stringStreet address: house number and street.
customer.default_address.address2stringSecond address line.
customer.default_address.citystringCity, town or village.
customer.default_address.provincestringProvince or city name.
customer.default_address.province_codestringProvince code; matches list_provinces.
customer.default_address.districtstringWard name under the two-level model (district name before).
customer.default_address.district_codestringWard code; matches list_wards.
customer.default_address.wardstringWard name under the three-level model; usually empty now.
customer.default_address.ward_codestringWard code under the three-level model; usually empty now.
customer.default_address.countrystringCountry name.
customer.default_address.country_codestringTwo-letter country code, e.g. VN.
customer.default_address.zipstringPostal code.
customer.default_address.latitudenumberLatitude, if known.
customer.default_address.longitudenumberLongitude, if known.
customer.default_address.defaultbooleanTrue when this is the default address.
customer.default_address.customer_idintegerId of the customer the address belongs to.
customer.default_address.country_namestringNormalized country name.
customer.addressesarray of objectThe ten most recently updated addresses.
customer.addresses[].idintegerAddress id.
customer.addresses[].namestringFull name of the person at this address.
customer.addresses[].first_namestringFirst name.
customer.addresses[].last_namestringLast name.
customer.addresses[].companystringCompany name.
customer.addresses[].phonestringPhone number.
customer.addresses[].address1stringStreet address: house number and street.
customer.addresses[].address2stringSecond address line.
customer.addresses[].citystringCity, town or village.
customer.addresses[].provincestringProvince or city name.
customer.addresses[].province_codestringProvince code; matches list_provinces.
customer.addresses[].districtstringWard name under the two-level model (district name before).
customer.addresses[].district_codestringWard code; matches list_wards.
customer.addresses[].wardstringWard name under the three-level model; usually empty now.
customer.addresses[].ward_codestringWard code under the three-level model; usually empty now.
customer.addresses[].countrystringCountry name.
customer.addresses[].country_codestringTwo-letter country code, e.g. VN.
customer.addresses[].zipstringPostal code.
customer.addresses[].latitudenumberLatitude, if known.
customer.addresses[].longitudenumberLongitude, if known.
customer.addresses[].defaultbooleanTrue when this is the default address.
customer.addresses[].customer_idintegerId of the customer the address belongs to.
customer.addresses[].country_namestringNormalized country name.
customer.created_atstringWhen it was created (ISO 8601).
customer.updated_atstringWhen it was last updated (ISO 8601).
customer.verified_emailbooleanWhether the customer has verified their email.
customer.birthdaystring | nullDate of birth (ISO 8601); null when unknown.
customer.genderinteger | nullGender: 0 female, 1 male, 2 other; null when unknown.
customer.last_order_datestring | nullWhen the customer last ordered (ISO 8601); null when never.
customer.multipass_identifierboolean | nullIdentifier 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 độngRủi roCần duyệtIdempotentScopes
WRITEhighcócócom.write_customers

Input

FieldNhãnKiểuBắt buộcMô tả
customer_idMã khách hàngintegercó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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumcókhôngcom.write_customers

Input

FieldNhãnKiểuBắt buộcMô tả
customer_idMã khách hàngintegercóHaravan customer id. Min 1.
tagsThẻstringcóComma-separated tags, e.g. 'vip,zalo'.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
tagsThẻstring | nullCustomer tags after the change.

Xoá thẻ khách hàng (Remove customer tags) — haravan.remove_customer_tags ​

Remove tags from a customer.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEmediumcócócom.write_customers

Input

FieldNhãnKiểuBắt buộcMô tả
customer_idMã khách hàngintegercóHaravan customer id. Min 1.
tagsThẻstringcóComma-separated tags, e.g. 'vip,zalo'.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
tagsThẻstring | nullCustomer 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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcócom.read_customers

Input

FieldNhãnKiểuBắt buộcMô tả
customer_idMã khách hàngintegercóHaravan customer id. Min 1.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
addressesDanh sách địa chỉarray of objectAddresses.
addresses[].idintegerAddress id.
addresses[].namestringFull name of the person at this address.
addresses[].first_namestringFirst name.
addresses[].last_namestringLast name.
addresses[].companystringCompany name.
addresses[].phonestringPhone number.
addresses[].address1stringStreet address: house number and street.
addresses[].address2stringSecond address line.
addresses[].citystringCity, town or village.
addresses[].provincestringProvince or city name.
addresses[].province_codestringProvince code; matches list_provinces.
addresses[].districtstringWard name under the two-level model (district name before).
addresses[].district_codestringWard code; matches list_wards.
addresses[].wardstringWard name under the three-level model; usually empty now.
addresses[].ward_codestringWard code under the three-level model; usually empty now.
addresses[].countrystringCountry name.
addresses[].country_codestringTwo-letter country code, e.g. VN.
addresses[].zipstringPostal code.
addresses[].latitudenumberLatitude, if known.
addresses[].longitudenumberLongitude, if known.
addresses[].defaultbooleanTrue when this is the default address.
addresses[].customer_idintegerId of the customer the address belongs to.
addresses[].country_namestringNormalized 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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumcókhôngcom.write_customers

Input

FieldNhãnKiểuBắt buộcMô tả
customer_idMã khách hàngintegercóHaravan customer id. Min 1.
addressĐịa chỉobjectcóThe address.
address.namestringkhôngRecipient full name.
address.phonestringkhôngRecipient phone number.
address.address1stringkhôngStreet address: house number and street.
address.province_codestringkhôngProvince code from list_provinces.
address.district_codestringkhôngNew ward code from list_wards (two-level model).
address.ward_codestringkhôngLeave empty under the two-level model.
address.country_codestringkhôngCountry code, VN for Vietnam.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
customer_addressĐịa chỉobjectThe address.
customer_address.idintegerAddress id.
customer_address.namestringFull name of the person at this address.
customer_address.first_namestringFirst name.
customer_address.last_namestringLast name.
customer_address.companystringCompany name.
customer_address.phonestringPhone number.
customer_address.address1stringStreet address: house number and street.
customer_address.address2stringSecond address line.
customer_address.citystringCity, town or village.
customer_address.provincestringProvince or city name.
customer_address.province_codestringProvince code; matches list_provinces.
customer_address.districtstringWard name under the two-level model (district name before).
customer_address.district_codestringWard code; matches list_wards.
customer_address.wardstringWard name under the three-level model; usually empty now.
customer_address.ward_codestringWard code under the three-level model; usually empty now.
customer_address.countrystringCountry name.
customer_address.country_codestringTwo-letter country code, e.g. VN.
customer_address.zipstringPostal code.
customer_address.latitudenumberLatitude, if known.
customer_address.longitudenumberLongitude, if known.
customer_address.defaultbooleanTrue when this is the default address.
customer_address.customer_idintegerId of the customer the address belongs to.
customer_address.country_namestringNormalized 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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumcócócom.write_customers

Input

FieldNhãnKiểuBắt buộcMô tả
customer_idMã khách hàngintegercóHaravan customer id. Min 1.
address_idMã địa chỉintegercóCustomer address id. Min 1.
addressĐịa chỉobjectcóFields to change.
address.namestringkhôngRecipient full name.
address.phonestringkhôngRecipient phone number.
address.address1stringkhôngStreet address: house number and street.
address.province_codestringkhôngProvince code from list_provinces.
address.district_codestringkhôngNew ward code from list_wards (two-level model).
address.ward_codestringkhôngLeave empty under the two-level model.
address.country_codestringkhôngCountry code, VN for Vietnam.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
customer_addressĐịa chỉobjectThe address.
customer_address.idintegerAddress id.
customer_address.namestringFull name of the person at this address.
customer_address.first_namestringFirst name.
customer_address.last_namestringLast name.
customer_address.companystringCompany name.
customer_address.phonestringPhone number.
customer_address.address1stringStreet address: house number and street.
customer_address.address2stringSecond address line.
customer_address.citystringCity, town or village.
customer_address.provincestringProvince or city name.
customer_address.province_codestringProvince code; matches list_provinces.
customer_address.districtstringWard name under the two-level model (district name before).
customer_address.district_codestringWard code; matches list_wards.
customer_address.wardstringWard name under the three-level model; usually empty now.
customer_address.ward_codestringWard code under the three-level model; usually empty now.
customer_address.countrystringCountry name.
customer_address.country_codestringTwo-letter country code, e.g. VN.
customer_address.zipstringPostal code.
customer_address.latitudenumberLatitude, if known.
customer_address.longitudenumberLongitude, if known.
customer_address.defaultbooleanTrue when this is the default address.
customer_address.customer_idintegerId of the customer the address belongs to.
customer_address.country_namestringNormalized 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 độngRủi roCần duyệtIdempotentScopes
WRITEhighcócócom.write_customers

Input

FieldNhãnKiểuBắt buộcMô tả
customer_idMã khách hàngintegercóHaravan customer id. Min 1.
address_idMã địa chỉintegercó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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumcócócom.write_customers

Input

FieldNhãnKiểuBắt buộcMô tả
customer_idMã khách hàngintegercóHaravan customer id. Min 1.
address_idMã địa chỉintegercóCustomer address id. Min 1.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
customer_addressĐịa chỉobjectThe address.
customer_address.idintegerAddress id.
customer_address.namestringFull name of the person at this address.
customer_address.first_namestringFirst name.
customer_address.last_namestringLast name.
customer_address.companystringCompany name.
customer_address.phonestringPhone number.
customer_address.address1stringStreet address: house number and street.
customer_address.address2stringSecond address line.
customer_address.citystringCity, town or village.
customer_address.provincestringProvince or city name.
customer_address.province_codestringProvince code; matches list_provinces.
customer_address.districtstringWard name under the two-level model (district name before).
customer_address.district_codestringWard code; matches list_wards.
customer_address.wardstringWard name under the three-level model; usually empty now.
customer_address.ward_codestringWard code under the three-level model; usually empty now.
customer_address.countrystringCountry name.
customer_address.country_codestringTwo-letter country code, e.g. VN.
customer_address.zipstringPostal code.
customer_address.latitudenumberLatitude, if known.
customer_address.longitudenumberLongitude, if known.
customer_address.defaultbooleanTrue when this is the default address.
customer_address.customer_idintegerId of the customer the address belongs to.
customer_address.country_namestringNormalized country name.