### Product Image Properties Examples Source: https://docs.haravan.com/docs/omni-apis/product-images Examples of product image properties returned by the API. ```json "created_at": "2021-05-13T07:29:20.1Z" ``` ```json "position": 1 ``` ```json "product_id": 632910392 ``` ```json "variant_ids": [808950810,808950811] ``` ```json "src": "http://static.haravan.com/products/ipod-nano.png" ``` ```json "updated_at":"2021-05-13T07:29:20.808Z" ``` -------------------------------- ### Subscription Property Examples Source: https://docs.haravan.com/docs/omni-apis/subscription Examples of individual JSON fields for the Subscription resource. ```json "id": "6141d6266e269fed5b515c89" ``` ```json "client_id": "9ca6a90a2f50d894e6a123f5cd7ffa62" ``` ```json "created_at": "2021-09-15T11:17:03.458Z" ``` ```json "updated_at": "2021-09-15T11:17:03.458Z" ``` ```json "expired_at": "2024-08-29T11:17:00Z" ``` ```json "cancelled_at": null ``` ```json "name": "Promotion Bar" ``` ```json "price": 1200000 ``` ```json "plan_id": "plan_app_449_1713" ``` ```json "quantity": 1 ``` ```json "discount_amounts": 0 ``` ```json "total": 1200000 ``` ```json "amount_paid": 1200000 ``` ```json "status": "active" ``` -------------------------------- ### Redirect Properties Example Source: https://docs.haravan.com/docs/omni-apis/redirects Example showing the structure of redirect properties like 'id', 'path', and 'target'. ```json "id": 304339089 ``` ```json "path": "/products.php" ``` ```json "target": "/products" ``` -------------------------------- ### Product Response Example Source: https://docs.haravan.com/docs/omni-apis/products This is an example of a successful HTTP 200 OK response when retrieving product data. It includes details about product variants, images, and creation/update timestamps. ```JSON HTTP/1.1 200 OK { "products": [ { "body_html": "Chất vải: Thun Cotton", "body_plain": null, "created_at": "2020-10-22T03:37:03.058Z", "handle": "vay-quay-dai", "id": 1028655526, "images": [ { "created_at": "2020-10-22T03:37:03.058", "id": 1169154560, "position": 1, "product_id": 1028655526, "src": "https://product.hstatic.net/200000244883/product/nu-7_1d372396a90344edae573a36e40a16d2_52f954b5b29f45b78efdc79540db1cb7_4b75995326454a3a8eb9d5b571d78b81.jpg", "updated_at": "2020-10-22T03:37:03.058", "filename": "nu-7_1d372396a90344edae573a36e40a16d2_52f954b5b29f45b78efdc79540db1cb7_4b75995326454a3a8eb9d5b571d78b81.jpg", "variant_ids": [ 1063014645 ] }, { "created_at": "2020-10-22T03:37:03.058", "id": 1169154575, "position": 7, "product_id": 1028655526, "src": "https://product.hstatic.net/200000244883/product/-7-8_98039f12edbe4ffcbab183935b58b9f2_a6072a8e86c246eaaa20c672a24b615c_9652be441fa34dfcbc09df796779ca21.jpg", "updated_at": "2020-10-22T03:37:03.058", "filename": "-7-8_98039f12edbe4ffcbab183935b58b9f2_a6072a8e86c246eaaa20c672a24b615c_9652be441fa34dfcbc09df796779ca21.jpg", "variant_ids": [] } ], "product_type": "Khác", "published_at": "2020-10-22T03:37:00.905Z", "published_scope": "global", "tags": null, "template_suffix": "product", "title": "Váy Quây dài", "updated_at": "2020-10-22T03:37:08.195Z", "variants": [ { "barcode": null, "compare_at_price": 800000.0000, "created_at": "2020-10-22T03:37:03.058Z", "fulfillment_service": null, "grams": 0.0000, "id": 1063014645, "inventory_management": null, "inventory_policy": "deny", "inventory_quantity": 0, "position": 1, "price": 600000.0000, "product_id": 1028655526, "requires_shipping": true, "sku": "AO551", "taxable": true, "title": "Đen / S", "updated_at": "2020-10-22T03:37:03.121Z", "image_id": 1169154560, "option1": "Đen", "option2": "S", "option3": null, "inventory_advance": null }, { "barcode": null, "compare_at_price": 800000.0000, "created_at": "2020-10-22T03:37:03.058Z", "fulfillment_service": null, "grams": 0.0000, "id": 1063014647, "inventory_management": null, "inventory_policy": "deny", "inventory_quantity": 0, "position": 2, "price": 600000.0000, ``` -------------------------------- ### Example Webhook Payload Source: https://docs.haravan.com/docs/omni-apis/subscription Example of an app_subscriptions/update webhook request. ```http POST HTTP/1.1 Headers: Content-Type: application/json; charset=utf-8 X-Haravan-HmacSha256: t4mhmjWKTfHND1kC9nWFXtvKyOCYj3rUUycIfkKl6Cw= X-Haravan-Topic: app_subscriptions/update X-Haravan-Org-Id: 1000114691 X-Haravan-Subscription-Id: 6141d6266e269fed5b515c89 Body: { "id": "6141d6266e269fed5b515c89", "client_id": "9ca6a90a2f50d894e6a123f5cd7ffa62", "created_at": "2021-09-15T11:17:03.458Z", "updated_at": "2021-09-15T11:17:03.458Z", "expired_at": "2024-08-29T11:17:00Z", "cancelled_at": null, "name": "Promotion Bar", "price": 1200000, "plan_id": "plan_app_449_1713", "quantity": 1, "discount_amounts": 0, "total": 1200000, "amount_paid": 1200000, "status": "active" } ``` -------------------------------- ### User Properties Examples Source: https://docs.haravan.com/docs/omni-apis/user Examples of user properties like account owner status, bio, email, name, ID, IM, and permissions. ```json "account_owner": false ``` ```json "bio": "A person on a mission" ``` ```json "email": "joe@example.com" ``` ```json "first_name": "Joe" ``` ```json "id":1234567890 ``` ```json "im" : "joe-chat@example.com" ``` ```json "last_name": "Smith" ``` ```json "permissions":["limited", "orders", "products"] ``` -------------------------------- ### Product Details Response Example Source: https://docs.haravan.com/docs/omni-apis/products This is an example of a successful HTTP 200 OK response when retrieving product details. It contains an array of products with their respective information. ```HTTP HTTP/1.1 200 OK { "products": [ { "body_html": " Tai nghe Bluetooth True Wireless Mozard DT920 Đen giá rẻ, chính hãng, âm thanh chất lượng cao. Giao hàng tận nơi.", "body_plain": null, "created_at": "2021-05-20T14:40:14.648Z", "handle": "tai-nghe-bluetooth-true-wireless-mozard-dt920-den", "id": 1033237384, "images": [ { "created_at": "2021-05-20T14:40:14.648", "id": 1196228927, "position": 1, "product_id": 1033237384, "src": "https://product.hstatic.net/200000219339/product/tai-nghe-bluetooth-true-wireless-mozard-dt920-den-1-org_b2e65f00bb80419a8d18d5da6057c5fe.jpg", "updated_at": "2021-05-20T14:40:14.648", "filename": "tai-nghe-bluetooth-true-wireless-mozard-dt920-den-1-org_b2e65f00bb80419a8d18d5da6057c5fe.jpg", "variant_ids": [ 1073120878 ] } ], "product_type": "Khác", "published_at": "2021-05-20T14:40:11.148Z", "published_scope": "global", "tags": "dienmayxanh", "template_suffix": "product", "title": "Tai nghe Bluetooth True Wireless Mozard DT920 Đen", "updated_at": "2021-05-20T14:40:15.838Z", "variants": [ { "barcode": null, "compare_at_price": 0.0000, "created_at": "2021-05-20T14:40:14.648Z", "fulfillment_service": null, "grams": 0.0000, "id": 1073120878, "inventory_management": null, "inventory_policy": "deny", "inventory_quantity": 0, "position": 1, "price": 950000.0000, "product_id": 1033237384, "requires_shipping": false, "sku": null, "taxable": false, "title": "Tai nghe Bluetooth True Wireless Mozard DT920 Đen", "updated_at": "2021-05-20T14:40:15.838Z", "image_id": 1196228927, "option1": "Tai nghe Bluetooth True Wireless Mozard DT920 Đen", "option2": null, "option3": null, "inventory_advance": null } ], "vendor": "Khác", "options": [ { "name": "Title", "id": 2427727973, "position": 1, "product_id": 1033237384 } ], "only_hide_from_list": false, "not_allow_promotion": false }, { "body_html": " Điện thoại Samsung Galaxy S21 | Cập nhật thông tin ra mắt, hình ảnh, cấu hình và đánh giá chi tiết nhanh và chính xác. Giải đáp thắc mắc khách hàng ngay tại đây. Click ngay ", "body_plain": null, "created_at": "2021-05-20T14:46:44.959Z", "handle": "dien-thoai-samsung-galaxy-s21-5g-7", "id": 1033237559, "images": [ { "created_at": "2021-05-20T14:46:44.961", "id": 1196230403, "position": 19, "product_id": 1033237559, ``` -------------------------------- ### Customer Response Example Source: https://docs.haravan.com/docs/omni-apis/customer This is an example of a successful response when retrieving customer data. It includes details about the customer and their addresses. ```json HTTP/1.1 200 OK { "customers": [ { "accepts_marketing": false, "addresses": [ { "address1": "182 Lê Đại Hành", "address2": null, "city": null, "company": null, "country": "Vietnam", "first_name": "Haravan Demo", "id": 1058135354, "last_name": null, "phone": null, "province": "Hồ Chí Minh", "zip": "70000", "name": " Haravan Demo", "province_code": "HC", "country_code": "vn", "default": true, "district": "Quận 11", "district_code": "HC476", "ward": "Phường 15", "ward_code": "27208" } ], "created_at": "2020-10-22T03:37:03.796Z", "default_address": { "address1": "182 Lê Đại Hành", "address2": null, "city": null, "company": null, "country": "Vietnam", "first_name": "Haravan Demo", "id": 1058135354, "last_name": null, "phone": null, "province": "Hồ Chí Minh", "zip": "70000", "name": " Haravan Demo", "province_code": "HC", "country_code": "vn", "default": true, "district": "Quận 11", "district_code": "HC476", "ward": "Phường 15", "ward_code": "27208" }, "email": "hello@haravan.com", "phone": null, "first_name": "Haravan Demo", "id": 1037889951, "multipass_identifier": null, "last_name": null, "last_order_id": 1146065300, "last_order_name": "#100027", "note": null, "orders_count": 28, "state": "Disabled", "tags": null, "total_spent": 261380000.0000, "total_paid": 0.0, "updated_at": "2020-10-22T03:37:09Z", "verified_email": false, "group_name": null, "birthday": null, "gender": null, "last_order_date": "2020-10-23T07:37:04Z" } ] } ``` -------------------------------- ### Retrieve Purchase Returns List Source: https://docs.haravan.com/docs/omni-apis/inventory-purchase-returns Example of a GET request to retrieve purchase returns with pagination and the corresponding JSON response. ```http GET https://apis.haravan.com/com/v2/inventories/purchase_returns.json?page=1 ``` ```json HTTP/1.1 200 OK { "purchase_returns": [ { "id": 1001004833, "return_number": "PR1000000000", "supplier": { "id": 1040044131, "name": "", "supplier_name": "Nhà làm", "phone": "", "email": "", "address": "102/18 tô hiến thành", "zip": null, "city": null, "created_at": "2022-08-22T08:15:33.044Z", "updated_at": "2022-08-22T08:15:33.044Z", "country": "Vietnam", "country_code": "VN", "province": "Hồ Chí Minh", "province_code": "HC", "district": "Quận 10", "district_code": "HC475", "ward": "Phường 15", "ward_code": "27163" }, "location": { "id": 497789, "name": "Địa điểm mặc định", "location_type": "default", "email": null, "address1": "số 14 đường Phan Tôn", "address2": null, "zip": "700000", "city": null, "province": "Hồ Chí Minh", "country": "Vietnam", "phone": "0784665872", "country_code": "VN", "country_name": "Vietnam", "province_code": "HC", "district": "Quận 1", "district_code": "HC466", "ward": "Phường Đa Kao", "ward_code": "26737", "created_at": "2022-06-13T07:43:47.654Z", "updated_at": "2022-10-14T04:12:16.992Z", "is_primary": true, "is_unavailable_quantity": false, "type": "default" }, "created_at": "2022-10-21T02:43:02.725Z", "updated_at": "2022-10-21T02:43:02.876Z", "returned_at": "2022-10-21T02:43:02.725Z", "notes": null, "status": "3", "total": 3, "total_cost": 0, "tags": null, "ref_receive_id": null, "ref_number": null, "line_items": null } ] } ``` -------------------------------- ### Customer Data Example Source: https://docs.haravan.com/docs/omni-apis/orders This snippet shows an example of customer data structure as returned by the API. ```APIDOC ## Customer Data Structure ### Description This section details the structure of a customer object, including personal information, addresses, and order history. ### Response #### Success Response (200) - **id** (integer) - Unique identifier for the customer. - **email** (string) - Customer's email address. - **first_name** (string) - Customer's first name. - **last_name** (string) - Customer's last name. - **phone** (string) - Customer's phone number. - **note** (string) - Additional notes about the customer. - **orders_count** (integer) - Total number of orders placed by the customer. - **total_spent** (float) - Total amount spent by the customer. - **total_paid** (float) - Total amount paid by the customer. - **state** (string) - Current state of the customer account (e.g., "Disabled"). - **tags** (array) - List of tags associated with the customer. - **multipass_identifier** (string) - Identifier for multipass login. - **last_order_id** (integer) - ID of the customer's last order. - **last_order_name** (string) - Name or number of the customer's last order. - **created_at** (string) - Timestamp when the customer was created. - **default_address** (object) - The customer's default shipping address. - **address1** (string) - First line of the address. - **address2** (string) - Second line of the address. - **city** (string) - City. - **company** (string) - Company name. - **country** (string) - Country. - **first_name** (string) - First name associated with the address. - **id** (integer) - Unique identifier for the address. - **last_name** (string) - Last name associated with the address. - **phone** (string) - Phone number associated with the address. - **province** (string) - Province or state. - **zip** (string) - Zip or postal code. - **name** (string) - Full name associated with the address. - **province_code** (string) - Code for the province or state. - **country_code** (string) - Code for the country. - **default** (boolean) - Indicates if this is the default address. - **district** (string) - District. - **district_code** (string) - Code for the district. - **ward** (string) - Ward. - **ward_code** (string) - Code for the ward. - **addresses** (array) - A list of all addresses associated with the customer. - Each element is an address object with the same structure as `default_address`. ### Response Example ```json { "id": 1036847352, "email": "hello@haravan.com", "phone": null, "first_name": "Haravan Demo", "last_name": null, "note": "Demo ", "orders_count": 28, "state": "Disabled", "tags": null, "total_spent": 261380000.0000, "total_paid": 0.0, "multipass_identifier": null, "last_order_id": 1138637123, "last_order_name": "#100027", "created_at": "2020-09-18T04:12:10.236Z", "default_address": { "address1": "182 Lê Đại Hành", "address2": null, "city": null, "company": null, "country": "Vietnam", "first_name": "Haravan Demo", "id": 1056185840, "last_name": null, "phone": null, "province": "Hồ Chí Minh", "zip": null, "name": " Haravan Demo", "province_code": "HC", "country_code": "vn", "default": true, "district": "Quận 11", "district_code": "HC476", "ward": "Phường 15", "ward_code": "27208" }, "addresses": [ { "address1": "182 Lê Đại Hành", "address2": null, "city": null, "company": null, "country": "Vietnam", "first_name": "Haravan Demo", "id": 1056185845, "last_name": null, "phone": null, "province": "Hồ Chí Minh", "zip": null, "name": " Haravan Demo", "province_code": "HC", "country_code": "vn", "default": false, "district": "Quận 11", "district_code": "HC476", "ward": "Phường 15", "ward_code": "27208" } ] } ``` ``` -------------------------------- ### Purchase Order Response Example Source: https://docs.haravan.com/docs/omni-apis/inventory-purchase-orders This is an example of a successful response when retrieving purchase orders. It includes details about each order, its status, associated location, and line items. ```JSON HTTP/1.1 200 OK { "purchase_orders": [ { "id": 1000355305, "purchase_number": "PO100001", "notes": "", "status": "Chưa nhận hàng", "tran_date": "2021-07-30T06:04:34Z", "created_at": "2021-07-30T06:05:24.336Z", "updated_at": "2021-07-30T06:05:24.925Z", "completed_at": null, "closed_at": null, "ref_number": "iN_3007", "supplier": null, "location": { "id": 1007284, "name": "Dottie Phan Đăng Lưu", "location_type": null, "email": null, "address1": "123 Phan Đăng Lưu", "address2": null, "zip": "70000", "city": null, "province": "Hồ Chí Minh", "country": "Vietnam", "phone": "0796060700", "country_code": null, "country_name": "Vietnam", "province_code": "HC", "district": "Quận Phú Nhuận", "district_code": "HC481", "ward": null, "ward_code": null, "created_at": "2020-11-16T02:22:43.485Z", "updated_at": "2020-11-16T02:22:43.485Z", "is_primary": false, "is_unavailable_quantity": false, "type": null }, "line_item": { "received_items": null, "not_received_items": [ { "id": 1002496132, "product_id": 1028183686, "product_variant_id": 1061514767, "product_name": "Váy Quây dài", "variant_title": "Đen / S", "sku": "AO551", "barcode": "AO551", "quantity": 1, "cost_amount": 0.00, "status": "Chưa nhận hàng", "receive_id": null, "receive_date": null } ] } }, { "id": 1000354988, "purchase_number": "PO100000", "notes": "", "status": "Hoàn thành", "tran_date": "2021-07-27T03:29:32Z", "created_at": "2021-07-27T03:33:38.404Z", "updated_at": "2021-07-30T05:58:31.483Z", "completed_at": "2021-07-30T05:58:31Z", "closed_at": null, "ref_number": "IN_2707", "supplier": null, "location": { "id": 1007284, "name": "Dottie Phan Đăng Lưu", "location_type": null, "email": null, "address1": "123 Phan Đăng Lưu", "address2": null, "zip": "70000", "city": null, "province": "Hồ Chí Minh", "country": "Vietnam", "phone": "0796060700", "country_code": null, "country_name": "Vietnam", "province_code": "HC", "district": "Quận Phú Nhuận", "district_code": "HC481", "ward": null, "ward_code": null, "created_at": "2020-11-16T02:22:43.485Z", "updated_at": "2020-11-16T02:22:43.485Z", "is_primary": false, "is_unavailable_quantity": false, "type": null }, "line_item": { "received_items": [ { "id": 1002494198, "product_id": 1028183663, "product_variant_id": 1061514702, "product_name": "Đầm Bẹt Vai Thô Phối Bèo", "variant_title": "Default Title", "sku": "D-0003", "barcode": null, "quantity": 10, "cost_amount": 1000000.00, "status": "Hoàn thành", "receive_id": 1000345765, "receive_date": "2021-07-30T12:58:22Z" } ], "not_received_items": null } } ] } ``` -------------------------------- ### Discount Code Response Example Source: https://docs.haravan.com/docs/omni-apis/discount/discount-codes This is an example of a successful response when retrieving discount codes. It includes details about the discount's properties, applicable items, and usage rules. ```json HTTP/1.1 200 OK { "discounts": [ { "applies_once": false, "applies_to_id": 39550382, "code": "TEST GROUP", "ends_at": null, "id": 1017981560, "minimum_order_amount": 0.0, "starts_at": "2021-07-28T10:12:00Z", "status": "enabled", "usage_limit": 1, "value": 10.0000, "discount_type": "percentage", "times_used": 0, "is_promotion": true, "applies_to_resource": "group_customer", "variants": [], "location_ids": [], "create_user": 200000493247, "first_name": "Trọng", "last_name": "Nhân Lê", "applies_customer_group_id": null, "created_at": "2021-07-28T10:13:35.639Z", "updated_at": "2021-07-28T10:13:35.643Z", "promotion_apply_type": 0, "applies_to_quantity": 0, "order_over": null, "is_new_coupon": false, "channel": null, "max_amount_apply": null, "is_advance_same_price_discount": false, "advance_same_prices": [], "once_per_customer": false, "products_selection": "product_prerequisite", "customers_selection": "all", "provinces_selection": "all", "channels_selection": "all", "locations_selection": "all", "entitled_collection_ids": [], "entitled_product_ids": [ 1055262740, 1055262730, 1055262741 ], "entitled_variant_ids": [], "entitled_customer_ids": [], "entitled_customer_segment_ids": [], "entitled_province_ids": [], "entitled_channels": [], "entitled_location_ids": [], "rule_customs": [ { "name": "time_range", "value": "[{\"name\":\"monday\",\"value_range\":[]},{\"name\":\"tuesday\",\"value_range\":[]}]" } ], "take_type": "fixed_amount" }, { "applies_once": false, "applies_to_id": null, "code": "EQWEQWEQWEQWEQWEWEWEQEQWEQWEQWEQWEQWEQWEQWE", "ends_at": null, "id": 1017969576, "minimum_order_amount": 0.0, "starts_at": "2021-07-27T05:49:00Z", "status": "enabled", "usage_limit": 1, "value": 10.0000, "discount_type": "fixed_amount", "times_used": 0, "is_promotion": true, "applies_to_resource": null, "variants": [], "location_ids": [], "create_user": 200000493247, "first_name": "Trọng", "last_name": "Nhân Lê", "applies_customer_group_id": null, "created_at": "2021-07-27T05:49:28.333Z", "updated_at": "2021-07-27T05:49:28.333Z", "promotion_apply_type": 0, "applies_to_quantity": 0, "order_over": null, "is_new_coupon": false, "channel": null, "max_amount_apply": null, "is_advance_same_price_discount": false, "advance_same_prices": [], "once_per_customer": false, "products_selection": "product_prerequisite", "customers_selection": "all", "provinces_selection": "province_prerequisite", "channels_selection": "channel_prerequisite", "locations_selection": "location_prerequisite", "entitled_collection_ids": [], "entitled_product_ids": [ 1055262718, 1055262665, 1055262732 ], "entitled_variant_ids": [], "entitled_customer_ids": [], "entitled_customer_segment_ids": [ 73624621, 73624622, 73624623, 73624624 ], "entitled_province_ids": [ 1, 57 ], "entitled_channels": [ "harasocial" ], "entitled_location_ids": [ 1690961 ], "rule_customs": [ ``` -------------------------------- ### District Name Property Example Source: https://docs.haravan.com/docs/omni-apis/district Example of the 'name' property for a district, showing its full name. ```json "name": "Quận 1" ``` -------------------------------- ### Order Data Structure Example Source: https://docs.haravan.com/docs/omni-apis/orders Example of a typical order data structure returned by the Haravan Omni APIs. This includes details like payment information, status, and timestamps. ```json { "id": 1055329694, "kind": "capture", "order_id": 1138637099, "receipt": null, "status": null, "test": false, "user_id": 0, "location_id": 963414, "payment_details": null, "parent_id": 1055329693, "currency": "VND", "haravan_transaction_id": null, "external_transaction_id": null, "send_email": false }, { "amount": 13200000.0000, "authorization": null, "created_at": "2020-09-19T01:12:10.062Z", "device_id": null, "gateway": "COD", "id": 1055329693, "kind": "pending", "order_id": 1138637099, "receipt": null, "status": null, "test": false, "user_id": 0, "location_id": 963414, "payment_details": null, "parent_id": null, "currency": "VND", "haravan_transaction_id": null, "external_transaction_id": null, "send_email": false } ], "note_attributes": [], "confirmed_at": null, "closed_status": "unclosed", "cancelled_status": "uncancelled", "confirmed_status": "unconfirmed", "user_id": 0, "device_id": null, "location_id": 963414, "ref_order_id": 0, "ref_order_number": null, "utm_source": null, "utm_medium": null, "utm_campaign": null, "utm_term": null, "utm_content": null, "redeem_model": null, "omni_order_status": 0, "omni_order_status_name": null, "location_assigned_at": null, "in_stock_at": null, "out_of_stock_at": null, "export_at": null, "complete_at": null, "payment_url": null, "contact_email": "hello@haravan.com" } ``` -------------------------------- ### Create Customer with Email Invite Source: https://docs.haravan.com/docs/omni-apis/customer This example shows how to create a customer and simultaneously send them an email invitation. The `send_email_invite` flag must be set to `true`. ```json { "customer": { "first_name": "Steve", "last_name": "Lastnameson", "email": "steve.lastnameson@example.com", "phone": "05142546011", "verified_email": true, "send_email_invite": true } } ``` ```json HTTP/1.1 201 Created { "customer": { "accepts_marketing": false, "addresses": [], "created_at": "2021-08-18T05:58:03.3618601Z", "default_address": null, "email": "steve.lastnameson@example.com", "phone": "05142546011", "first_name": "Steve", "id": 1050763804, "multipass_identifier": null, "last_name": "Lastnameson", "last_order_id": null, "last_order_name": null, "note": null, "orders_count": 0, "state": "Enabled", "tags": null, "total_spent": 0.0, "total_paid": 0.0, "updated_at": "2021-08-18T05:58:03.3618709Z", "verified_email": false, "group_name": null, "birthday": null, "gender": null, "last_order_date": null } } ``` -------------------------------- ### Retrieve Subscription List Response Source: https://docs.haravan.com/docs/omni-apis/subscription Example response for the GET request to retrieve a list of subscriptions. ```http HTTP/1.1 200 OK { "app_subscriptions": [ { "id": "61cec21e84b87c000192ec49", "client_id": "6e6d****30a4", "created_at": "2021-12-29T05:46:11.623Z", "expired_at": "2022-01-13T05:46:11.623Z", "updated_at": "2021-12-29T05:46:11.623Z", "cancelled_at": null, "total": 200000, "amount_discount": 0, "amount_paid": 200000, "quantity": 1, "status": "active", "plan_id": "plan_app_2209_1793", "name": "Hara Multi-language", "price": 200000 } ] } ``` -------------------------------- ### Create Customer with Address Source: https://docs.haravan.com/docs/omni-apis/customer This example shows how to create a customer and include their address details in the same request. The `addresses` field takes an array of address objects. ```json { "customer": { "first_name": "New", "last_name": "Haravan", "email": "new.haravan@example.com", "phone": "04142546011", "verified_email": true, "password": "newpass", "password_confirmation": "newpass", "send_email_welcome": false, "addresses":[ { "country": "Vietnam", "first_name": "New", "last_name": "Haravan", "zip": "70000", "address1":"182 Lê Đại Hành", "country_code": "vn", "province_code": "HC", "district_code": "HC476", "ward_code": "27208" } ] } } ``` ```json HTTP/1.1 201 Created { "customer": { "accepts_marketing": false, ``` -------------------------------- ### Retrieve Wards for a District Source: https://docs.haravan.com/docs/omni-apis/ward Example response for a GET request to retrieve all wards associated with a specific district ID. ```http HTTP/1.1 200 OK { "wards": [ { "id": 26734, "name": "Phường Tân Định", "code": "26734", "district_id": 466 }, { "id": 26737, "name": "Phường Đa Kao", "code": "26737", "district_id": 466 }, { "id": 26740, "name": "Phường Bến Nghé", "code": "26740", "district_id": 466 }, { "id": 26743, "name": "Phường Bến Thành", "code": "26743", "district_id": 466 }, { "id": 26746, "name": "Phường Nguyễn Thái Bình", "code": "26746", "district_id": 466 }, { "id": 26749, "name": "Phường Phạm Ngũ Lão", "code": "26749", "district_id": 466 }, { "id": 26752, "name": "Phường Cầu Ông Lãnh", "code": "26752", "district_id": 466 }, { "id": 26755, "name": "Phường Cô Giang", "code": "26755", "district_id": 466 }, { "id": 26758, "name": "Phường Nguyễn Cư Trinh", "code": "26758", "district_id": 466 }, { "id": 26761, "name": "Phường Cầu Kho", "code": "26761", "district_id": 466 } ] } ``` -------------------------------- ### Create Customer with Password and Skip Welcome Email Source: https://docs.haravan.com/docs/omni-apis/customer This snippet demonstrates creating a customer, setting their password, and preventing the welcome email from being sent. Both `password` and `password_confirmation` must match, and `send_email_welcome` should be `false`. ```json { "customer": { "first_name": "Steve", "last_name": "Lastnameson", "email": "steve.lastnameson@example.com", "phone": "05142546011", "verified_email": true, "password": "newpass", "password_confirmation": "newpass", "send_email_welcome": false } } ``` ```json HTTP/1.1 201 Created { "customer": { "accepts_marketing": false, "addresses": [], "created_at": "2021-08-18T05:58:03.3618601Z", "default_address": null, "email": "steve.lastnameson@example.com", "phone": "05142546011", "first_name": "Steve", "id": 1050763804, "multipass_identifier": null, "last_name": "Lastnameson", "last_order_id": null, "last_order_name": null, "note": null, "orders_count": 0, "state": "Enabled", "tags": null, "total_spent": 0.0, "total_paid": 0.0, "updated_at": "2021-08-18T05:58:03.3618709Z", "verified_email": false, "group_name": null, "birthday": null, "gender": null, "last_order_date": null } } ``` -------------------------------- ### Retrieve Customer Count Source: https://docs.haravan.com/docs/omni-apis/customer Use this endpoint to get the total number of customers in your shop. No specific setup is required beyond authentication. ```http GET https://apis.haravan.com/com/customers/count.json ```