Skip to content

Haravan — Customers ​

List customers — haravan.list_customers ​

List customers, optionally created or updated in a date range.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyescom.read_customers

Input

FieldTypeRequiredDescription
created_at_minstringnoCreated at or after (ISO 8601).
created_at_maxstringnoCreated at or before (ISO 8601).
updated_at_minstringnoUpdated at or after (ISO 8601).
since_idintegernoOnly customers after this id. Min 1.
pageintegernoPage number, from 1. Min 1.
limitintegernoItems per page (1-50, default 50). Min 1. Max 50.

Extra fields: ignored.

Output

FieldTypeDescription
customersarray 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.

Search customers — haravan.search_customers ​

Find customers by name, phone number or email.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyescom.read_customers

Input

FieldTypeRequiredDescription
querystringyesName, phone or email to search for.
pageintegernoPage number, from 1. Min 1.
limitintegernoItems per page (1-50, default 50). Min 1. Max 50.

Extra fields: ignored.

Output

FieldTypeDescription
customersarray 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.

Get customer — haravan.get_customer ​

Get one customer with contact details, addresses and order totals.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyescom.read_customers

Input

FieldTypeRequiredDescription
customer_idintegeryesHaravan customer id. Min 1.

Extra fields: ignored.

Output

FieldTypeDescription
customerobjectThe 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.

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.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumyesnocom.write_customers

Input

FieldTypeRequiredDescription
customerobjectyesThe customer. Other Haravan customer fields are also accepted.
customer.first_namestringnoFirst (given) name.
customer.last_namestringnoLast (family) name.
customer.emailstringnoEmail.
customer.phonestringnoPhone number.
customer.notestringnoInternal note.
customer.tagsstringnoComma-separated tags.
customer.accepts_marketingbooleannoAgrees to receive marketing.
customer.addressesarray of objectnoAddresses.
customer.addresses[].namestringnoRecipient full name.
customer.addresses[].phonestringnoRecipient phone number.
customer.addresses[].address1stringnoStreet address: house number and street.
customer.addresses[].province_codestringnoProvince code from list_provinces.
customer.addresses[].district_codestringnoNew ward code from list_wards (two-level model).
customer.addresses[].ward_codestringnoLeave empty under the two-level model.
customer.addresses[].country_codestringnoCountry code, VN for Vietnam.

Extra fields: ignored.

Output

FieldTypeDescription
customerobjectThe 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.

Update customer — haravan.update_customer ​

Update a customer's name, contact details, note, tags or marketing consent.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumyesyescom.write_customers

Input

FieldTypeRequiredDescription
customer_idintegeryesHaravan customer id. Min 1.
customerobjectyesFields to change.
customer.first_namestringnoFirst (given) name.
customer.last_namestringnoLast (family) name.
customer.emailstringnoEmail.
customer.phonestringnoPhone number.
customer.notestringnoInternal note.
customer.tagsstringnoComma-separated tags.
customer.accepts_marketingbooleannoAgrees to receive marketing.
customer.addressesarray of objectnoAddresses.
customer.addresses[].namestringnoRecipient full name.
customer.addresses[].phonestringnoRecipient phone number.
customer.addresses[].address1stringnoStreet address: house number and street.
customer.addresses[].province_codestringnoProvince code from list_provinces.
customer.addresses[].district_codestringnoNew ward code from list_wards (two-level model).
customer.addresses[].ward_codestringnoLeave empty under the two-level model.
customer.addresses[].country_codestringnoCountry code, VN for Vietnam.

Extra fields: ignored.

Output

FieldTypeDescription
customerobjectThe 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.

Delete customer — haravan.delete_customer ​

Delete a customer. Customers with orders cannot be deleted.

Side effectRiskNeeds approvalIdempotentScopes
WRITEhighyesyescom.write_customers

Input

FieldTypeRequiredDescription
customer_idintegeryesHaravan customer id. Min 1.

Extra fields: ignored.

Output

Returns an empty object.

Add customer tags — haravan.add_customer_tags ​

Add tags to a customer; existing tags are kept.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumyesnocom.write_customers

Input

FieldTypeRequiredDescription
customer_idintegeryesHaravan customer id. Min 1.
tagsstringyesComma-separated tags, e.g. 'vip,zalo'.

Extra fields: ignored.

Output

FieldTypeDescription
tagsstring | nullCustomer tags after the change.

Remove customer tags — haravan.remove_customer_tags ​

Remove tags from a customer.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumyesyescom.write_customers

Input

FieldTypeRequiredDescription
customer_idintegeryesHaravan customer id. Min 1.
tagsstringyesComma-separated tags, e.g. 'vip,zalo'.

Extra fields: ignored.

Output

FieldTypeDescription
tagsstring | nullCustomer tags after the change.

List customer addresses — haravan.list_customer_addresses ​

List a customer's saved addresses.

Side effectRiskNeeds approvalIdempotentScopes
NONElownoyescom.read_customers

Input

FieldTypeRequiredDescription
customer_idintegeryesHaravan customer id. Min 1.

Extra fields: ignored.

Output

FieldTypeDescription
addressesarray 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.

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.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumyesnocom.write_customers

Input

FieldTypeRequiredDescription
customer_idintegeryesHaravan customer id. Min 1.
addressobjectyesThe address.
address.namestringnoRecipient full name.
address.phonestringnoRecipient phone number.
address.address1stringnoStreet address: house number and street.
address.province_codestringnoProvince code from list_provinces.
address.district_codestringnoNew ward code from list_wards (two-level model).
address.ward_codestringnoLeave empty under the two-level model.
address.country_codestringnoCountry code, VN for Vietnam.

Extra fields: ignored.

Output

FieldTypeDescription
customer_addressobjectThe 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.

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.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumyesyescom.write_customers

Input

FieldTypeRequiredDescription
customer_idintegeryesHaravan customer id. Min 1.
address_idintegeryesCustomer address id. Min 1.
addressobjectyesFields to change.
address.namestringnoRecipient full name.
address.phonestringnoRecipient phone number.
address.address1stringnoStreet address: house number and street.
address.province_codestringnoProvince code from list_provinces.
address.district_codestringnoNew ward code from list_wards (two-level model).
address.ward_codestringnoLeave empty under the two-level model.
address.country_codestringnoCountry code, VN for Vietnam.

Extra fields: ignored.

Output

FieldTypeDescription
customer_addressobjectThe 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.

Delete customer address — haravan.delete_customer_address ​

Delete a saved customer address. The default address cannot be deleted.

Side effectRiskNeeds approvalIdempotentScopes
WRITEhighyesyescom.write_customers

Input

FieldTypeRequiredDescription
customer_idintegeryesHaravan customer id. Min 1.
address_idintegeryesCustomer address id. Min 1.

Extra fields: ignored.

Output

Returns an empty object.

Set default customer address — haravan.set_default_customer_address ​

Make a saved address the customer's default address.

Side effectRiskNeeds approvalIdempotentScopes
WRITEmediumyesyescom.write_customers

Input

FieldTypeRequiredDescription
customer_idintegeryesHaravan customer id. Min 1.
address_idintegeryesCustomer address id. Min 1.

Extra fields: ignored.

Output

FieldTypeDescription
customer_addressobjectThe 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.