Haravan — Customers
List customers — haravan.list_customers
List customers, optionally created or updated in a date range.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | no | yes | com.read_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
created_at_min | string | no | Created at or after (ISO 8601). |
created_at_max | string | no | Created at or before (ISO 8601). |
updated_at_min | string | no | Updated at or after (ISO 8601). |
since_id | integer | no | Only customers after this id. Min 1. |
page | integer | no | Page number, from 1. Min 1. |
limit | integer | no | Items per page (1-50, default 50). Min 1. Max 50. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
customers | 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. |
Search customers — haravan.search_customers
Find customers by name, phone number or email.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | no | yes | com.read_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
query | string | yes | Name, phone or email to search for. |
page | integer | no | Page number, from 1. Min 1. |
limit | integer | no | Items per page (1-50, default 50). Min 1. Max 50. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
customers | 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. |
Get customer — haravan.get_customer
Get one customer with contact details, addresses and order totals.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | no | yes | com.read_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | integer | yes | Haravan customer id. Min 1. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
customer | 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. |
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 effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | yes | no | com.write_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
customer | object | yes | The customer. Other Haravan customer fields are also accepted. |
customer.first_name | string | no | First (given) name. |
customer.last_name | string | no | Last (family) name. |
customer.email | string | no | Email. |
customer.phone | string | no | Phone number. |
customer.note | string | no | Internal note. |
customer.tags | string | no | Comma-separated tags. |
customer.accepts_marketing | boolean | no | Agrees to receive marketing. |
customer.addresses | array of object | no | Addresses. |
customer.addresses[].name | string | no | Recipient full name. |
customer.addresses[].phone | string | no | Recipient phone number. |
customer.addresses[].address1 | string | no | Street address: house number and street. |
customer.addresses[].province_code | string | no | Province code from list_provinces. |
customer.addresses[].district_code | string | no | New ward code from list_wards (two-level model). |
customer.addresses[].ward_code | string | no | Leave empty under the two-level model. |
customer.addresses[].country_code | string | no | Country code, VN for Vietnam. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
customer | 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. |
Update customer — haravan.update_customer
Update a customer's name, contact details, note, tags or marketing consent.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | yes | yes | com.write_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | integer | yes | Haravan customer id. Min 1. |
customer | object | yes | Fields to change. |
customer.first_name | string | no | First (given) name. |
customer.last_name | string | no | Last (family) name. |
customer.email | string | no | Email. |
customer.phone | string | no | Phone number. |
customer.note | string | no | Internal note. |
customer.tags | string | no | Comma-separated tags. |
customer.accepts_marketing | boolean | no | Agrees to receive marketing. |
customer.addresses | array of object | no | Addresses. |
customer.addresses[].name | string | no | Recipient full name. |
customer.addresses[].phone | string | no | Recipient phone number. |
customer.addresses[].address1 | string | no | Street address: house number and street. |
customer.addresses[].province_code | string | no | Province code from list_provinces. |
customer.addresses[].district_code | string | no | New ward code from list_wards (two-level model). |
customer.addresses[].ward_code | string | no | Leave empty under the two-level model. |
customer.addresses[].country_code | string | no | Country code, VN for Vietnam. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
customer | 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. |
Delete customer — haravan.delete_customer
Delete a customer. Customers with orders cannot be deleted.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | yes | yes | com.write_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | integer | yes | Haravan 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 effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | yes | no | com.write_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | integer | yes | Haravan customer id. Min 1. |
tags | string | yes | Comma-separated tags, e.g. 'vip,zalo'. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
tags | string | null | Customer tags after the change. |
Remove customer tags — haravan.remove_customer_tags
Remove tags from a customer.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | yes | yes | com.write_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | integer | yes | Haravan customer id. Min 1. |
tags | string | yes | Comma-separated tags, e.g. 'vip,zalo'. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
tags | string | null | Customer tags after the change. |
List customer addresses — haravan.list_customer_addresses
List a customer's saved addresses.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | no | yes | com.read_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | integer | yes | Haravan customer id. Min 1. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
addresses | 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. |
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 effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | yes | no | com.write_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | integer | yes | Haravan customer id. Min 1. |
address | object | yes | The address. |
address.name | string | no | Recipient full name. |
address.phone | string | no | Recipient phone number. |
address.address1 | string | no | Street address: house number and street. |
address.province_code | string | no | Province code from list_provinces. |
address.district_code | string | no | New ward code from list_wards (two-level model). |
address.ward_code | string | no | Leave empty under the two-level model. |
address.country_code | string | no | Country code, VN for Vietnam. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
customer_address | 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. |
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 effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | yes | yes | com.write_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | integer | yes | Haravan customer id. Min 1. |
address_id | integer | yes | Customer address id. Min 1. |
address | object | yes | Fields to change. |
address.name | string | no | Recipient full name. |
address.phone | string | no | Recipient phone number. |
address.address1 | string | no | Street address: house number and street. |
address.province_code | string | no | Province code from list_provinces. |
address.district_code | string | no | New ward code from list_wards (two-level model). |
address.ward_code | string | no | Leave empty under the two-level model. |
address.country_code | string | no | Country code, VN for Vietnam. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
customer_address | 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. |
Delete customer address — haravan.delete_customer_address
Delete a saved customer address. The default address cannot be deleted.
| Side effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | yes | yes | com.write_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | integer | yes | Haravan customer id. Min 1. |
address_id | integer | yes | Customer 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 effect | Risk | Needs approval | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | yes | yes | com.write_customers |
Input
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | integer | yes | Haravan customer id. Min 1. |
address_id | integer | yes | Customer address id. Min 1. |
Extra fields: ignored.
Output
| Field | Type | Description |
|---|---|---|
customer_address | 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. |