Haravan — Đơn hàng
Danh sách đơn hàng (List orders) — haravan.list_orders
List orders, newest first, filtered by status, payment, delivery or date.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
status | Trạng thái | string | không | Order status filter. One of: open, closed, cancelled, any. |
financial_status | Trạng thái thanh toán | string | không | Payment status filter. One of: pending, paid, partially_paid, refunded, voided, partially_refunded. |
fulfillment_status | Trạng thái giao hàng | string | không | Delivery status filter. One of: unshipped, shipped, partial. |
created_at_min | Tạo từ | string | không | Created at or after (ISO 8601). |
created_at_max | Tạo đến | string | không | Created at or before (ISO 8601). |
updated_at_min | Cập nhật từ | string | không | Updated at or after (ISO 8601). |
updated_at_max | Cập nhật đến | string | không | Updated at or before (ISO 8601). |
ids | Danh sách mã đơn | string | không | Comma-separated order ids. |
since_id | Sau mã đơn | integer | không | Only orders after this id. Min 1. |
fields | Trường trả về | string | không | Comma-separated fields to return. |
page | Trang | integer | không | Page number, from 1. Min 1. |
limit | Số kết quả mỗi trang | integer | không | Items per page (1-50, default 50). Min 1. Max 50. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
orders | Danh sách đơn hàng | array of object | Orders, newest first. |
orders[].id | integer | Order id used by the API. | |
orders[].name | string | Order name shown to the shop and customer, e.g. #100020. | |
orders[].order_number | string | Order number shown to the shop and customer. | |
orders[].number | integer | Position of the order in the shop's order count. | |
orders[].token | string | Unique token of the order. | |
orders[].email | string | null | Customer email. | |
orders[].contact_email | string | null | Contact email of the buyer. | |
orders[].note | string | null | Order note. | |
orders[].note_attributes | array of object | Extra name/value details added to the order. | |
orders[].note_attributes[].name | string | Name. | |
orders[].note_attributes[].value | string | Value. | |
orders[].tags | string | null | Comma-separated tags. | |
orders[].currency | string | Currency code, e.g. VND. | |
orders[].total_price | number | Total of items, discounts, shipping and tax, VND. | |
orders[].subtotal_price | number | Price after discounts, before shipping and tax, VND. | |
orders[].total_line_items_price | number | Sum of line item prices, VND. | |
orders[].total_discounts | number | Total discounts, VND. | |
orders[].total_tax | number | Total tax, VND. | |
orders[].total_weight | number | Total weight in grams. | |
orders[].taxes_included | boolean | null | Whether tax is included in the subtotal. | |
orders[].financial_status | string | Payment status: pending, authorized, partially_paid, paid, partially_refunded, refunded or voided. | |
orders[].fulfillment_status | string | null | Delivery status: fulfilled, partial, restocked, or null/notfulfilled when nothing shipped. | |
orders[].gateway | string | null | Payment gateway name. | |
orders[].gateway_code | string | null | Payment gateway code, e.g. COD. | |
orders[].processing_method | string | null | How the payment was processed: checkout, direct, manual or offsite. | |
orders[].closed_status | string | unclosed or closed. | |
orders[].cancelled_status | string | uncancelled or cancelled. | |
orders[].confirmed_status | string | unconfirmed or confirmed. | |
orders[].cancel_reason | string | null | Why it was cancelled: customer, fraud, inventory, declined or other. | |
orders[].created_at | string | When the order was created (ISO 8601). | |
orders[].updated_at | string | When the order was last updated (ISO 8601). | |
orders[].closed_at | string | null | When the order was closed (ISO 8601). | |
orders[].cancelled_at | string | null | When the order was cancelled (ISO 8601). | |
orders[].confirmed_at | string | null | When the order was confirmed (ISO 8601). | |
orders[].source_name | string | null | Where the order came from, e.g. web or pos. | |
orders[].source | string | null | Channel that created the order. | |
orders[].landing_site | string | null | Page where the buyer entered the shop. | |
orders[].landing_site_ref | string | null | Ref of the landing page. | |
orders[].referring_site | string | null | Site that referred the buyer. | |
orders[].utm_source | string | null | UTM source. | |
orders[].utm_medium | string | null | UTM medium. | |
orders[].utm_campaign | string | null | UTM campaign. | |
orders[].utm_term | string | null | UTM term. | |
orders[].utm_content | string | null | UTM content. | |
orders[].buyer_accepts_marketing | boolean | Whether the buyer accepts marketing. | |
orders[].browser_ip | string | null | Buyer's IP address. | |
orders[].cart_token | string | null | Token of the cart behind the order. | |
orders[].checkout_token | string | null | Token of the checkout behind the order. | |
orders[].user_id | integer | null | Staff who processed the order; 0 if none. | |
orders[].location_id | integer | null | Location where the order was processed. | |
orders[].location_name | string | null | Name of that location. | |
orders[].assigned_location_id | integer | null | Location assigned to handle it. | |
orders[].assigned_location_name | string | null | Name of the assigned location. | |
orders[].assigned_location_at | string | null | When the location was assigned. | |
orders[].client_details | object | Browser the customer used. | |
orders[].client_details.accept_language | string | null | Browser languages. | |
orders[].client_details.browser_ip | string | null | IP address. | |
orders[].client_details.browser_height | integer | null | Screen height in pixels. | |
orders[].client_details.browser_width | integer | null | Screen width in pixels. | |
orders[].client_details.session_hash | string | null | Session hash. | |
orders[].client_details.user_agent | string | null | Browser user agent. | |
orders[].billing_address | object | Billing address. | |
orders[].billing_address.id | integer | Address id. | |
orders[].billing_address.name | string | Full name of the person at this address. | |
orders[].billing_address.first_name | string | First name. | |
orders[].billing_address.last_name | string | Last name. | |
orders[].billing_address.company | string | Company name. | |
orders[].billing_address.phone | string | Phone number. | |
orders[].billing_address.address1 | string | Street address: house number and street. | |
orders[].billing_address.address2 | string | Second address line. | |
orders[].billing_address.city | string | City, town or village. | |
orders[].billing_address.province | string | Province or city name. | |
orders[].billing_address.province_code | string | Province code; matches list_provinces. | |
orders[].billing_address.district | string | Ward name under the two-level model (district name before). | |
orders[].billing_address.district_code | string | Ward code; matches list_wards. | |
orders[].billing_address.ward | string | Ward name under the three-level model; usually empty now. | |
orders[].billing_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
orders[].billing_address.country | string | Country name. | |
orders[].billing_address.country_code | string | Two-letter country code, e.g. VN. | |
orders[].billing_address.zip | string | Postal code. | |
orders[].billing_address.latitude | number | Latitude, if known. | |
orders[].billing_address.longitude | number | Longitude, if known. | |
orders[].billing_address.default | boolean | True when this is the default address. | |
orders[].shipping_address | object | Delivery address. | |
orders[].shipping_address.id | integer | Address id. | |
orders[].shipping_address.name | string | Full name of the person at this address. | |
orders[].shipping_address.first_name | string | First name. | |
orders[].shipping_address.last_name | string | Last name. | |
orders[].shipping_address.company | string | Company name. | |
orders[].shipping_address.phone | string | Phone number. | |
orders[].shipping_address.address1 | string | Street address: house number and street. | |
orders[].shipping_address.address2 | string | Second address line. | |
orders[].shipping_address.city | string | City, town or village. | |
orders[].shipping_address.province | string | Province or city name. | |
orders[].shipping_address.province_code | string | Province code; matches list_provinces. | |
orders[].shipping_address.district | string | Ward name under the two-level model (district name before). | |
orders[].shipping_address.district_code | string | Ward code; matches list_wards. | |
orders[].shipping_address.ward | string | Ward name under the three-level model; usually empty now. | |
orders[].shipping_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
orders[].shipping_address.country | string | Country name. | |
orders[].shipping_address.country_code | string | Two-letter country code, e.g. VN. | |
orders[].shipping_address.zip | string | Postal code. | |
orders[].shipping_address.latitude | number | Latitude, if known. | |
orders[].shipping_address.longitude | number | Longitude, if known. | |
orders[].shipping_address.default | boolean | True when this is the default address. | |
orders[].customer | object | The customer; null for some POS orders. | |
orders[].customer.id | integer | Customer id. | |
orders[].customer.email | string | null | Email. | |
orders[].customer.phone | string | null | Phone number. | |
orders[].customer.first_name | string | null | First name. | |
orders[].customer.last_name | string | null | Last name. | |
orders[].customer.accepts_marketing | boolean | Whether the customer accepts marketing. | |
orders[].customer.tags | string | null | Comma-separated tags. | |
orders[].customer.note | string | null | Note about the customer. | |
orders[].customer.state | string | Account state. | |
orders[].customer.orders_count | integer | Number of orders. | |
orders[].customer.total_spent | number | Total spent, VND. | |
orders[].customer.last_order_id | integer | null | Latest order id. | |
orders[].customer.last_order_name | string | null | Latest order name. | |
orders[].customer.default_address | object | Default address. | |
orders[].customer.default_address.id | integer | Address id. | |
orders[].customer.default_address.name | string | Full name of the person at this address. | |
orders[].customer.default_address.first_name | string | First name. | |
orders[].customer.default_address.last_name | string | Last name. | |
orders[].customer.default_address.company | string | Company name. | |
orders[].customer.default_address.phone | string | Phone number. | |
orders[].customer.default_address.address1 | string | Street address: house number and street. | |
orders[].customer.default_address.address2 | string | Second address line. | |
orders[].customer.default_address.city | string | City, town or village. | |
orders[].customer.default_address.province | string | Province or city name. | |
orders[].customer.default_address.province_code | string | Province code; matches list_provinces. | |
orders[].customer.default_address.district | string | Ward name under the two-level model (district name before). | |
orders[].customer.default_address.district_code | string | Ward code; matches list_wards. | |
orders[].customer.default_address.ward | string | Ward name under the three-level model; usually empty now. | |
orders[].customer.default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
orders[].customer.default_address.country | string | Country name. | |
orders[].customer.default_address.country_code | string | Two-letter country code, e.g. VN. | |
orders[].customer.default_address.zip | string | Postal code. | |
orders[].customer.default_address.latitude | number | Latitude, if known. | |
orders[].customer.default_address.longitude | number | Longitude, if known. | |
orders[].customer.default_address.default | boolean | True when this is the default address. | |
orders[].customer.addresses | array of object | All addresses. | |
orders[].customer.addresses[].id | integer | Address id. | |
orders[].customer.addresses[].name | string | Full name of the person at this address. | |
orders[].customer.addresses[].first_name | string | First name. | |
orders[].customer.addresses[].last_name | string | Last name. | |
orders[].customer.addresses[].company | string | Company name. | |
orders[].customer.addresses[].phone | string | Phone number. | |
orders[].customer.addresses[].address1 | string | Street address: house number and street. | |
orders[].customer.addresses[].address2 | string | Second address line. | |
orders[].customer.addresses[].city | string | City, town or village. | |
orders[].customer.addresses[].province | string | Province or city name. | |
orders[].customer.addresses[].province_code | string | Province code; matches list_provinces. | |
orders[].customer.addresses[].district | string | Ward name under the two-level model (district name before). | |
orders[].customer.addresses[].district_code | string | Ward code; matches list_wards. | |
orders[].customer.addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
orders[].customer.addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
orders[].customer.addresses[].country | string | Country name. | |
orders[].customer.addresses[].country_code | string | Two-letter country code, e.g. VN. | |
orders[].customer.addresses[].zip | string | Postal code. | |
orders[].customer.addresses[].latitude | number | Latitude, if known. | |
orders[].customer.addresses[].longitude | number | Longitude, if known. | |
orders[].customer.addresses[].default | boolean | True when this is the default address. | |
orders[].customer.created_at | string | When it was created (ISO 8601). | |
orders[].customer.updated_at | string | When it was last updated (ISO 8601). | |
orders[].line_items | array of object | Items ordered. | |
orders[].line_items[].id | integer | Line item id. | |
orders[].line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
orders[].line_items[].variant_id | integer | Variant id. | |
orders[].line_items[].title | string | Product title. | |
orders[].line_items[].variant_title | string | Variant title. | |
orders[].line_items[].name | string | Product and variant name. | |
orders[].line_items[].sku | string | null | SKU of the variant. | |
orders[].line_items[].barcode | string | null | Barcode of the variant. | |
orders[].line_items[].vendor | string | Supplier of the item. | |
orders[].line_items[].type | string | Product type. | |
orders[].line_items[].quantity | integer | Quantity ordered. | |
orders[].line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
orders[].line_items[].price | number | Unit price before discounts, VND. | |
orders[].line_items[].price_original | number | Unit price before any promotion, VND. | |
orders[].line_items[].price_promotion | number | Promotion discount per unit, VND. | |
orders[].line_items[].total_discount | number | Total discount on this line, VND. | |
orders[].line_items[].grams | number | Weight in grams. | |
orders[].line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
orders[].line_items[].taxable | boolean | Whether the item is taxable. | |
orders[].line_items[].gift_card | boolean | Whether the item is a gift card. | |
orders[].line_items[].product_exists | boolean | False when the product has been deleted. | |
orders[].line_items[].fulfillment_service | string | null | Who fulfills the item. | |
orders[].line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
orders[].line_items[].properties | array | null | Custom properties of the line item. | |
orders[].line_items[].image | object | Variant image. | |
orders[].line_items[].image.src | string | Image URL. | |
orders[].shipping_lines | array of object | Shipping methods used. | |
orders[].shipping_lines[].code | string | null | Shipping method reference. | |
orders[].shipping_lines[].title | string | null | Shipping method title. | |
orders[].shipping_lines[].price | number | Shipping price, VND. | |
orders[].shipping_lines[].source | string | null | Source of the shipping method. | |
orders[].discount_codes | array of object | Discount codes applied. | |
orders[].discount_codes[].code | string | The code. | |
orders[].discount_codes[].amount | number | Discount amount. | |
orders[].discount_codes[].type | string | percentage, shipping or fixed_amount. | |
orders[].fulfillments | array of object | Shipments of the order. | |
orders[].fulfillments[].id | integer | Fulfillment id. | |
orders[].fulfillments[].order_id | integer | Order id. | |
orders[].fulfillments[].status | string | Fulfillment status, e.g. success. | |
orders[].fulfillments[].tracking_company | string | null | Carrier name. | |
orders[].fulfillments[].tracking_company_code | string | null | Carrier code. | |
orders[].fulfillments[].tracking_number | string | null | Tracking number. | |
orders[].fulfillments[].tracking_numbers | array of string | Tracking numbers. | |
orders[].fulfillments[].tracking_url | string | null | Tracking URL. | |
orders[].fulfillments[].tracking_urls | array of string | Tracking URLs. | |
orders[].fulfillments[].carrier_status_code | string | null | Carrier delivery status code. | |
orders[].fulfillments[].carrier_status_name | string | null | Carrier delivery status. | |
orders[].fulfillments[].carrier_cod_status_code | string | null | Cash-on-delivery status code. | |
orders[].fulfillments[].carrier_cod_status_name | string | null | Cash-on-delivery status. | |
orders[].fulfillments[].cod_amount | number | Cash on delivery amount to collect, VND. | |
orders[].fulfillments[].real_shipping_fee | number | Actual shipping fee, VND. | |
orders[].fulfillments[].total_weight | number | Package weight in grams. | |
orders[].fulfillments[].location_id | integer | null | Location the order shipped from. | |
orders[].fulfillments[].notify_customer | boolean | Whether the customer was notified. | |
orders[].fulfillments[].note | string | null | Fulfillment note. | |
orders[].fulfillments[].created_at | string | When it was created (ISO 8601). | |
orders[].fulfillments[].updated_at | string | When it was last updated (ISO 8601). | |
orders[].fulfillments[].line_items | array of object | Items in this fulfillment. | |
orders[].fulfillments[].line_items[].id | integer | Line item id. | |
orders[].fulfillments[].line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
orders[].fulfillments[].line_items[].variant_id | integer | Variant id. | |
orders[].fulfillments[].line_items[].title | string | Product title. | |
orders[].fulfillments[].line_items[].variant_title | string | Variant title. | |
orders[].fulfillments[].line_items[].name | string | Product and variant name. | |
orders[].fulfillments[].line_items[].sku | string | null | SKU of the variant. | |
orders[].fulfillments[].line_items[].barcode | string | null | Barcode of the variant. | |
orders[].fulfillments[].line_items[].vendor | string | Supplier of the item. | |
orders[].fulfillments[].line_items[].type | string | Product type. | |
orders[].fulfillments[].line_items[].quantity | integer | Quantity ordered. | |
orders[].fulfillments[].line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
orders[].fulfillments[].line_items[].price | number | Unit price before discounts, VND. | |
orders[].fulfillments[].line_items[].price_original | number | Unit price before any promotion, VND. | |
orders[].fulfillments[].line_items[].price_promotion | number | Promotion discount per unit, VND. | |
orders[].fulfillments[].line_items[].total_discount | number | Total discount on this line, VND. | |
orders[].fulfillments[].line_items[].grams | number | Weight in grams. | |
orders[].fulfillments[].line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
orders[].fulfillments[].line_items[].taxable | boolean | Whether the item is taxable. | |
orders[].fulfillments[].line_items[].gift_card | boolean | Whether the item is a gift card. | |
orders[].fulfillments[].line_items[].product_exists | boolean | False when the product has been deleted. | |
orders[].fulfillments[].line_items[].fulfillment_service | string | null | Who fulfills the item. | |
orders[].fulfillments[].line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
orders[].fulfillments[].line_items[].properties | array | null | Custom properties of the line item. | |
orders[].fulfillments[].line_items[].image | object | Variant image. | |
orders[].fulfillments[].line_items[].image.src | string | Image URL. | |
orders[].transactions | array of object | Payments on the order. | |
orders[].transactions[].id | integer | Transaction id. | |
orders[].transactions[].order_id | integer | Order the transaction belongs to. | |
orders[].transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
orders[].transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
orders[].transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
orders[].transactions[].amount | number | Amount, VND; negative for refunds. | |
orders[].transactions[].currency | string | null | Currency code, e.g. VND. | |
orders[].transactions[].gateway | string | Name of the payment gateway. | |
orders[].transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
orders[].transactions[].authorization | string | null | Authorization code. | |
orders[].transactions[].receipt | string | null | Receipt. | |
orders[].transactions[].test | boolean | True for a test transaction. | |
orders[].transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
orders[].transactions[].location_id | integer | null | Location id. | |
orders[].transactions[].device_id | integer | null | Device id. | |
orders[].transactions[].created_at | string | When it was created (ISO 8601). | |
orders[].transactions[].external_transaction_id | string | null | Id at the payment provider. | |
orders[].transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
orders[].transactions[].payment_details | object | null | Payment details, if any. | |
orders[].transactions[].send_email | boolean | Whether an email was sent. | |
orders[].refunds | array of object | Refunds on the order. | |
orders[].refunds[].id | integer | Refund id. | |
orders[].refunds[].order_id | integer | Order id. | |
orders[].refunds[].note | string | null | Note attached to the refund. | |
orders[].refunds[].restock | boolean | null | Whether items went back to stock. | |
orders[].refunds[].user_id | integer | null | Staff who made the refund. | |
orders[].refunds[].location_id | integer | null | Location items were returned to. | |
orders[].refunds[].created_at | string | When it was created (ISO 8601). | |
orders[].refunds[].refund_line_items | array of object | Items returned or refunded. | |
orders[].refunds[].refund_line_items[].id | integer | Refund line item id. | |
orders[].refunds[].refund_line_items[].line_item_id | integer | Order line item it refers to. | |
orders[].refunds[].refund_line_items[].quantity | integer | Quantity refunded. | |
orders[].refunds[].refund_line_items[].line_item | object | The order line item. | |
orders[].refunds[].refund_line_items[].line_item.id | integer | Line item id. | |
orders[].refunds[].refund_line_items[].line_item.product_id | integer | null | Product id; null when the product was deleted later. | |
orders[].refunds[].refund_line_items[].line_item.variant_id | integer | Variant id. | |
orders[].refunds[].refund_line_items[].line_item.title | string | Product title. | |
orders[].refunds[].refund_line_items[].line_item.variant_title | string | Variant title. | |
orders[].refunds[].refund_line_items[].line_item.name | string | Product and variant name. | |
orders[].refunds[].refund_line_items[].line_item.sku | string | null | SKU of the variant. | |
orders[].refunds[].refund_line_items[].line_item.barcode | string | null | Barcode of the variant. | |
orders[].refunds[].refund_line_items[].line_item.vendor | string | Supplier of the item. | |
orders[].refunds[].refund_line_items[].line_item.type | string | Product type. | |
orders[].refunds[].refund_line_items[].line_item.quantity | integer | Quantity ordered. | |
orders[].refunds[].refund_line_items[].line_item.fulfillable_quantity | integer | Quantity still available to fulfill. | |
orders[].refunds[].refund_line_items[].line_item.price | number | Unit price before discounts, VND. | |
orders[].refunds[].refund_line_items[].line_item.price_original | number | Unit price before any promotion, VND. | |
orders[].refunds[].refund_line_items[].line_item.price_promotion | number | Promotion discount per unit, VND. | |
orders[].refunds[].refund_line_items[].line_item.total_discount | number | Total discount on this line, VND. | |
orders[].refunds[].refund_line_items[].line_item.grams | number | Weight in grams. | |
orders[].refunds[].refund_line_items[].line_item.requires_shipping | boolean | Whether the item needs shipping. | |
orders[].refunds[].refund_line_items[].line_item.taxable | boolean | Whether the item is taxable. | |
orders[].refunds[].refund_line_items[].line_item.gift_card | boolean | Whether the item is a gift card. | |
orders[].refunds[].refund_line_items[].line_item.product_exists | boolean | False when the product has been deleted. | |
orders[].refunds[].refund_line_items[].line_item.fulfillment_service | string | null | Who fulfills the item. | |
orders[].refunds[].refund_line_items[].line_item.fulfillment_status | string | null | Fulfillment status of this line. | |
orders[].refunds[].refund_line_items[].line_item.properties | array | null | Custom properties of the line item. | |
orders[].refunds[].refund_line_items[].line_item.image | object | Variant image. | |
orders[].refunds[].refund_line_items[].line_item.image.src | string | Image URL. | |
orders[].refunds[].transactions | array of object | Money returned, as refund transactions. | |
orders[].refunds[].transactions[].id | integer | Transaction id. | |
orders[].refunds[].transactions[].order_id | integer | Order the transaction belongs to. | |
orders[].refunds[].transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
orders[].refunds[].transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
orders[].refunds[].transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
orders[].refunds[].transactions[].amount | number | Amount, VND; negative for refunds. | |
orders[].refunds[].transactions[].currency | string | null | Currency code, e.g. VND. | |
orders[].refunds[].transactions[].gateway | string | Name of the payment gateway. | |
orders[].refunds[].transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
orders[].refunds[].transactions[].authorization | string | null | Authorization code. | |
orders[].refunds[].transactions[].receipt | string | null | Receipt. | |
orders[].refunds[].transactions[].test | boolean | True for a test transaction. | |
orders[].refunds[].transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
orders[].refunds[].transactions[].location_id | integer | null | Location id. | |
orders[].refunds[].transactions[].device_id | integer | null | Device id. | |
orders[].refunds[].transactions[].created_at | string | When it was created (ISO 8601). | |
orders[].refunds[].transactions[].external_transaction_id | string | null | Id at the payment provider. | |
orders[].refunds[].transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
orders[].refunds[].transactions[].payment_details | object | null | Payment details, if any. | |
orders[].refunds[].transactions[].send_email | boolean | Whether an email was sent. |
Đếm đơn hàng (Count orders) — haravan.count_orders
Count orders matching status, payment, delivery or date filters.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
status | Trạng thái | string | không | Order status filter. One of: open, closed, cancelled, any. |
financial_status | Trạng thái thanh toán | string | không | Payment status filter. One of: pending, paid, partially_paid, refunded, voided, partially_refunded. |
fulfillment_status | Trạng thái giao hàng | string | không | Delivery status filter. One of: unshipped, shipped, partial. |
created_at_min | Tạo từ | string | không | Created at or after (ISO 8601). |
created_at_max | Tạo đến | string | không | Created at or before (ISO 8601). |
updated_at_min | Cập nhật từ | string | không | Updated at or after (ISO 8601). |
updated_at_max | Cập nhật đến | string | không | Updated at or before (ISO 8601). |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
count | Số lượng | integer | Count. |
Xem đơn hàng (Get order) — haravan.get_order
Get one order with its items, customer, addresses, payment and delivery status.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
order | Đơn hàng | object | The order. |
order.id | integer | Order id used by the API. | |
order.name | string | Order name shown to the shop and customer, e.g. #100020. | |
order.order_number | string | Order number shown to the shop and customer. | |
order.number | integer | Position of the order in the shop's order count. | |
order.token | string | Unique token of the order. | |
order.email | string | null | Customer email. | |
order.contact_email | string | null | Contact email of the buyer. | |
order.note | string | null | Order note. | |
order.note_attributes | array of object | Extra name/value details added to the order. | |
order.note_attributes[].name | string | Name. | |
order.note_attributes[].value | string | Value. | |
order.tags | string | null | Comma-separated tags. | |
order.currency | string | Currency code, e.g. VND. | |
order.total_price | number | Total of items, discounts, shipping and tax, VND. | |
order.subtotal_price | number | Price after discounts, before shipping and tax, VND. | |
order.total_line_items_price | number | Sum of line item prices, VND. | |
order.total_discounts | number | Total discounts, VND. | |
order.total_tax | number | Total tax, VND. | |
order.total_weight | number | Total weight in grams. | |
order.taxes_included | boolean | null | Whether tax is included in the subtotal. | |
order.financial_status | string | Payment status: pending, authorized, partially_paid, paid, partially_refunded, refunded or voided. | |
order.fulfillment_status | string | null | Delivery status: fulfilled, partial, restocked, or null/notfulfilled when nothing shipped. | |
order.gateway | string | null | Payment gateway name. | |
order.gateway_code | string | null | Payment gateway code, e.g. COD. | |
order.processing_method | string | null | How the payment was processed: checkout, direct, manual or offsite. | |
order.closed_status | string | unclosed or closed. | |
order.cancelled_status | string | uncancelled or cancelled. | |
order.confirmed_status | string | unconfirmed or confirmed. | |
order.cancel_reason | string | null | Why it was cancelled: customer, fraud, inventory, declined or other. | |
order.created_at | string | When the order was created (ISO 8601). | |
order.updated_at | string | When the order was last updated (ISO 8601). | |
order.closed_at | string | null | When the order was closed (ISO 8601). | |
order.cancelled_at | string | null | When the order was cancelled (ISO 8601). | |
order.confirmed_at | string | null | When the order was confirmed (ISO 8601). | |
order.source_name | string | null | Where the order came from, e.g. web or pos. | |
order.source | string | null | Channel that created the order. | |
order.landing_site | string | null | Page where the buyer entered the shop. | |
order.landing_site_ref | string | null | Ref of the landing page. | |
order.referring_site | string | null | Site that referred the buyer. | |
order.utm_source | string | null | UTM source. | |
order.utm_medium | string | null | UTM medium. | |
order.utm_campaign | string | null | UTM campaign. | |
order.utm_term | string | null | UTM term. | |
order.utm_content | string | null | UTM content. | |
order.buyer_accepts_marketing | boolean | Whether the buyer accepts marketing. | |
order.browser_ip | string | null | Buyer's IP address. | |
order.cart_token | string | null | Token of the cart behind the order. | |
order.checkout_token | string | null | Token of the checkout behind the order. | |
order.user_id | integer | null | Staff who processed the order; 0 if none. | |
order.location_id | integer | null | Location where the order was processed. | |
order.location_name | string | null | Name of that location. | |
order.assigned_location_id | integer | null | Location assigned to handle it. | |
order.assigned_location_name | string | null | Name of the assigned location. | |
order.assigned_location_at | string | null | When the location was assigned. | |
order.client_details | object | Browser the customer used. | |
order.client_details.accept_language | string | null | Browser languages. | |
order.client_details.browser_ip | string | null | IP address. | |
order.client_details.browser_height | integer | null | Screen height in pixels. | |
order.client_details.browser_width | integer | null | Screen width in pixels. | |
order.client_details.session_hash | string | null | Session hash. | |
order.client_details.user_agent | string | null | Browser user agent. | |
order.billing_address | object | Billing address. | |
order.billing_address.id | integer | Address id. | |
order.billing_address.name | string | Full name of the person at this address. | |
order.billing_address.first_name | string | First name. | |
order.billing_address.last_name | string | Last name. | |
order.billing_address.company | string | Company name. | |
order.billing_address.phone | string | Phone number. | |
order.billing_address.address1 | string | Street address: house number and street. | |
order.billing_address.address2 | string | Second address line. | |
order.billing_address.city | string | City, town or village. | |
order.billing_address.province | string | Province or city name. | |
order.billing_address.province_code | string | Province code; matches list_provinces. | |
order.billing_address.district | string | Ward name under the two-level model (district name before). | |
order.billing_address.district_code | string | Ward code; matches list_wards. | |
order.billing_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.billing_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.billing_address.country | string | Country name. | |
order.billing_address.country_code | string | Two-letter country code, e.g. VN. | |
order.billing_address.zip | string | Postal code. | |
order.billing_address.latitude | number | Latitude, if known. | |
order.billing_address.longitude | number | Longitude, if known. | |
order.billing_address.default | boolean | True when this is the default address. | |
order.shipping_address | object | Delivery address. | |
order.shipping_address.id | integer | Address id. | |
order.shipping_address.name | string | Full name of the person at this address. | |
order.shipping_address.first_name | string | First name. | |
order.shipping_address.last_name | string | Last name. | |
order.shipping_address.company | string | Company name. | |
order.shipping_address.phone | string | Phone number. | |
order.shipping_address.address1 | string | Street address: house number and street. | |
order.shipping_address.address2 | string | Second address line. | |
order.shipping_address.city | string | City, town or village. | |
order.shipping_address.province | string | Province or city name. | |
order.shipping_address.province_code | string | Province code; matches list_provinces. | |
order.shipping_address.district | string | Ward name under the two-level model (district name before). | |
order.shipping_address.district_code | string | Ward code; matches list_wards. | |
order.shipping_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.shipping_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.shipping_address.country | string | Country name. | |
order.shipping_address.country_code | string | Two-letter country code, e.g. VN. | |
order.shipping_address.zip | string | Postal code. | |
order.shipping_address.latitude | number | Latitude, if known. | |
order.shipping_address.longitude | number | Longitude, if known. | |
order.shipping_address.default | boolean | True when this is the default address. | |
order.customer | object | The customer; null for some POS orders. | |
order.customer.id | integer | Customer id. | |
order.customer.email | string | null | Email. | |
order.customer.phone | string | null | Phone number. | |
order.customer.first_name | string | null | First name. | |
order.customer.last_name | string | null | Last name. | |
order.customer.accepts_marketing | boolean | Whether the customer accepts marketing. | |
order.customer.tags | string | null | Comma-separated tags. | |
order.customer.note | string | null | Note about the customer. | |
order.customer.state | string | Account state. | |
order.customer.orders_count | integer | Number of orders. | |
order.customer.total_spent | number | Total spent, VND. | |
order.customer.last_order_id | integer | null | Latest order id. | |
order.customer.last_order_name | string | null | Latest order name. | |
order.customer.default_address | object | Default address. | |
order.customer.default_address.id | integer | Address id. | |
order.customer.default_address.name | string | Full name of the person at this address. | |
order.customer.default_address.first_name | string | First name. | |
order.customer.default_address.last_name | string | Last name. | |
order.customer.default_address.company | string | Company name. | |
order.customer.default_address.phone | string | Phone number. | |
order.customer.default_address.address1 | string | Street address: house number and street. | |
order.customer.default_address.address2 | string | Second address line. | |
order.customer.default_address.city | string | City, town or village. | |
order.customer.default_address.province | string | Province or city name. | |
order.customer.default_address.province_code | string | Province code; matches list_provinces. | |
order.customer.default_address.district | string | Ward name under the two-level model (district name before). | |
order.customer.default_address.district_code | string | Ward code; matches list_wards. | |
order.customer.default_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.default_address.country | string | Country name. | |
order.customer.default_address.country_code | string | Two-letter country code, e.g. VN. | |
order.customer.default_address.zip | string | Postal code. | |
order.customer.default_address.latitude | number | Latitude, if known. | |
order.customer.default_address.longitude | number | Longitude, if known. | |
order.customer.default_address.default | boolean | True when this is the default address. | |
order.customer.addresses | array of object | All addresses. | |
order.customer.addresses[].id | integer | Address id. | |
order.customer.addresses[].name | string | Full name of the person at this address. | |
order.customer.addresses[].first_name | string | First name. | |
order.customer.addresses[].last_name | string | Last name. | |
order.customer.addresses[].company | string | Company name. | |
order.customer.addresses[].phone | string | Phone number. | |
order.customer.addresses[].address1 | string | Street address: house number and street. | |
order.customer.addresses[].address2 | string | Second address line. | |
order.customer.addresses[].city | string | City, town or village. | |
order.customer.addresses[].province | string | Province or city name. | |
order.customer.addresses[].province_code | string | Province code; matches list_provinces. | |
order.customer.addresses[].district | string | Ward name under the two-level model (district name before). | |
order.customer.addresses[].district_code | string | Ward code; matches list_wards. | |
order.customer.addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.addresses[].country | string | Country name. | |
order.customer.addresses[].country_code | string | Two-letter country code, e.g. VN. | |
order.customer.addresses[].zip | string | Postal code. | |
order.customer.addresses[].latitude | number | Latitude, if known. | |
order.customer.addresses[].longitude | number | Longitude, if known. | |
order.customer.addresses[].default | boolean | True when this is the default address. | |
order.customer.created_at | string | When it was created (ISO 8601). | |
order.customer.updated_at | string | When it was last updated (ISO 8601). | |
order.line_items | array of object | Items ordered. | |
order.line_items[].id | integer | Line item id. | |
order.line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.line_items[].variant_id | integer | Variant id. | |
order.line_items[].title | string | Product title. | |
order.line_items[].variant_title | string | Variant title. | |
order.line_items[].name | string | Product and variant name. | |
order.line_items[].sku | string | null | SKU of the variant. | |
order.line_items[].barcode | string | null | Barcode of the variant. | |
order.line_items[].vendor | string | Supplier of the item. | |
order.line_items[].type | string | Product type. | |
order.line_items[].quantity | integer | Quantity ordered. | |
order.line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.line_items[].price | number | Unit price before discounts, VND. | |
order.line_items[].price_original | number | Unit price before any promotion, VND. | |
order.line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.line_items[].total_discount | number | Total discount on this line, VND. | |
order.line_items[].grams | number | Weight in grams. | |
order.line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.line_items[].taxable | boolean | Whether the item is taxable. | |
order.line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.line_items[].product_exists | boolean | False when the product has been deleted. | |
order.line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.line_items[].properties | array | null | Custom properties of the line item. | |
order.line_items[].image | object | Variant image. | |
order.line_items[].image.src | string | Image URL. | |
order.shipping_lines | array of object | Shipping methods used. | |
order.shipping_lines[].code | string | null | Shipping method reference. | |
order.shipping_lines[].title | string | null | Shipping method title. | |
order.shipping_lines[].price | number | Shipping price, VND. | |
order.shipping_lines[].source | string | null | Source of the shipping method. | |
order.discount_codes | array of object | Discount codes applied. | |
order.discount_codes[].code | string | The code. | |
order.discount_codes[].amount | number | Discount amount. | |
order.discount_codes[].type | string | percentage, shipping or fixed_amount. | |
order.fulfillments | array of object | Shipments of the order. | |
order.fulfillments[].id | integer | Fulfillment id. | |
order.fulfillments[].order_id | integer | Order id. | |
order.fulfillments[].status | string | Fulfillment status, e.g. success. | |
order.fulfillments[].tracking_company | string | null | Carrier name. | |
order.fulfillments[].tracking_company_code | string | null | Carrier code. | |
order.fulfillments[].tracking_number | string | null | Tracking number. | |
order.fulfillments[].tracking_numbers | array of string | Tracking numbers. | |
order.fulfillments[].tracking_url | string | null | Tracking URL. | |
order.fulfillments[].tracking_urls | array of string | Tracking URLs. | |
order.fulfillments[].carrier_status_code | string | null | Carrier delivery status code. | |
order.fulfillments[].carrier_status_name | string | null | Carrier delivery status. | |
order.fulfillments[].carrier_cod_status_code | string | null | Cash-on-delivery status code. | |
order.fulfillments[].carrier_cod_status_name | string | null | Cash-on-delivery status. | |
order.fulfillments[].cod_amount | number | Cash on delivery amount to collect, VND. | |
order.fulfillments[].real_shipping_fee | number | Actual shipping fee, VND. | |
order.fulfillments[].total_weight | number | Package weight in grams. | |
order.fulfillments[].location_id | integer | null | Location the order shipped from. | |
order.fulfillments[].notify_customer | boolean | Whether the customer was notified. | |
order.fulfillments[].note | string | null | Fulfillment note. | |
order.fulfillments[].created_at | string | When it was created (ISO 8601). | |
order.fulfillments[].updated_at | string | When it was last updated (ISO 8601). | |
order.fulfillments[].line_items | array of object | Items in this fulfillment. | |
order.fulfillments[].line_items[].id | integer | Line item id. | |
order.fulfillments[].line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.fulfillments[].line_items[].variant_id | integer | Variant id. | |
order.fulfillments[].line_items[].title | string | Product title. | |
order.fulfillments[].line_items[].variant_title | string | Variant title. | |
order.fulfillments[].line_items[].name | string | Product and variant name. | |
order.fulfillments[].line_items[].sku | string | null | SKU of the variant. | |
order.fulfillments[].line_items[].barcode | string | null | Barcode of the variant. | |
order.fulfillments[].line_items[].vendor | string | Supplier of the item. | |
order.fulfillments[].line_items[].type | string | Product type. | |
order.fulfillments[].line_items[].quantity | integer | Quantity ordered. | |
order.fulfillments[].line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.fulfillments[].line_items[].price | number | Unit price before discounts, VND. | |
order.fulfillments[].line_items[].price_original | number | Unit price before any promotion, VND. | |
order.fulfillments[].line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.fulfillments[].line_items[].total_discount | number | Total discount on this line, VND. | |
order.fulfillments[].line_items[].grams | number | Weight in grams. | |
order.fulfillments[].line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.fulfillments[].line_items[].taxable | boolean | Whether the item is taxable. | |
order.fulfillments[].line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.fulfillments[].line_items[].product_exists | boolean | False when the product has been deleted. | |
order.fulfillments[].line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.fulfillments[].line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.fulfillments[].line_items[].properties | array | null | Custom properties of the line item. | |
order.fulfillments[].line_items[].image | object | Variant image. | |
order.fulfillments[].line_items[].image.src | string | Image URL. | |
order.transactions | array of object | Payments on the order. | |
order.transactions[].id | integer | Transaction id. | |
order.transactions[].order_id | integer | Order the transaction belongs to. | |
order.transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.transactions[].amount | number | Amount, VND; negative for refunds. | |
order.transactions[].currency | string | null | Currency code, e.g. VND. | |
order.transactions[].gateway | string | Name of the payment gateway. | |
order.transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.transactions[].authorization | string | null | Authorization code. | |
order.transactions[].receipt | string | null | Receipt. | |
order.transactions[].test | boolean | True for a test transaction. | |
order.transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.transactions[].location_id | integer | null | Location id. | |
order.transactions[].device_id | integer | null | Device id. | |
order.transactions[].created_at | string | When it was created (ISO 8601). | |
order.transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.transactions[].payment_details | object | null | Payment details, if any. | |
order.transactions[].send_email | boolean | Whether an email was sent. | |
order.refunds | array of object | Refunds on the order. | |
order.refunds[].id | integer | Refund id. | |
order.refunds[].order_id | integer | Order id. | |
order.refunds[].note | string | null | Note attached to the refund. | |
order.refunds[].restock | boolean | null | Whether items went back to stock. | |
order.refunds[].user_id | integer | null | Staff who made the refund. | |
order.refunds[].location_id | integer | null | Location items were returned to. | |
order.refunds[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].refund_line_items | array of object | Items returned or refunded. | |
order.refunds[].refund_line_items[].id | integer | Refund line item id. | |
order.refunds[].refund_line_items[].line_item_id | integer | Order line item it refers to. | |
order.refunds[].refund_line_items[].quantity | integer | Quantity refunded. | |
order.refunds[].refund_line_items[].line_item | object | The order line item. | |
order.refunds[].refund_line_items[].line_item.id | integer | Line item id. | |
order.refunds[].refund_line_items[].line_item.product_id | integer | null | Product id; null when the product was deleted later. | |
order.refunds[].refund_line_items[].line_item.variant_id | integer | Variant id. | |
order.refunds[].refund_line_items[].line_item.title | string | Product title. | |
order.refunds[].refund_line_items[].line_item.variant_title | string | Variant title. | |
order.refunds[].refund_line_items[].line_item.name | string | Product and variant name. | |
order.refunds[].refund_line_items[].line_item.sku | string | null | SKU of the variant. | |
order.refunds[].refund_line_items[].line_item.barcode | string | null | Barcode of the variant. | |
order.refunds[].refund_line_items[].line_item.vendor | string | Supplier of the item. | |
order.refunds[].refund_line_items[].line_item.type | string | Product type. | |
order.refunds[].refund_line_items[].line_item.quantity | integer | Quantity ordered. | |
order.refunds[].refund_line_items[].line_item.fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.refunds[].refund_line_items[].line_item.price | number | Unit price before discounts, VND. | |
order.refunds[].refund_line_items[].line_item.price_original | number | Unit price before any promotion, VND. | |
order.refunds[].refund_line_items[].line_item.price_promotion | number | Promotion discount per unit, VND. | |
order.refunds[].refund_line_items[].line_item.total_discount | number | Total discount on this line, VND. | |
order.refunds[].refund_line_items[].line_item.grams | number | Weight in grams. | |
order.refunds[].refund_line_items[].line_item.requires_shipping | boolean | Whether the item needs shipping. | |
order.refunds[].refund_line_items[].line_item.taxable | boolean | Whether the item is taxable. | |
order.refunds[].refund_line_items[].line_item.gift_card | boolean | Whether the item is a gift card. | |
order.refunds[].refund_line_items[].line_item.product_exists | boolean | False when the product has been deleted. | |
order.refunds[].refund_line_items[].line_item.fulfillment_service | string | null | Who fulfills the item. | |
order.refunds[].refund_line_items[].line_item.fulfillment_status | string | null | Fulfillment status of this line. | |
order.refunds[].refund_line_items[].line_item.properties | array | null | Custom properties of the line item. | |
order.refunds[].refund_line_items[].line_item.image | object | Variant image. | |
order.refunds[].refund_line_items[].line_item.image.src | string | Image URL. | |
order.refunds[].transactions | array of object | Money returned, as refund transactions. | |
order.refunds[].transactions[].id | integer | Transaction id. | |
order.refunds[].transactions[].order_id | integer | Order the transaction belongs to. | |
order.refunds[].transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.refunds[].transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.refunds[].transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.refunds[].transactions[].amount | number | Amount, VND; negative for refunds. | |
order.refunds[].transactions[].currency | string | null | Currency code, e.g. VND. | |
order.refunds[].transactions[].gateway | string | Name of the payment gateway. | |
order.refunds[].transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.refunds[].transactions[].authorization | string | null | Authorization code. | |
order.refunds[].transactions[].receipt | string | null | Receipt. | |
order.refunds[].transactions[].test | boolean | True for a test transaction. | |
order.refunds[].transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.refunds[].transactions[].location_id | integer | null | Location id. | |
order.refunds[].transactions[].device_id | integer | null | Device id. | |
order.refunds[].transactions[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.refunds[].transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.refunds[].transactions[].payment_details | object | null | Payment details, if any. | |
order.refunds[].transactions[].send_email | boolean | Whether an email was sent. |
Tạo đơn hàng (Create order) — haravan.create_order
Create an order from variants and quantities. Look up province_code with list_provinces and the ward code (sent as district_code) with list_wards first.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | com.write_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order | Đơn hàng | object | có | The order. Other Haravan order fields are also accepted. |
order.line_items | array of object | có | Products ordered. | |
order.line_items[].variant_id | integer | có | Variant id. | |
order.line_items[].quantity | integer | có | Quantity. Min 1. | |
order.line_items[].price | number | không | Unit price, VND. | |
order.email | string | không | Customer email. | |
order.phone | string | không | Customer phone number. | |
order.customer | object | không | Customer: {id} of an existing one, or first_name, last_name, phone. | |
order.shipping_address | object | không | Delivery address. | |
order.shipping_address.name | string | không | Recipient full name. | |
order.shipping_address.phone | string | không | Recipient phone number. | |
order.shipping_address.address1 | string | không | Street address: house number and street. | |
order.shipping_address.province_code | string | không | Province code from list_provinces. | |
order.shipping_address.district_code | string | không | New ward code from list_wards (two-level model). | |
order.shipping_address.ward_code | string | không | Leave empty under the two-level model. | |
order.shipping_address.country_code | string | không | Country code, VN for Vietnam. | |
order.billing_address | object | không | Billing address. | |
order.billing_address.name | string | không | Recipient full name. | |
order.billing_address.phone | string | không | Recipient phone number. | |
order.billing_address.address1 | string | không | Street address: house number and street. | |
order.billing_address.province_code | string | không | Province code from list_provinces. | |
order.billing_address.district_code | string | không | New ward code from list_wards (two-level model). | |
order.billing_address.ward_code | string | không | Leave empty under the two-level model. | |
order.billing_address.country_code | string | không | Country code, VN for Vietnam. | |
order.note | string | không | Order note. | |
order.tags | string | không | Comma-separated tags. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
order | Đơn hàng | object | The order. |
order.id | integer | Order id used by the API. | |
order.name | string | Order name shown to the shop and customer, e.g. #100020. | |
order.order_number | string | Order number shown to the shop and customer. | |
order.number | integer | Position of the order in the shop's order count. | |
order.token | string | Unique token of the order. | |
order.email | string | null | Customer email. | |
order.contact_email | string | null | Contact email of the buyer. | |
order.note | string | null | Order note. | |
order.note_attributes | array of object | Extra name/value details added to the order. | |
order.note_attributes[].name | string | Name. | |
order.note_attributes[].value | string | Value. | |
order.tags | string | null | Comma-separated tags. | |
order.currency | string | Currency code, e.g. VND. | |
order.total_price | number | Total of items, discounts, shipping and tax, VND. | |
order.subtotal_price | number | Price after discounts, before shipping and tax, VND. | |
order.total_line_items_price | number | Sum of line item prices, VND. | |
order.total_discounts | number | Total discounts, VND. | |
order.total_tax | number | Total tax, VND. | |
order.total_weight | number | Total weight in grams. | |
order.taxes_included | boolean | null | Whether tax is included in the subtotal. | |
order.financial_status | string | Payment status: pending, authorized, partially_paid, paid, partially_refunded, refunded or voided. | |
order.fulfillment_status | string | null | Delivery status: fulfilled, partial, restocked, or null/notfulfilled when nothing shipped. | |
order.gateway | string | null | Payment gateway name. | |
order.gateway_code | string | null | Payment gateway code, e.g. COD. | |
order.processing_method | string | null | How the payment was processed: checkout, direct, manual or offsite. | |
order.closed_status | string | unclosed or closed. | |
order.cancelled_status | string | uncancelled or cancelled. | |
order.confirmed_status | string | unconfirmed or confirmed. | |
order.cancel_reason | string | null | Why it was cancelled: customer, fraud, inventory, declined or other. | |
order.created_at | string | When the order was created (ISO 8601). | |
order.updated_at | string | When the order was last updated (ISO 8601). | |
order.closed_at | string | null | When the order was closed (ISO 8601). | |
order.cancelled_at | string | null | When the order was cancelled (ISO 8601). | |
order.confirmed_at | string | null | When the order was confirmed (ISO 8601). | |
order.source_name | string | null | Where the order came from, e.g. web or pos. | |
order.source | string | null | Channel that created the order. | |
order.landing_site | string | null | Page where the buyer entered the shop. | |
order.landing_site_ref | string | null | Ref of the landing page. | |
order.referring_site | string | null | Site that referred the buyer. | |
order.utm_source | string | null | UTM source. | |
order.utm_medium | string | null | UTM medium. | |
order.utm_campaign | string | null | UTM campaign. | |
order.utm_term | string | null | UTM term. | |
order.utm_content | string | null | UTM content. | |
order.buyer_accepts_marketing | boolean | Whether the buyer accepts marketing. | |
order.browser_ip | string | null | Buyer's IP address. | |
order.cart_token | string | null | Token of the cart behind the order. | |
order.checkout_token | string | null | Token of the checkout behind the order. | |
order.user_id | integer | null | Staff who processed the order; 0 if none. | |
order.location_id | integer | null | Location where the order was processed. | |
order.location_name | string | null | Name of that location. | |
order.assigned_location_id | integer | null | Location assigned to handle it. | |
order.assigned_location_name | string | null | Name of the assigned location. | |
order.assigned_location_at | string | null | When the location was assigned. | |
order.client_details | object | Browser the customer used. | |
order.client_details.accept_language | string | null | Browser languages. | |
order.client_details.browser_ip | string | null | IP address. | |
order.client_details.browser_height | integer | null | Screen height in pixels. | |
order.client_details.browser_width | integer | null | Screen width in pixels. | |
order.client_details.session_hash | string | null | Session hash. | |
order.client_details.user_agent | string | null | Browser user agent. | |
order.billing_address | object | Billing address. | |
order.billing_address.id | integer | Address id. | |
order.billing_address.name | string | Full name of the person at this address. | |
order.billing_address.first_name | string | First name. | |
order.billing_address.last_name | string | Last name. | |
order.billing_address.company | string | Company name. | |
order.billing_address.phone | string | Phone number. | |
order.billing_address.address1 | string | Street address: house number and street. | |
order.billing_address.address2 | string | Second address line. | |
order.billing_address.city | string | City, town or village. | |
order.billing_address.province | string | Province or city name. | |
order.billing_address.province_code | string | Province code; matches list_provinces. | |
order.billing_address.district | string | Ward name under the two-level model (district name before). | |
order.billing_address.district_code | string | Ward code; matches list_wards. | |
order.billing_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.billing_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.billing_address.country | string | Country name. | |
order.billing_address.country_code | string | Two-letter country code, e.g. VN. | |
order.billing_address.zip | string | Postal code. | |
order.billing_address.latitude | number | Latitude, if known. | |
order.billing_address.longitude | number | Longitude, if known. | |
order.billing_address.default | boolean | True when this is the default address. | |
order.shipping_address | object | Delivery address. | |
order.shipping_address.id | integer | Address id. | |
order.shipping_address.name | string | Full name of the person at this address. | |
order.shipping_address.first_name | string | First name. | |
order.shipping_address.last_name | string | Last name. | |
order.shipping_address.company | string | Company name. | |
order.shipping_address.phone | string | Phone number. | |
order.shipping_address.address1 | string | Street address: house number and street. | |
order.shipping_address.address2 | string | Second address line. | |
order.shipping_address.city | string | City, town or village. | |
order.shipping_address.province | string | Province or city name. | |
order.shipping_address.province_code | string | Province code; matches list_provinces. | |
order.shipping_address.district | string | Ward name under the two-level model (district name before). | |
order.shipping_address.district_code | string | Ward code; matches list_wards. | |
order.shipping_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.shipping_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.shipping_address.country | string | Country name. | |
order.shipping_address.country_code | string | Two-letter country code, e.g. VN. | |
order.shipping_address.zip | string | Postal code. | |
order.shipping_address.latitude | number | Latitude, if known. | |
order.shipping_address.longitude | number | Longitude, if known. | |
order.shipping_address.default | boolean | True when this is the default address. | |
order.customer | object | The customer; null for some POS orders. | |
order.customer.id | integer | Customer id. | |
order.customer.email | string | null | Email. | |
order.customer.phone | string | null | Phone number. | |
order.customer.first_name | string | null | First name. | |
order.customer.last_name | string | null | Last name. | |
order.customer.accepts_marketing | boolean | Whether the customer accepts marketing. | |
order.customer.tags | string | null | Comma-separated tags. | |
order.customer.note | string | null | Note about the customer. | |
order.customer.state | string | Account state. | |
order.customer.orders_count | integer | Number of orders. | |
order.customer.total_spent | number | Total spent, VND. | |
order.customer.last_order_id | integer | null | Latest order id. | |
order.customer.last_order_name | string | null | Latest order name. | |
order.customer.default_address | object | Default address. | |
order.customer.default_address.id | integer | Address id. | |
order.customer.default_address.name | string | Full name of the person at this address. | |
order.customer.default_address.first_name | string | First name. | |
order.customer.default_address.last_name | string | Last name. | |
order.customer.default_address.company | string | Company name. | |
order.customer.default_address.phone | string | Phone number. | |
order.customer.default_address.address1 | string | Street address: house number and street. | |
order.customer.default_address.address2 | string | Second address line. | |
order.customer.default_address.city | string | City, town or village. | |
order.customer.default_address.province | string | Province or city name. | |
order.customer.default_address.province_code | string | Province code; matches list_provinces. | |
order.customer.default_address.district | string | Ward name under the two-level model (district name before). | |
order.customer.default_address.district_code | string | Ward code; matches list_wards. | |
order.customer.default_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.default_address.country | string | Country name. | |
order.customer.default_address.country_code | string | Two-letter country code, e.g. VN. | |
order.customer.default_address.zip | string | Postal code. | |
order.customer.default_address.latitude | number | Latitude, if known. | |
order.customer.default_address.longitude | number | Longitude, if known. | |
order.customer.default_address.default | boolean | True when this is the default address. | |
order.customer.addresses | array of object | All addresses. | |
order.customer.addresses[].id | integer | Address id. | |
order.customer.addresses[].name | string | Full name of the person at this address. | |
order.customer.addresses[].first_name | string | First name. | |
order.customer.addresses[].last_name | string | Last name. | |
order.customer.addresses[].company | string | Company name. | |
order.customer.addresses[].phone | string | Phone number. | |
order.customer.addresses[].address1 | string | Street address: house number and street. | |
order.customer.addresses[].address2 | string | Second address line. | |
order.customer.addresses[].city | string | City, town or village. | |
order.customer.addresses[].province | string | Province or city name. | |
order.customer.addresses[].province_code | string | Province code; matches list_provinces. | |
order.customer.addresses[].district | string | Ward name under the two-level model (district name before). | |
order.customer.addresses[].district_code | string | Ward code; matches list_wards. | |
order.customer.addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.addresses[].country | string | Country name. | |
order.customer.addresses[].country_code | string | Two-letter country code, e.g. VN. | |
order.customer.addresses[].zip | string | Postal code. | |
order.customer.addresses[].latitude | number | Latitude, if known. | |
order.customer.addresses[].longitude | number | Longitude, if known. | |
order.customer.addresses[].default | boolean | True when this is the default address. | |
order.customer.created_at | string | When it was created (ISO 8601). | |
order.customer.updated_at | string | When it was last updated (ISO 8601). | |
order.line_items | array of object | Items ordered. | |
order.line_items[].id | integer | Line item id. | |
order.line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.line_items[].variant_id | integer | Variant id. | |
order.line_items[].title | string | Product title. | |
order.line_items[].variant_title | string | Variant title. | |
order.line_items[].name | string | Product and variant name. | |
order.line_items[].sku | string | null | SKU of the variant. | |
order.line_items[].barcode | string | null | Barcode of the variant. | |
order.line_items[].vendor | string | Supplier of the item. | |
order.line_items[].type | string | Product type. | |
order.line_items[].quantity | integer | Quantity ordered. | |
order.line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.line_items[].price | number | Unit price before discounts, VND. | |
order.line_items[].price_original | number | Unit price before any promotion, VND. | |
order.line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.line_items[].total_discount | number | Total discount on this line, VND. | |
order.line_items[].grams | number | Weight in grams. | |
order.line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.line_items[].taxable | boolean | Whether the item is taxable. | |
order.line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.line_items[].product_exists | boolean | False when the product has been deleted. | |
order.line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.line_items[].properties | array | null | Custom properties of the line item. | |
order.line_items[].image | object | Variant image. | |
order.line_items[].image.src | string | Image URL. | |
order.shipping_lines | array of object | Shipping methods used. | |
order.shipping_lines[].code | string | null | Shipping method reference. | |
order.shipping_lines[].title | string | null | Shipping method title. | |
order.shipping_lines[].price | number | Shipping price, VND. | |
order.shipping_lines[].source | string | null | Source of the shipping method. | |
order.discount_codes | array of object | Discount codes applied. | |
order.discount_codes[].code | string | The code. | |
order.discount_codes[].amount | number | Discount amount. | |
order.discount_codes[].type | string | percentage, shipping or fixed_amount. | |
order.fulfillments | array of object | Shipments of the order. | |
order.fulfillments[].id | integer | Fulfillment id. | |
order.fulfillments[].order_id | integer | Order id. | |
order.fulfillments[].status | string | Fulfillment status, e.g. success. | |
order.fulfillments[].tracking_company | string | null | Carrier name. | |
order.fulfillments[].tracking_company_code | string | null | Carrier code. | |
order.fulfillments[].tracking_number | string | null | Tracking number. | |
order.fulfillments[].tracking_numbers | array of string | Tracking numbers. | |
order.fulfillments[].tracking_url | string | null | Tracking URL. | |
order.fulfillments[].tracking_urls | array of string | Tracking URLs. | |
order.fulfillments[].carrier_status_code | string | null | Carrier delivery status code. | |
order.fulfillments[].carrier_status_name | string | null | Carrier delivery status. | |
order.fulfillments[].carrier_cod_status_code | string | null | Cash-on-delivery status code. | |
order.fulfillments[].carrier_cod_status_name | string | null | Cash-on-delivery status. | |
order.fulfillments[].cod_amount | number | Cash on delivery amount to collect, VND. | |
order.fulfillments[].real_shipping_fee | number | Actual shipping fee, VND. | |
order.fulfillments[].total_weight | number | Package weight in grams. | |
order.fulfillments[].location_id | integer | null | Location the order shipped from. | |
order.fulfillments[].notify_customer | boolean | Whether the customer was notified. | |
order.fulfillments[].note | string | null | Fulfillment note. | |
order.fulfillments[].created_at | string | When it was created (ISO 8601). | |
order.fulfillments[].updated_at | string | When it was last updated (ISO 8601). | |
order.fulfillments[].line_items | array of object | Items in this fulfillment. | |
order.fulfillments[].line_items[].id | integer | Line item id. | |
order.fulfillments[].line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.fulfillments[].line_items[].variant_id | integer | Variant id. | |
order.fulfillments[].line_items[].title | string | Product title. | |
order.fulfillments[].line_items[].variant_title | string | Variant title. | |
order.fulfillments[].line_items[].name | string | Product and variant name. | |
order.fulfillments[].line_items[].sku | string | null | SKU of the variant. | |
order.fulfillments[].line_items[].barcode | string | null | Barcode of the variant. | |
order.fulfillments[].line_items[].vendor | string | Supplier of the item. | |
order.fulfillments[].line_items[].type | string | Product type. | |
order.fulfillments[].line_items[].quantity | integer | Quantity ordered. | |
order.fulfillments[].line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.fulfillments[].line_items[].price | number | Unit price before discounts, VND. | |
order.fulfillments[].line_items[].price_original | number | Unit price before any promotion, VND. | |
order.fulfillments[].line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.fulfillments[].line_items[].total_discount | number | Total discount on this line, VND. | |
order.fulfillments[].line_items[].grams | number | Weight in grams. | |
order.fulfillments[].line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.fulfillments[].line_items[].taxable | boolean | Whether the item is taxable. | |
order.fulfillments[].line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.fulfillments[].line_items[].product_exists | boolean | False when the product has been deleted. | |
order.fulfillments[].line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.fulfillments[].line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.fulfillments[].line_items[].properties | array | null | Custom properties of the line item. | |
order.fulfillments[].line_items[].image | object | Variant image. | |
order.fulfillments[].line_items[].image.src | string | Image URL. | |
order.transactions | array of object | Payments on the order. | |
order.transactions[].id | integer | Transaction id. | |
order.transactions[].order_id | integer | Order the transaction belongs to. | |
order.transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.transactions[].amount | number | Amount, VND; negative for refunds. | |
order.transactions[].currency | string | null | Currency code, e.g. VND. | |
order.transactions[].gateway | string | Name of the payment gateway. | |
order.transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.transactions[].authorization | string | null | Authorization code. | |
order.transactions[].receipt | string | null | Receipt. | |
order.transactions[].test | boolean | True for a test transaction. | |
order.transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.transactions[].location_id | integer | null | Location id. | |
order.transactions[].device_id | integer | null | Device id. | |
order.transactions[].created_at | string | When it was created (ISO 8601). | |
order.transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.transactions[].payment_details | object | null | Payment details, if any. | |
order.transactions[].send_email | boolean | Whether an email was sent. | |
order.refunds | array of object | Refunds on the order. | |
order.refunds[].id | integer | Refund id. | |
order.refunds[].order_id | integer | Order id. | |
order.refunds[].note | string | null | Note attached to the refund. | |
order.refunds[].restock | boolean | null | Whether items went back to stock. | |
order.refunds[].user_id | integer | null | Staff who made the refund. | |
order.refunds[].location_id | integer | null | Location items were returned to. | |
order.refunds[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].refund_line_items | array of object | Items returned or refunded. | |
order.refunds[].refund_line_items[].id | integer | Refund line item id. | |
order.refunds[].refund_line_items[].line_item_id | integer | Order line item it refers to. | |
order.refunds[].refund_line_items[].quantity | integer | Quantity refunded. | |
order.refunds[].refund_line_items[].line_item | object | The order line item. | |
order.refunds[].refund_line_items[].line_item.id | integer | Line item id. | |
order.refunds[].refund_line_items[].line_item.product_id | integer | null | Product id; null when the product was deleted later. | |
order.refunds[].refund_line_items[].line_item.variant_id | integer | Variant id. | |
order.refunds[].refund_line_items[].line_item.title | string | Product title. | |
order.refunds[].refund_line_items[].line_item.variant_title | string | Variant title. | |
order.refunds[].refund_line_items[].line_item.name | string | Product and variant name. | |
order.refunds[].refund_line_items[].line_item.sku | string | null | SKU of the variant. | |
order.refunds[].refund_line_items[].line_item.barcode | string | null | Barcode of the variant. | |
order.refunds[].refund_line_items[].line_item.vendor | string | Supplier of the item. | |
order.refunds[].refund_line_items[].line_item.type | string | Product type. | |
order.refunds[].refund_line_items[].line_item.quantity | integer | Quantity ordered. | |
order.refunds[].refund_line_items[].line_item.fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.refunds[].refund_line_items[].line_item.price | number | Unit price before discounts, VND. | |
order.refunds[].refund_line_items[].line_item.price_original | number | Unit price before any promotion, VND. | |
order.refunds[].refund_line_items[].line_item.price_promotion | number | Promotion discount per unit, VND. | |
order.refunds[].refund_line_items[].line_item.total_discount | number | Total discount on this line, VND. | |
order.refunds[].refund_line_items[].line_item.grams | number | Weight in grams. | |
order.refunds[].refund_line_items[].line_item.requires_shipping | boolean | Whether the item needs shipping. | |
order.refunds[].refund_line_items[].line_item.taxable | boolean | Whether the item is taxable. | |
order.refunds[].refund_line_items[].line_item.gift_card | boolean | Whether the item is a gift card. | |
order.refunds[].refund_line_items[].line_item.product_exists | boolean | False when the product has been deleted. | |
order.refunds[].refund_line_items[].line_item.fulfillment_service | string | null | Who fulfills the item. | |
order.refunds[].refund_line_items[].line_item.fulfillment_status | string | null | Fulfillment status of this line. | |
order.refunds[].refund_line_items[].line_item.properties | array | null | Custom properties of the line item. | |
order.refunds[].refund_line_items[].line_item.image | object | Variant image. | |
order.refunds[].refund_line_items[].line_item.image.src | string | Image URL. | |
order.refunds[].transactions | array of object | Money returned, as refund transactions. | |
order.refunds[].transactions[].id | integer | Transaction id. | |
order.refunds[].transactions[].order_id | integer | Order the transaction belongs to. | |
order.refunds[].transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.refunds[].transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.refunds[].transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.refunds[].transactions[].amount | number | Amount, VND; negative for refunds. | |
order.refunds[].transactions[].currency | string | null | Currency code, e.g. VND. | |
order.refunds[].transactions[].gateway | string | Name of the payment gateway. | |
order.refunds[].transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.refunds[].transactions[].authorization | string | null | Authorization code. | |
order.refunds[].transactions[].receipt | string | null | Receipt. | |
order.refunds[].transactions[].test | boolean | True for a test transaction. | |
order.refunds[].transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.refunds[].transactions[].location_id | integer | null | Location id. | |
order.refunds[].transactions[].device_id | integer | null | Device id. | |
order.refunds[].transactions[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.refunds[].transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.refunds[].transactions[].payment_details | object | null | Payment details, if any. | |
order.refunds[].transactions[].send_email | boolean | Whether an email was sent. |
Cập nhật đơn hàng (Update order) — haravan.update_order
Update an order's note, tags, email or addresses. Items and quantities cannot be changed. Look up province_code with list_provinces and the ward code (sent as district_code) with list_wards first.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | có | com.write_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
order | Thông tin cập nhật | object | có | Fields to change. |
order.email | string | không | Customer email. | |
order.phone | string | không | Customer phone number. | |
order.customer | object | không | Customer: {id} of an existing one, or first_name, last_name, phone. | |
order.shipping_address | object | không | Delivery address. | |
order.shipping_address.name | string | không | Recipient full name. | |
order.shipping_address.phone | string | không | Recipient phone number. | |
order.shipping_address.address1 | string | không | Street address: house number and street. | |
order.shipping_address.province_code | string | không | Province code from list_provinces. | |
order.shipping_address.district_code | string | không | New ward code from list_wards (two-level model). | |
order.shipping_address.ward_code | string | không | Leave empty under the two-level model. | |
order.shipping_address.country_code | string | không | Country code, VN for Vietnam. | |
order.billing_address | object | không | Billing address. | |
order.billing_address.name | string | không | Recipient full name. | |
order.billing_address.phone | string | không | Recipient phone number. | |
order.billing_address.address1 | string | không | Street address: house number and street. | |
order.billing_address.province_code | string | không | Province code from list_provinces. | |
order.billing_address.district_code | string | không | New ward code from list_wards (two-level model). | |
order.billing_address.ward_code | string | không | Leave empty under the two-level model. | |
order.billing_address.country_code | string | không | Country code, VN for Vietnam. | |
order.note | string | không | Order note. | |
order.tags | string | không | Comma-separated tags. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
order | Đơn hàng | object | The order. |
order.id | integer | Order id used by the API. | |
order.name | string | Order name shown to the shop and customer, e.g. #100020. | |
order.order_number | string | Order number shown to the shop and customer. | |
order.number | integer | Position of the order in the shop's order count. | |
order.token | string | Unique token of the order. | |
order.email | string | null | Customer email. | |
order.contact_email | string | null | Contact email of the buyer. | |
order.note | string | null | Order note. | |
order.note_attributes | array of object | Extra name/value details added to the order. | |
order.note_attributes[].name | string | Name. | |
order.note_attributes[].value | string | Value. | |
order.tags | string | null | Comma-separated tags. | |
order.currency | string | Currency code, e.g. VND. | |
order.total_price | number | Total of items, discounts, shipping and tax, VND. | |
order.subtotal_price | number | Price after discounts, before shipping and tax, VND. | |
order.total_line_items_price | number | Sum of line item prices, VND. | |
order.total_discounts | number | Total discounts, VND. | |
order.total_tax | number | Total tax, VND. | |
order.total_weight | number | Total weight in grams. | |
order.taxes_included | boolean | null | Whether tax is included in the subtotal. | |
order.financial_status | string | Payment status: pending, authorized, partially_paid, paid, partially_refunded, refunded or voided. | |
order.fulfillment_status | string | null | Delivery status: fulfilled, partial, restocked, or null/notfulfilled when nothing shipped. | |
order.gateway | string | null | Payment gateway name. | |
order.gateway_code | string | null | Payment gateway code, e.g. COD. | |
order.processing_method | string | null | How the payment was processed: checkout, direct, manual or offsite. | |
order.closed_status | string | unclosed or closed. | |
order.cancelled_status | string | uncancelled or cancelled. | |
order.confirmed_status | string | unconfirmed or confirmed. | |
order.cancel_reason | string | null | Why it was cancelled: customer, fraud, inventory, declined or other. | |
order.created_at | string | When the order was created (ISO 8601). | |
order.updated_at | string | When the order was last updated (ISO 8601). | |
order.closed_at | string | null | When the order was closed (ISO 8601). | |
order.cancelled_at | string | null | When the order was cancelled (ISO 8601). | |
order.confirmed_at | string | null | When the order was confirmed (ISO 8601). | |
order.source_name | string | null | Where the order came from, e.g. web or pos. | |
order.source | string | null | Channel that created the order. | |
order.landing_site | string | null | Page where the buyer entered the shop. | |
order.landing_site_ref | string | null | Ref of the landing page. | |
order.referring_site | string | null | Site that referred the buyer. | |
order.utm_source | string | null | UTM source. | |
order.utm_medium | string | null | UTM medium. | |
order.utm_campaign | string | null | UTM campaign. | |
order.utm_term | string | null | UTM term. | |
order.utm_content | string | null | UTM content. | |
order.buyer_accepts_marketing | boolean | Whether the buyer accepts marketing. | |
order.browser_ip | string | null | Buyer's IP address. | |
order.cart_token | string | null | Token of the cart behind the order. | |
order.checkout_token | string | null | Token of the checkout behind the order. | |
order.user_id | integer | null | Staff who processed the order; 0 if none. | |
order.location_id | integer | null | Location where the order was processed. | |
order.location_name | string | null | Name of that location. | |
order.assigned_location_id | integer | null | Location assigned to handle it. | |
order.assigned_location_name | string | null | Name of the assigned location. | |
order.assigned_location_at | string | null | When the location was assigned. | |
order.client_details | object | Browser the customer used. | |
order.client_details.accept_language | string | null | Browser languages. | |
order.client_details.browser_ip | string | null | IP address. | |
order.client_details.browser_height | integer | null | Screen height in pixels. | |
order.client_details.browser_width | integer | null | Screen width in pixels. | |
order.client_details.session_hash | string | null | Session hash. | |
order.client_details.user_agent | string | null | Browser user agent. | |
order.billing_address | object | Billing address. | |
order.billing_address.id | integer | Address id. | |
order.billing_address.name | string | Full name of the person at this address. | |
order.billing_address.first_name | string | First name. | |
order.billing_address.last_name | string | Last name. | |
order.billing_address.company | string | Company name. | |
order.billing_address.phone | string | Phone number. | |
order.billing_address.address1 | string | Street address: house number and street. | |
order.billing_address.address2 | string | Second address line. | |
order.billing_address.city | string | City, town or village. | |
order.billing_address.province | string | Province or city name. | |
order.billing_address.province_code | string | Province code; matches list_provinces. | |
order.billing_address.district | string | Ward name under the two-level model (district name before). | |
order.billing_address.district_code | string | Ward code; matches list_wards. | |
order.billing_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.billing_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.billing_address.country | string | Country name. | |
order.billing_address.country_code | string | Two-letter country code, e.g. VN. | |
order.billing_address.zip | string | Postal code. | |
order.billing_address.latitude | number | Latitude, if known. | |
order.billing_address.longitude | number | Longitude, if known. | |
order.billing_address.default | boolean | True when this is the default address. | |
order.shipping_address | object | Delivery address. | |
order.shipping_address.id | integer | Address id. | |
order.shipping_address.name | string | Full name of the person at this address. | |
order.shipping_address.first_name | string | First name. | |
order.shipping_address.last_name | string | Last name. | |
order.shipping_address.company | string | Company name. | |
order.shipping_address.phone | string | Phone number. | |
order.shipping_address.address1 | string | Street address: house number and street. | |
order.shipping_address.address2 | string | Second address line. | |
order.shipping_address.city | string | City, town or village. | |
order.shipping_address.province | string | Province or city name. | |
order.shipping_address.province_code | string | Province code; matches list_provinces. | |
order.shipping_address.district | string | Ward name under the two-level model (district name before). | |
order.shipping_address.district_code | string | Ward code; matches list_wards. | |
order.shipping_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.shipping_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.shipping_address.country | string | Country name. | |
order.shipping_address.country_code | string | Two-letter country code, e.g. VN. | |
order.shipping_address.zip | string | Postal code. | |
order.shipping_address.latitude | number | Latitude, if known. | |
order.shipping_address.longitude | number | Longitude, if known. | |
order.shipping_address.default | boolean | True when this is the default address. | |
order.customer | object | The customer; null for some POS orders. | |
order.customer.id | integer | Customer id. | |
order.customer.email | string | null | Email. | |
order.customer.phone | string | null | Phone number. | |
order.customer.first_name | string | null | First name. | |
order.customer.last_name | string | null | Last name. | |
order.customer.accepts_marketing | boolean | Whether the customer accepts marketing. | |
order.customer.tags | string | null | Comma-separated tags. | |
order.customer.note | string | null | Note about the customer. | |
order.customer.state | string | Account state. | |
order.customer.orders_count | integer | Number of orders. | |
order.customer.total_spent | number | Total spent, VND. | |
order.customer.last_order_id | integer | null | Latest order id. | |
order.customer.last_order_name | string | null | Latest order name. | |
order.customer.default_address | object | Default address. | |
order.customer.default_address.id | integer | Address id. | |
order.customer.default_address.name | string | Full name of the person at this address. | |
order.customer.default_address.first_name | string | First name. | |
order.customer.default_address.last_name | string | Last name. | |
order.customer.default_address.company | string | Company name. | |
order.customer.default_address.phone | string | Phone number. | |
order.customer.default_address.address1 | string | Street address: house number and street. | |
order.customer.default_address.address2 | string | Second address line. | |
order.customer.default_address.city | string | City, town or village. | |
order.customer.default_address.province | string | Province or city name. | |
order.customer.default_address.province_code | string | Province code; matches list_provinces. | |
order.customer.default_address.district | string | Ward name under the two-level model (district name before). | |
order.customer.default_address.district_code | string | Ward code; matches list_wards. | |
order.customer.default_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.default_address.country | string | Country name. | |
order.customer.default_address.country_code | string | Two-letter country code, e.g. VN. | |
order.customer.default_address.zip | string | Postal code. | |
order.customer.default_address.latitude | number | Latitude, if known. | |
order.customer.default_address.longitude | number | Longitude, if known. | |
order.customer.default_address.default | boolean | True when this is the default address. | |
order.customer.addresses | array of object | All addresses. | |
order.customer.addresses[].id | integer | Address id. | |
order.customer.addresses[].name | string | Full name of the person at this address. | |
order.customer.addresses[].first_name | string | First name. | |
order.customer.addresses[].last_name | string | Last name. | |
order.customer.addresses[].company | string | Company name. | |
order.customer.addresses[].phone | string | Phone number. | |
order.customer.addresses[].address1 | string | Street address: house number and street. | |
order.customer.addresses[].address2 | string | Second address line. | |
order.customer.addresses[].city | string | City, town or village. | |
order.customer.addresses[].province | string | Province or city name. | |
order.customer.addresses[].province_code | string | Province code; matches list_provinces. | |
order.customer.addresses[].district | string | Ward name under the two-level model (district name before). | |
order.customer.addresses[].district_code | string | Ward code; matches list_wards. | |
order.customer.addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.addresses[].country | string | Country name. | |
order.customer.addresses[].country_code | string | Two-letter country code, e.g. VN. | |
order.customer.addresses[].zip | string | Postal code. | |
order.customer.addresses[].latitude | number | Latitude, if known. | |
order.customer.addresses[].longitude | number | Longitude, if known. | |
order.customer.addresses[].default | boolean | True when this is the default address. | |
order.customer.created_at | string | When it was created (ISO 8601). | |
order.customer.updated_at | string | When it was last updated (ISO 8601). | |
order.line_items | array of object | Items ordered. | |
order.line_items[].id | integer | Line item id. | |
order.line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.line_items[].variant_id | integer | Variant id. | |
order.line_items[].title | string | Product title. | |
order.line_items[].variant_title | string | Variant title. | |
order.line_items[].name | string | Product and variant name. | |
order.line_items[].sku | string | null | SKU of the variant. | |
order.line_items[].barcode | string | null | Barcode of the variant. | |
order.line_items[].vendor | string | Supplier of the item. | |
order.line_items[].type | string | Product type. | |
order.line_items[].quantity | integer | Quantity ordered. | |
order.line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.line_items[].price | number | Unit price before discounts, VND. | |
order.line_items[].price_original | number | Unit price before any promotion, VND. | |
order.line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.line_items[].total_discount | number | Total discount on this line, VND. | |
order.line_items[].grams | number | Weight in grams. | |
order.line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.line_items[].taxable | boolean | Whether the item is taxable. | |
order.line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.line_items[].product_exists | boolean | False when the product has been deleted. | |
order.line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.line_items[].properties | array | null | Custom properties of the line item. | |
order.line_items[].image | object | Variant image. | |
order.line_items[].image.src | string | Image URL. | |
order.shipping_lines | array of object | Shipping methods used. | |
order.shipping_lines[].code | string | null | Shipping method reference. | |
order.shipping_lines[].title | string | null | Shipping method title. | |
order.shipping_lines[].price | number | Shipping price, VND. | |
order.shipping_lines[].source | string | null | Source of the shipping method. | |
order.discount_codes | array of object | Discount codes applied. | |
order.discount_codes[].code | string | The code. | |
order.discount_codes[].amount | number | Discount amount. | |
order.discount_codes[].type | string | percentage, shipping or fixed_amount. | |
order.fulfillments | array of object | Shipments of the order. | |
order.fulfillments[].id | integer | Fulfillment id. | |
order.fulfillments[].order_id | integer | Order id. | |
order.fulfillments[].status | string | Fulfillment status, e.g. success. | |
order.fulfillments[].tracking_company | string | null | Carrier name. | |
order.fulfillments[].tracking_company_code | string | null | Carrier code. | |
order.fulfillments[].tracking_number | string | null | Tracking number. | |
order.fulfillments[].tracking_numbers | array of string | Tracking numbers. | |
order.fulfillments[].tracking_url | string | null | Tracking URL. | |
order.fulfillments[].tracking_urls | array of string | Tracking URLs. | |
order.fulfillments[].carrier_status_code | string | null | Carrier delivery status code. | |
order.fulfillments[].carrier_status_name | string | null | Carrier delivery status. | |
order.fulfillments[].carrier_cod_status_code | string | null | Cash-on-delivery status code. | |
order.fulfillments[].carrier_cod_status_name | string | null | Cash-on-delivery status. | |
order.fulfillments[].cod_amount | number | Cash on delivery amount to collect, VND. | |
order.fulfillments[].real_shipping_fee | number | Actual shipping fee, VND. | |
order.fulfillments[].total_weight | number | Package weight in grams. | |
order.fulfillments[].location_id | integer | null | Location the order shipped from. | |
order.fulfillments[].notify_customer | boolean | Whether the customer was notified. | |
order.fulfillments[].note | string | null | Fulfillment note. | |
order.fulfillments[].created_at | string | When it was created (ISO 8601). | |
order.fulfillments[].updated_at | string | When it was last updated (ISO 8601). | |
order.fulfillments[].line_items | array of object | Items in this fulfillment. | |
order.fulfillments[].line_items[].id | integer | Line item id. | |
order.fulfillments[].line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.fulfillments[].line_items[].variant_id | integer | Variant id. | |
order.fulfillments[].line_items[].title | string | Product title. | |
order.fulfillments[].line_items[].variant_title | string | Variant title. | |
order.fulfillments[].line_items[].name | string | Product and variant name. | |
order.fulfillments[].line_items[].sku | string | null | SKU of the variant. | |
order.fulfillments[].line_items[].barcode | string | null | Barcode of the variant. | |
order.fulfillments[].line_items[].vendor | string | Supplier of the item. | |
order.fulfillments[].line_items[].type | string | Product type. | |
order.fulfillments[].line_items[].quantity | integer | Quantity ordered. | |
order.fulfillments[].line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.fulfillments[].line_items[].price | number | Unit price before discounts, VND. | |
order.fulfillments[].line_items[].price_original | number | Unit price before any promotion, VND. | |
order.fulfillments[].line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.fulfillments[].line_items[].total_discount | number | Total discount on this line, VND. | |
order.fulfillments[].line_items[].grams | number | Weight in grams. | |
order.fulfillments[].line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.fulfillments[].line_items[].taxable | boolean | Whether the item is taxable. | |
order.fulfillments[].line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.fulfillments[].line_items[].product_exists | boolean | False when the product has been deleted. | |
order.fulfillments[].line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.fulfillments[].line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.fulfillments[].line_items[].properties | array | null | Custom properties of the line item. | |
order.fulfillments[].line_items[].image | object | Variant image. | |
order.fulfillments[].line_items[].image.src | string | Image URL. | |
order.transactions | array of object | Payments on the order. | |
order.transactions[].id | integer | Transaction id. | |
order.transactions[].order_id | integer | Order the transaction belongs to. | |
order.transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.transactions[].amount | number | Amount, VND; negative for refunds. | |
order.transactions[].currency | string | null | Currency code, e.g. VND. | |
order.transactions[].gateway | string | Name of the payment gateway. | |
order.transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.transactions[].authorization | string | null | Authorization code. | |
order.transactions[].receipt | string | null | Receipt. | |
order.transactions[].test | boolean | True for a test transaction. | |
order.transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.transactions[].location_id | integer | null | Location id. | |
order.transactions[].device_id | integer | null | Device id. | |
order.transactions[].created_at | string | When it was created (ISO 8601). | |
order.transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.transactions[].payment_details | object | null | Payment details, if any. | |
order.transactions[].send_email | boolean | Whether an email was sent. | |
order.refunds | array of object | Refunds on the order. | |
order.refunds[].id | integer | Refund id. | |
order.refunds[].order_id | integer | Order id. | |
order.refunds[].note | string | null | Note attached to the refund. | |
order.refunds[].restock | boolean | null | Whether items went back to stock. | |
order.refunds[].user_id | integer | null | Staff who made the refund. | |
order.refunds[].location_id | integer | null | Location items were returned to. | |
order.refunds[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].refund_line_items | array of object | Items returned or refunded. | |
order.refunds[].refund_line_items[].id | integer | Refund line item id. | |
order.refunds[].refund_line_items[].line_item_id | integer | Order line item it refers to. | |
order.refunds[].refund_line_items[].quantity | integer | Quantity refunded. | |
order.refunds[].refund_line_items[].line_item | object | The order line item. | |
order.refunds[].refund_line_items[].line_item.id | integer | Line item id. | |
order.refunds[].refund_line_items[].line_item.product_id | integer | null | Product id; null when the product was deleted later. | |
order.refunds[].refund_line_items[].line_item.variant_id | integer | Variant id. | |
order.refunds[].refund_line_items[].line_item.title | string | Product title. | |
order.refunds[].refund_line_items[].line_item.variant_title | string | Variant title. | |
order.refunds[].refund_line_items[].line_item.name | string | Product and variant name. | |
order.refunds[].refund_line_items[].line_item.sku | string | null | SKU of the variant. | |
order.refunds[].refund_line_items[].line_item.barcode | string | null | Barcode of the variant. | |
order.refunds[].refund_line_items[].line_item.vendor | string | Supplier of the item. | |
order.refunds[].refund_line_items[].line_item.type | string | Product type. | |
order.refunds[].refund_line_items[].line_item.quantity | integer | Quantity ordered. | |
order.refunds[].refund_line_items[].line_item.fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.refunds[].refund_line_items[].line_item.price | number | Unit price before discounts, VND. | |
order.refunds[].refund_line_items[].line_item.price_original | number | Unit price before any promotion, VND. | |
order.refunds[].refund_line_items[].line_item.price_promotion | number | Promotion discount per unit, VND. | |
order.refunds[].refund_line_items[].line_item.total_discount | number | Total discount on this line, VND. | |
order.refunds[].refund_line_items[].line_item.grams | number | Weight in grams. | |
order.refunds[].refund_line_items[].line_item.requires_shipping | boolean | Whether the item needs shipping. | |
order.refunds[].refund_line_items[].line_item.taxable | boolean | Whether the item is taxable. | |
order.refunds[].refund_line_items[].line_item.gift_card | boolean | Whether the item is a gift card. | |
order.refunds[].refund_line_items[].line_item.product_exists | boolean | False when the product has been deleted. | |
order.refunds[].refund_line_items[].line_item.fulfillment_service | string | null | Who fulfills the item. | |
order.refunds[].refund_line_items[].line_item.fulfillment_status | string | null | Fulfillment status of this line. | |
order.refunds[].refund_line_items[].line_item.properties | array | null | Custom properties of the line item. | |
order.refunds[].refund_line_items[].line_item.image | object | Variant image. | |
order.refunds[].refund_line_items[].line_item.image.src | string | Image URL. | |
order.refunds[].transactions | array of object | Money returned, as refund transactions. | |
order.refunds[].transactions[].id | integer | Transaction id. | |
order.refunds[].transactions[].order_id | integer | Order the transaction belongs to. | |
order.refunds[].transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.refunds[].transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.refunds[].transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.refunds[].transactions[].amount | number | Amount, VND; negative for refunds. | |
order.refunds[].transactions[].currency | string | null | Currency code, e.g. VND. | |
order.refunds[].transactions[].gateway | string | Name of the payment gateway. | |
order.refunds[].transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.refunds[].transactions[].authorization | string | null | Authorization code. | |
order.refunds[].transactions[].receipt | string | null | Receipt. | |
order.refunds[].transactions[].test | boolean | True for a test transaction. | |
order.refunds[].transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.refunds[].transactions[].location_id | integer | null | Location id. | |
order.refunds[].transactions[].device_id | integer | null | Device id. | |
order.refunds[].transactions[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.refunds[].transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.refunds[].transactions[].payment_details | object | null | Payment details, if any. | |
order.refunds[].transactions[].send_email | boolean | Whether an email was sent. |
Xác nhận đơn hàng (Confirm order) — haravan.confirm_order
Confirm a new order.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | com.write_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
order | Đơn hàng | object | The order. |
order.id | integer | Order id used by the API. | |
order.name | string | Order name shown to the shop and customer, e.g. #100020. | |
order.order_number | string | Order number shown to the shop and customer. | |
order.number | integer | Position of the order in the shop's order count. | |
order.token | string | Unique token of the order. | |
order.email | string | null | Customer email. | |
order.contact_email | string | null | Contact email of the buyer. | |
order.note | string | null | Order note. | |
order.note_attributes | array of object | Extra name/value details added to the order. | |
order.note_attributes[].name | string | Name. | |
order.note_attributes[].value | string | Value. | |
order.tags | string | null | Comma-separated tags. | |
order.currency | string | Currency code, e.g. VND. | |
order.total_price | number | Total of items, discounts, shipping and tax, VND. | |
order.subtotal_price | number | Price after discounts, before shipping and tax, VND. | |
order.total_line_items_price | number | Sum of line item prices, VND. | |
order.total_discounts | number | Total discounts, VND. | |
order.total_tax | number | Total tax, VND. | |
order.total_weight | number | Total weight in grams. | |
order.taxes_included | boolean | null | Whether tax is included in the subtotal. | |
order.financial_status | string | Payment status: pending, authorized, partially_paid, paid, partially_refunded, refunded or voided. | |
order.fulfillment_status | string | null | Delivery status: fulfilled, partial, restocked, or null/notfulfilled when nothing shipped. | |
order.gateway | string | null | Payment gateway name. | |
order.gateway_code | string | null | Payment gateway code, e.g. COD. | |
order.processing_method | string | null | How the payment was processed: checkout, direct, manual or offsite. | |
order.closed_status | string | unclosed or closed. | |
order.cancelled_status | string | uncancelled or cancelled. | |
order.confirmed_status | string | unconfirmed or confirmed. | |
order.cancel_reason | string | null | Why it was cancelled: customer, fraud, inventory, declined or other. | |
order.created_at | string | When the order was created (ISO 8601). | |
order.updated_at | string | When the order was last updated (ISO 8601). | |
order.closed_at | string | null | When the order was closed (ISO 8601). | |
order.cancelled_at | string | null | When the order was cancelled (ISO 8601). | |
order.confirmed_at | string | null | When the order was confirmed (ISO 8601). | |
order.source_name | string | null | Where the order came from, e.g. web or pos. | |
order.source | string | null | Channel that created the order. | |
order.landing_site | string | null | Page where the buyer entered the shop. | |
order.landing_site_ref | string | null | Ref of the landing page. | |
order.referring_site | string | null | Site that referred the buyer. | |
order.utm_source | string | null | UTM source. | |
order.utm_medium | string | null | UTM medium. | |
order.utm_campaign | string | null | UTM campaign. | |
order.utm_term | string | null | UTM term. | |
order.utm_content | string | null | UTM content. | |
order.buyer_accepts_marketing | boolean | Whether the buyer accepts marketing. | |
order.browser_ip | string | null | Buyer's IP address. | |
order.cart_token | string | null | Token of the cart behind the order. | |
order.checkout_token | string | null | Token of the checkout behind the order. | |
order.user_id | integer | null | Staff who processed the order; 0 if none. | |
order.location_id | integer | null | Location where the order was processed. | |
order.location_name | string | null | Name of that location. | |
order.assigned_location_id | integer | null | Location assigned to handle it. | |
order.assigned_location_name | string | null | Name of the assigned location. | |
order.assigned_location_at | string | null | When the location was assigned. | |
order.client_details | object | Browser the customer used. | |
order.client_details.accept_language | string | null | Browser languages. | |
order.client_details.browser_ip | string | null | IP address. | |
order.client_details.browser_height | integer | null | Screen height in pixels. | |
order.client_details.browser_width | integer | null | Screen width in pixels. | |
order.client_details.session_hash | string | null | Session hash. | |
order.client_details.user_agent | string | null | Browser user agent. | |
order.billing_address | object | Billing address. | |
order.billing_address.id | integer | Address id. | |
order.billing_address.name | string | Full name of the person at this address. | |
order.billing_address.first_name | string | First name. | |
order.billing_address.last_name | string | Last name. | |
order.billing_address.company | string | Company name. | |
order.billing_address.phone | string | Phone number. | |
order.billing_address.address1 | string | Street address: house number and street. | |
order.billing_address.address2 | string | Second address line. | |
order.billing_address.city | string | City, town or village. | |
order.billing_address.province | string | Province or city name. | |
order.billing_address.province_code | string | Province code; matches list_provinces. | |
order.billing_address.district | string | Ward name under the two-level model (district name before). | |
order.billing_address.district_code | string | Ward code; matches list_wards. | |
order.billing_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.billing_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.billing_address.country | string | Country name. | |
order.billing_address.country_code | string | Two-letter country code, e.g. VN. | |
order.billing_address.zip | string | Postal code. | |
order.billing_address.latitude | number | Latitude, if known. | |
order.billing_address.longitude | number | Longitude, if known. | |
order.billing_address.default | boolean | True when this is the default address. | |
order.shipping_address | object | Delivery address. | |
order.shipping_address.id | integer | Address id. | |
order.shipping_address.name | string | Full name of the person at this address. | |
order.shipping_address.first_name | string | First name. | |
order.shipping_address.last_name | string | Last name. | |
order.shipping_address.company | string | Company name. | |
order.shipping_address.phone | string | Phone number. | |
order.shipping_address.address1 | string | Street address: house number and street. | |
order.shipping_address.address2 | string | Second address line. | |
order.shipping_address.city | string | City, town or village. | |
order.shipping_address.province | string | Province or city name. | |
order.shipping_address.province_code | string | Province code; matches list_provinces. | |
order.shipping_address.district | string | Ward name under the two-level model (district name before). | |
order.shipping_address.district_code | string | Ward code; matches list_wards. | |
order.shipping_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.shipping_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.shipping_address.country | string | Country name. | |
order.shipping_address.country_code | string | Two-letter country code, e.g. VN. | |
order.shipping_address.zip | string | Postal code. | |
order.shipping_address.latitude | number | Latitude, if known. | |
order.shipping_address.longitude | number | Longitude, if known. | |
order.shipping_address.default | boolean | True when this is the default address. | |
order.customer | object | The customer; null for some POS orders. | |
order.customer.id | integer | Customer id. | |
order.customer.email | string | null | Email. | |
order.customer.phone | string | null | Phone number. | |
order.customer.first_name | string | null | First name. | |
order.customer.last_name | string | null | Last name. | |
order.customer.accepts_marketing | boolean | Whether the customer accepts marketing. | |
order.customer.tags | string | null | Comma-separated tags. | |
order.customer.note | string | null | Note about the customer. | |
order.customer.state | string | Account state. | |
order.customer.orders_count | integer | Number of orders. | |
order.customer.total_spent | number | Total spent, VND. | |
order.customer.last_order_id | integer | null | Latest order id. | |
order.customer.last_order_name | string | null | Latest order name. | |
order.customer.default_address | object | Default address. | |
order.customer.default_address.id | integer | Address id. | |
order.customer.default_address.name | string | Full name of the person at this address. | |
order.customer.default_address.first_name | string | First name. | |
order.customer.default_address.last_name | string | Last name. | |
order.customer.default_address.company | string | Company name. | |
order.customer.default_address.phone | string | Phone number. | |
order.customer.default_address.address1 | string | Street address: house number and street. | |
order.customer.default_address.address2 | string | Second address line. | |
order.customer.default_address.city | string | City, town or village. | |
order.customer.default_address.province | string | Province or city name. | |
order.customer.default_address.province_code | string | Province code; matches list_provinces. | |
order.customer.default_address.district | string | Ward name under the two-level model (district name before). | |
order.customer.default_address.district_code | string | Ward code; matches list_wards. | |
order.customer.default_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.default_address.country | string | Country name. | |
order.customer.default_address.country_code | string | Two-letter country code, e.g. VN. | |
order.customer.default_address.zip | string | Postal code. | |
order.customer.default_address.latitude | number | Latitude, if known. | |
order.customer.default_address.longitude | number | Longitude, if known. | |
order.customer.default_address.default | boolean | True when this is the default address. | |
order.customer.addresses | array of object | All addresses. | |
order.customer.addresses[].id | integer | Address id. | |
order.customer.addresses[].name | string | Full name of the person at this address. | |
order.customer.addresses[].first_name | string | First name. | |
order.customer.addresses[].last_name | string | Last name. | |
order.customer.addresses[].company | string | Company name. | |
order.customer.addresses[].phone | string | Phone number. | |
order.customer.addresses[].address1 | string | Street address: house number and street. | |
order.customer.addresses[].address2 | string | Second address line. | |
order.customer.addresses[].city | string | City, town or village. | |
order.customer.addresses[].province | string | Province or city name. | |
order.customer.addresses[].province_code | string | Province code; matches list_provinces. | |
order.customer.addresses[].district | string | Ward name under the two-level model (district name before). | |
order.customer.addresses[].district_code | string | Ward code; matches list_wards. | |
order.customer.addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.addresses[].country | string | Country name. | |
order.customer.addresses[].country_code | string | Two-letter country code, e.g. VN. | |
order.customer.addresses[].zip | string | Postal code. | |
order.customer.addresses[].latitude | number | Latitude, if known. | |
order.customer.addresses[].longitude | number | Longitude, if known. | |
order.customer.addresses[].default | boolean | True when this is the default address. | |
order.customer.created_at | string | When it was created (ISO 8601). | |
order.customer.updated_at | string | When it was last updated (ISO 8601). | |
order.line_items | array of object | Items ordered. | |
order.line_items[].id | integer | Line item id. | |
order.line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.line_items[].variant_id | integer | Variant id. | |
order.line_items[].title | string | Product title. | |
order.line_items[].variant_title | string | Variant title. | |
order.line_items[].name | string | Product and variant name. | |
order.line_items[].sku | string | null | SKU of the variant. | |
order.line_items[].barcode | string | null | Barcode of the variant. | |
order.line_items[].vendor | string | Supplier of the item. | |
order.line_items[].type | string | Product type. | |
order.line_items[].quantity | integer | Quantity ordered. | |
order.line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.line_items[].price | number | Unit price before discounts, VND. | |
order.line_items[].price_original | number | Unit price before any promotion, VND. | |
order.line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.line_items[].total_discount | number | Total discount on this line, VND. | |
order.line_items[].grams | number | Weight in grams. | |
order.line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.line_items[].taxable | boolean | Whether the item is taxable. | |
order.line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.line_items[].product_exists | boolean | False when the product has been deleted. | |
order.line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.line_items[].properties | array | null | Custom properties of the line item. | |
order.line_items[].image | object | Variant image. | |
order.line_items[].image.src | string | Image URL. | |
order.shipping_lines | array of object | Shipping methods used. | |
order.shipping_lines[].code | string | null | Shipping method reference. | |
order.shipping_lines[].title | string | null | Shipping method title. | |
order.shipping_lines[].price | number | Shipping price, VND. | |
order.shipping_lines[].source | string | null | Source of the shipping method. | |
order.discount_codes | array of object | Discount codes applied. | |
order.discount_codes[].code | string | The code. | |
order.discount_codes[].amount | number | Discount amount. | |
order.discount_codes[].type | string | percentage, shipping or fixed_amount. | |
order.fulfillments | array of object | Shipments of the order. | |
order.fulfillments[].id | integer | Fulfillment id. | |
order.fulfillments[].order_id | integer | Order id. | |
order.fulfillments[].status | string | Fulfillment status, e.g. success. | |
order.fulfillments[].tracking_company | string | null | Carrier name. | |
order.fulfillments[].tracking_company_code | string | null | Carrier code. | |
order.fulfillments[].tracking_number | string | null | Tracking number. | |
order.fulfillments[].tracking_numbers | array of string | Tracking numbers. | |
order.fulfillments[].tracking_url | string | null | Tracking URL. | |
order.fulfillments[].tracking_urls | array of string | Tracking URLs. | |
order.fulfillments[].carrier_status_code | string | null | Carrier delivery status code. | |
order.fulfillments[].carrier_status_name | string | null | Carrier delivery status. | |
order.fulfillments[].carrier_cod_status_code | string | null | Cash-on-delivery status code. | |
order.fulfillments[].carrier_cod_status_name | string | null | Cash-on-delivery status. | |
order.fulfillments[].cod_amount | number | Cash on delivery amount to collect, VND. | |
order.fulfillments[].real_shipping_fee | number | Actual shipping fee, VND. | |
order.fulfillments[].total_weight | number | Package weight in grams. | |
order.fulfillments[].location_id | integer | null | Location the order shipped from. | |
order.fulfillments[].notify_customer | boolean | Whether the customer was notified. | |
order.fulfillments[].note | string | null | Fulfillment note. | |
order.fulfillments[].created_at | string | When it was created (ISO 8601). | |
order.fulfillments[].updated_at | string | When it was last updated (ISO 8601). | |
order.fulfillments[].line_items | array of object | Items in this fulfillment. | |
order.fulfillments[].line_items[].id | integer | Line item id. | |
order.fulfillments[].line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.fulfillments[].line_items[].variant_id | integer | Variant id. | |
order.fulfillments[].line_items[].title | string | Product title. | |
order.fulfillments[].line_items[].variant_title | string | Variant title. | |
order.fulfillments[].line_items[].name | string | Product and variant name. | |
order.fulfillments[].line_items[].sku | string | null | SKU of the variant. | |
order.fulfillments[].line_items[].barcode | string | null | Barcode of the variant. | |
order.fulfillments[].line_items[].vendor | string | Supplier of the item. | |
order.fulfillments[].line_items[].type | string | Product type. | |
order.fulfillments[].line_items[].quantity | integer | Quantity ordered. | |
order.fulfillments[].line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.fulfillments[].line_items[].price | number | Unit price before discounts, VND. | |
order.fulfillments[].line_items[].price_original | number | Unit price before any promotion, VND. | |
order.fulfillments[].line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.fulfillments[].line_items[].total_discount | number | Total discount on this line, VND. | |
order.fulfillments[].line_items[].grams | number | Weight in grams. | |
order.fulfillments[].line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.fulfillments[].line_items[].taxable | boolean | Whether the item is taxable. | |
order.fulfillments[].line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.fulfillments[].line_items[].product_exists | boolean | False when the product has been deleted. | |
order.fulfillments[].line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.fulfillments[].line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.fulfillments[].line_items[].properties | array | null | Custom properties of the line item. | |
order.fulfillments[].line_items[].image | object | Variant image. | |
order.fulfillments[].line_items[].image.src | string | Image URL. | |
order.transactions | array of object | Payments on the order. | |
order.transactions[].id | integer | Transaction id. | |
order.transactions[].order_id | integer | Order the transaction belongs to. | |
order.transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.transactions[].amount | number | Amount, VND; negative for refunds. | |
order.transactions[].currency | string | null | Currency code, e.g. VND. | |
order.transactions[].gateway | string | Name of the payment gateway. | |
order.transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.transactions[].authorization | string | null | Authorization code. | |
order.transactions[].receipt | string | null | Receipt. | |
order.transactions[].test | boolean | True for a test transaction. | |
order.transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.transactions[].location_id | integer | null | Location id. | |
order.transactions[].device_id | integer | null | Device id. | |
order.transactions[].created_at | string | When it was created (ISO 8601). | |
order.transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.transactions[].payment_details | object | null | Payment details, if any. | |
order.transactions[].send_email | boolean | Whether an email was sent. | |
order.refunds | array of object | Refunds on the order. | |
order.refunds[].id | integer | Refund id. | |
order.refunds[].order_id | integer | Order id. | |
order.refunds[].note | string | null | Note attached to the refund. | |
order.refunds[].restock | boolean | null | Whether items went back to stock. | |
order.refunds[].user_id | integer | null | Staff who made the refund. | |
order.refunds[].location_id | integer | null | Location items were returned to. | |
order.refunds[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].refund_line_items | array of object | Items returned or refunded. | |
order.refunds[].refund_line_items[].id | integer | Refund line item id. | |
order.refunds[].refund_line_items[].line_item_id | integer | Order line item it refers to. | |
order.refunds[].refund_line_items[].quantity | integer | Quantity refunded. | |
order.refunds[].refund_line_items[].line_item | object | The order line item. | |
order.refunds[].refund_line_items[].line_item.id | integer | Line item id. | |
order.refunds[].refund_line_items[].line_item.product_id | integer | null | Product id; null when the product was deleted later. | |
order.refunds[].refund_line_items[].line_item.variant_id | integer | Variant id. | |
order.refunds[].refund_line_items[].line_item.title | string | Product title. | |
order.refunds[].refund_line_items[].line_item.variant_title | string | Variant title. | |
order.refunds[].refund_line_items[].line_item.name | string | Product and variant name. | |
order.refunds[].refund_line_items[].line_item.sku | string | null | SKU of the variant. | |
order.refunds[].refund_line_items[].line_item.barcode | string | null | Barcode of the variant. | |
order.refunds[].refund_line_items[].line_item.vendor | string | Supplier of the item. | |
order.refunds[].refund_line_items[].line_item.type | string | Product type. | |
order.refunds[].refund_line_items[].line_item.quantity | integer | Quantity ordered. | |
order.refunds[].refund_line_items[].line_item.fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.refunds[].refund_line_items[].line_item.price | number | Unit price before discounts, VND. | |
order.refunds[].refund_line_items[].line_item.price_original | number | Unit price before any promotion, VND. | |
order.refunds[].refund_line_items[].line_item.price_promotion | number | Promotion discount per unit, VND. | |
order.refunds[].refund_line_items[].line_item.total_discount | number | Total discount on this line, VND. | |
order.refunds[].refund_line_items[].line_item.grams | number | Weight in grams. | |
order.refunds[].refund_line_items[].line_item.requires_shipping | boolean | Whether the item needs shipping. | |
order.refunds[].refund_line_items[].line_item.taxable | boolean | Whether the item is taxable. | |
order.refunds[].refund_line_items[].line_item.gift_card | boolean | Whether the item is a gift card. | |
order.refunds[].refund_line_items[].line_item.product_exists | boolean | False when the product has been deleted. | |
order.refunds[].refund_line_items[].line_item.fulfillment_service | string | null | Who fulfills the item. | |
order.refunds[].refund_line_items[].line_item.fulfillment_status | string | null | Fulfillment status of this line. | |
order.refunds[].refund_line_items[].line_item.properties | array | null | Custom properties of the line item. | |
order.refunds[].refund_line_items[].line_item.image | object | Variant image. | |
order.refunds[].refund_line_items[].line_item.image.src | string | Image URL. | |
order.refunds[].transactions | array of object | Money returned, as refund transactions. | |
order.refunds[].transactions[].id | integer | Transaction id. | |
order.refunds[].transactions[].order_id | integer | Order the transaction belongs to. | |
order.refunds[].transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.refunds[].transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.refunds[].transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.refunds[].transactions[].amount | number | Amount, VND; negative for refunds. | |
order.refunds[].transactions[].currency | string | null | Currency code, e.g. VND. | |
order.refunds[].transactions[].gateway | string | Name of the payment gateway. | |
order.refunds[].transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.refunds[].transactions[].authorization | string | null | Authorization code. | |
order.refunds[].transactions[].receipt | string | null | Receipt. | |
order.refunds[].transactions[].test | boolean | True for a test transaction. | |
order.refunds[].transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.refunds[].transactions[].location_id | integer | null | Location id. | |
order.refunds[].transactions[].device_id | integer | null | Device id. | |
order.refunds[].transactions[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.refunds[].transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.refunds[].transactions[].payment_details | object | null | Payment details, if any. | |
order.refunds[].transactions[].send_email | boolean | Whether an email was sent. |
Đóng đơn hàng (Close order) — haravan.close_order
Close (archive) a completed order.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | com.write_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
order | Đơn hàng | object | The order. |
order.id | integer | Order id used by the API. | |
order.name | string | Order name shown to the shop and customer, e.g. #100020. | |
order.order_number | string | Order number shown to the shop and customer. | |
order.number | integer | Position of the order in the shop's order count. | |
order.token | string | Unique token of the order. | |
order.email | string | null | Customer email. | |
order.contact_email | string | null | Contact email of the buyer. | |
order.note | string | null | Order note. | |
order.note_attributes | array of object | Extra name/value details added to the order. | |
order.note_attributes[].name | string | Name. | |
order.note_attributes[].value | string | Value. | |
order.tags | string | null | Comma-separated tags. | |
order.currency | string | Currency code, e.g. VND. | |
order.total_price | number | Total of items, discounts, shipping and tax, VND. | |
order.subtotal_price | number | Price after discounts, before shipping and tax, VND. | |
order.total_line_items_price | number | Sum of line item prices, VND. | |
order.total_discounts | number | Total discounts, VND. | |
order.total_tax | number | Total tax, VND. | |
order.total_weight | number | Total weight in grams. | |
order.taxes_included | boolean | null | Whether tax is included in the subtotal. | |
order.financial_status | string | Payment status: pending, authorized, partially_paid, paid, partially_refunded, refunded or voided. | |
order.fulfillment_status | string | null | Delivery status: fulfilled, partial, restocked, or null/notfulfilled when nothing shipped. | |
order.gateway | string | null | Payment gateway name. | |
order.gateway_code | string | null | Payment gateway code, e.g. COD. | |
order.processing_method | string | null | How the payment was processed: checkout, direct, manual or offsite. | |
order.closed_status | string | unclosed or closed. | |
order.cancelled_status | string | uncancelled or cancelled. | |
order.confirmed_status | string | unconfirmed or confirmed. | |
order.cancel_reason | string | null | Why it was cancelled: customer, fraud, inventory, declined or other. | |
order.created_at | string | When the order was created (ISO 8601). | |
order.updated_at | string | When the order was last updated (ISO 8601). | |
order.closed_at | string | null | When the order was closed (ISO 8601). | |
order.cancelled_at | string | null | When the order was cancelled (ISO 8601). | |
order.confirmed_at | string | null | When the order was confirmed (ISO 8601). | |
order.source_name | string | null | Where the order came from, e.g. web or pos. | |
order.source | string | null | Channel that created the order. | |
order.landing_site | string | null | Page where the buyer entered the shop. | |
order.landing_site_ref | string | null | Ref of the landing page. | |
order.referring_site | string | null | Site that referred the buyer. | |
order.utm_source | string | null | UTM source. | |
order.utm_medium | string | null | UTM medium. | |
order.utm_campaign | string | null | UTM campaign. | |
order.utm_term | string | null | UTM term. | |
order.utm_content | string | null | UTM content. | |
order.buyer_accepts_marketing | boolean | Whether the buyer accepts marketing. | |
order.browser_ip | string | null | Buyer's IP address. | |
order.cart_token | string | null | Token of the cart behind the order. | |
order.checkout_token | string | null | Token of the checkout behind the order. | |
order.user_id | integer | null | Staff who processed the order; 0 if none. | |
order.location_id | integer | null | Location where the order was processed. | |
order.location_name | string | null | Name of that location. | |
order.assigned_location_id | integer | null | Location assigned to handle it. | |
order.assigned_location_name | string | null | Name of the assigned location. | |
order.assigned_location_at | string | null | When the location was assigned. | |
order.client_details | object | Browser the customer used. | |
order.client_details.accept_language | string | null | Browser languages. | |
order.client_details.browser_ip | string | null | IP address. | |
order.client_details.browser_height | integer | null | Screen height in pixels. | |
order.client_details.browser_width | integer | null | Screen width in pixels. | |
order.client_details.session_hash | string | null | Session hash. | |
order.client_details.user_agent | string | null | Browser user agent. | |
order.billing_address | object | Billing address. | |
order.billing_address.id | integer | Address id. | |
order.billing_address.name | string | Full name of the person at this address. | |
order.billing_address.first_name | string | First name. | |
order.billing_address.last_name | string | Last name. | |
order.billing_address.company | string | Company name. | |
order.billing_address.phone | string | Phone number. | |
order.billing_address.address1 | string | Street address: house number and street. | |
order.billing_address.address2 | string | Second address line. | |
order.billing_address.city | string | City, town or village. | |
order.billing_address.province | string | Province or city name. | |
order.billing_address.province_code | string | Province code; matches list_provinces. | |
order.billing_address.district | string | Ward name under the two-level model (district name before). | |
order.billing_address.district_code | string | Ward code; matches list_wards. | |
order.billing_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.billing_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.billing_address.country | string | Country name. | |
order.billing_address.country_code | string | Two-letter country code, e.g. VN. | |
order.billing_address.zip | string | Postal code. | |
order.billing_address.latitude | number | Latitude, if known. | |
order.billing_address.longitude | number | Longitude, if known. | |
order.billing_address.default | boolean | True when this is the default address. | |
order.shipping_address | object | Delivery address. | |
order.shipping_address.id | integer | Address id. | |
order.shipping_address.name | string | Full name of the person at this address. | |
order.shipping_address.first_name | string | First name. | |
order.shipping_address.last_name | string | Last name. | |
order.shipping_address.company | string | Company name. | |
order.shipping_address.phone | string | Phone number. | |
order.shipping_address.address1 | string | Street address: house number and street. | |
order.shipping_address.address2 | string | Second address line. | |
order.shipping_address.city | string | City, town or village. | |
order.shipping_address.province | string | Province or city name. | |
order.shipping_address.province_code | string | Province code; matches list_provinces. | |
order.shipping_address.district | string | Ward name under the two-level model (district name before). | |
order.shipping_address.district_code | string | Ward code; matches list_wards. | |
order.shipping_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.shipping_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.shipping_address.country | string | Country name. | |
order.shipping_address.country_code | string | Two-letter country code, e.g. VN. | |
order.shipping_address.zip | string | Postal code. | |
order.shipping_address.latitude | number | Latitude, if known. | |
order.shipping_address.longitude | number | Longitude, if known. | |
order.shipping_address.default | boolean | True when this is the default address. | |
order.customer | object | The customer; null for some POS orders. | |
order.customer.id | integer | Customer id. | |
order.customer.email | string | null | Email. | |
order.customer.phone | string | null | Phone number. | |
order.customer.first_name | string | null | First name. | |
order.customer.last_name | string | null | Last name. | |
order.customer.accepts_marketing | boolean | Whether the customer accepts marketing. | |
order.customer.tags | string | null | Comma-separated tags. | |
order.customer.note | string | null | Note about the customer. | |
order.customer.state | string | Account state. | |
order.customer.orders_count | integer | Number of orders. | |
order.customer.total_spent | number | Total spent, VND. | |
order.customer.last_order_id | integer | null | Latest order id. | |
order.customer.last_order_name | string | null | Latest order name. | |
order.customer.default_address | object | Default address. | |
order.customer.default_address.id | integer | Address id. | |
order.customer.default_address.name | string | Full name of the person at this address. | |
order.customer.default_address.first_name | string | First name. | |
order.customer.default_address.last_name | string | Last name. | |
order.customer.default_address.company | string | Company name. | |
order.customer.default_address.phone | string | Phone number. | |
order.customer.default_address.address1 | string | Street address: house number and street. | |
order.customer.default_address.address2 | string | Second address line. | |
order.customer.default_address.city | string | City, town or village. | |
order.customer.default_address.province | string | Province or city name. | |
order.customer.default_address.province_code | string | Province code; matches list_provinces. | |
order.customer.default_address.district | string | Ward name under the two-level model (district name before). | |
order.customer.default_address.district_code | string | Ward code; matches list_wards. | |
order.customer.default_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.default_address.country | string | Country name. | |
order.customer.default_address.country_code | string | Two-letter country code, e.g. VN. | |
order.customer.default_address.zip | string | Postal code. | |
order.customer.default_address.latitude | number | Latitude, if known. | |
order.customer.default_address.longitude | number | Longitude, if known. | |
order.customer.default_address.default | boolean | True when this is the default address. | |
order.customer.addresses | array of object | All addresses. | |
order.customer.addresses[].id | integer | Address id. | |
order.customer.addresses[].name | string | Full name of the person at this address. | |
order.customer.addresses[].first_name | string | First name. | |
order.customer.addresses[].last_name | string | Last name. | |
order.customer.addresses[].company | string | Company name. | |
order.customer.addresses[].phone | string | Phone number. | |
order.customer.addresses[].address1 | string | Street address: house number and street. | |
order.customer.addresses[].address2 | string | Second address line. | |
order.customer.addresses[].city | string | City, town or village. | |
order.customer.addresses[].province | string | Province or city name. | |
order.customer.addresses[].province_code | string | Province code; matches list_provinces. | |
order.customer.addresses[].district | string | Ward name under the two-level model (district name before). | |
order.customer.addresses[].district_code | string | Ward code; matches list_wards. | |
order.customer.addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.addresses[].country | string | Country name. | |
order.customer.addresses[].country_code | string | Two-letter country code, e.g. VN. | |
order.customer.addresses[].zip | string | Postal code. | |
order.customer.addresses[].latitude | number | Latitude, if known. | |
order.customer.addresses[].longitude | number | Longitude, if known. | |
order.customer.addresses[].default | boolean | True when this is the default address. | |
order.customer.created_at | string | When it was created (ISO 8601). | |
order.customer.updated_at | string | When it was last updated (ISO 8601). | |
order.line_items | array of object | Items ordered. | |
order.line_items[].id | integer | Line item id. | |
order.line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.line_items[].variant_id | integer | Variant id. | |
order.line_items[].title | string | Product title. | |
order.line_items[].variant_title | string | Variant title. | |
order.line_items[].name | string | Product and variant name. | |
order.line_items[].sku | string | null | SKU of the variant. | |
order.line_items[].barcode | string | null | Barcode of the variant. | |
order.line_items[].vendor | string | Supplier of the item. | |
order.line_items[].type | string | Product type. | |
order.line_items[].quantity | integer | Quantity ordered. | |
order.line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.line_items[].price | number | Unit price before discounts, VND. | |
order.line_items[].price_original | number | Unit price before any promotion, VND. | |
order.line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.line_items[].total_discount | number | Total discount on this line, VND. | |
order.line_items[].grams | number | Weight in grams. | |
order.line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.line_items[].taxable | boolean | Whether the item is taxable. | |
order.line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.line_items[].product_exists | boolean | False when the product has been deleted. | |
order.line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.line_items[].properties | array | null | Custom properties of the line item. | |
order.line_items[].image | object | Variant image. | |
order.line_items[].image.src | string | Image URL. | |
order.shipping_lines | array of object | Shipping methods used. | |
order.shipping_lines[].code | string | null | Shipping method reference. | |
order.shipping_lines[].title | string | null | Shipping method title. | |
order.shipping_lines[].price | number | Shipping price, VND. | |
order.shipping_lines[].source | string | null | Source of the shipping method. | |
order.discount_codes | array of object | Discount codes applied. | |
order.discount_codes[].code | string | The code. | |
order.discount_codes[].amount | number | Discount amount. | |
order.discount_codes[].type | string | percentage, shipping or fixed_amount. | |
order.fulfillments | array of object | Shipments of the order. | |
order.fulfillments[].id | integer | Fulfillment id. | |
order.fulfillments[].order_id | integer | Order id. | |
order.fulfillments[].status | string | Fulfillment status, e.g. success. | |
order.fulfillments[].tracking_company | string | null | Carrier name. | |
order.fulfillments[].tracking_company_code | string | null | Carrier code. | |
order.fulfillments[].tracking_number | string | null | Tracking number. | |
order.fulfillments[].tracking_numbers | array of string | Tracking numbers. | |
order.fulfillments[].tracking_url | string | null | Tracking URL. | |
order.fulfillments[].tracking_urls | array of string | Tracking URLs. | |
order.fulfillments[].carrier_status_code | string | null | Carrier delivery status code. | |
order.fulfillments[].carrier_status_name | string | null | Carrier delivery status. | |
order.fulfillments[].carrier_cod_status_code | string | null | Cash-on-delivery status code. | |
order.fulfillments[].carrier_cod_status_name | string | null | Cash-on-delivery status. | |
order.fulfillments[].cod_amount | number | Cash on delivery amount to collect, VND. | |
order.fulfillments[].real_shipping_fee | number | Actual shipping fee, VND. | |
order.fulfillments[].total_weight | number | Package weight in grams. | |
order.fulfillments[].location_id | integer | null | Location the order shipped from. | |
order.fulfillments[].notify_customer | boolean | Whether the customer was notified. | |
order.fulfillments[].note | string | null | Fulfillment note. | |
order.fulfillments[].created_at | string | When it was created (ISO 8601). | |
order.fulfillments[].updated_at | string | When it was last updated (ISO 8601). | |
order.fulfillments[].line_items | array of object | Items in this fulfillment. | |
order.fulfillments[].line_items[].id | integer | Line item id. | |
order.fulfillments[].line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.fulfillments[].line_items[].variant_id | integer | Variant id. | |
order.fulfillments[].line_items[].title | string | Product title. | |
order.fulfillments[].line_items[].variant_title | string | Variant title. | |
order.fulfillments[].line_items[].name | string | Product and variant name. | |
order.fulfillments[].line_items[].sku | string | null | SKU of the variant. | |
order.fulfillments[].line_items[].barcode | string | null | Barcode of the variant. | |
order.fulfillments[].line_items[].vendor | string | Supplier of the item. | |
order.fulfillments[].line_items[].type | string | Product type. | |
order.fulfillments[].line_items[].quantity | integer | Quantity ordered. | |
order.fulfillments[].line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.fulfillments[].line_items[].price | number | Unit price before discounts, VND. | |
order.fulfillments[].line_items[].price_original | number | Unit price before any promotion, VND. | |
order.fulfillments[].line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.fulfillments[].line_items[].total_discount | number | Total discount on this line, VND. | |
order.fulfillments[].line_items[].grams | number | Weight in grams. | |
order.fulfillments[].line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.fulfillments[].line_items[].taxable | boolean | Whether the item is taxable. | |
order.fulfillments[].line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.fulfillments[].line_items[].product_exists | boolean | False when the product has been deleted. | |
order.fulfillments[].line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.fulfillments[].line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.fulfillments[].line_items[].properties | array | null | Custom properties of the line item. | |
order.fulfillments[].line_items[].image | object | Variant image. | |
order.fulfillments[].line_items[].image.src | string | Image URL. | |
order.transactions | array of object | Payments on the order. | |
order.transactions[].id | integer | Transaction id. | |
order.transactions[].order_id | integer | Order the transaction belongs to. | |
order.transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.transactions[].amount | number | Amount, VND; negative for refunds. | |
order.transactions[].currency | string | null | Currency code, e.g. VND. | |
order.transactions[].gateway | string | Name of the payment gateway. | |
order.transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.transactions[].authorization | string | null | Authorization code. | |
order.transactions[].receipt | string | null | Receipt. | |
order.transactions[].test | boolean | True for a test transaction. | |
order.transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.transactions[].location_id | integer | null | Location id. | |
order.transactions[].device_id | integer | null | Device id. | |
order.transactions[].created_at | string | When it was created (ISO 8601). | |
order.transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.transactions[].payment_details | object | null | Payment details, if any. | |
order.transactions[].send_email | boolean | Whether an email was sent. | |
order.refunds | array of object | Refunds on the order. | |
order.refunds[].id | integer | Refund id. | |
order.refunds[].order_id | integer | Order id. | |
order.refunds[].note | string | null | Note attached to the refund. | |
order.refunds[].restock | boolean | null | Whether items went back to stock. | |
order.refunds[].user_id | integer | null | Staff who made the refund. | |
order.refunds[].location_id | integer | null | Location items were returned to. | |
order.refunds[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].refund_line_items | array of object | Items returned or refunded. | |
order.refunds[].refund_line_items[].id | integer | Refund line item id. | |
order.refunds[].refund_line_items[].line_item_id | integer | Order line item it refers to. | |
order.refunds[].refund_line_items[].quantity | integer | Quantity refunded. | |
order.refunds[].refund_line_items[].line_item | object | The order line item. | |
order.refunds[].refund_line_items[].line_item.id | integer | Line item id. | |
order.refunds[].refund_line_items[].line_item.product_id | integer | null | Product id; null when the product was deleted later. | |
order.refunds[].refund_line_items[].line_item.variant_id | integer | Variant id. | |
order.refunds[].refund_line_items[].line_item.title | string | Product title. | |
order.refunds[].refund_line_items[].line_item.variant_title | string | Variant title. | |
order.refunds[].refund_line_items[].line_item.name | string | Product and variant name. | |
order.refunds[].refund_line_items[].line_item.sku | string | null | SKU of the variant. | |
order.refunds[].refund_line_items[].line_item.barcode | string | null | Barcode of the variant. | |
order.refunds[].refund_line_items[].line_item.vendor | string | Supplier of the item. | |
order.refunds[].refund_line_items[].line_item.type | string | Product type. | |
order.refunds[].refund_line_items[].line_item.quantity | integer | Quantity ordered. | |
order.refunds[].refund_line_items[].line_item.fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.refunds[].refund_line_items[].line_item.price | number | Unit price before discounts, VND. | |
order.refunds[].refund_line_items[].line_item.price_original | number | Unit price before any promotion, VND. | |
order.refunds[].refund_line_items[].line_item.price_promotion | number | Promotion discount per unit, VND. | |
order.refunds[].refund_line_items[].line_item.total_discount | number | Total discount on this line, VND. | |
order.refunds[].refund_line_items[].line_item.grams | number | Weight in grams. | |
order.refunds[].refund_line_items[].line_item.requires_shipping | boolean | Whether the item needs shipping. | |
order.refunds[].refund_line_items[].line_item.taxable | boolean | Whether the item is taxable. | |
order.refunds[].refund_line_items[].line_item.gift_card | boolean | Whether the item is a gift card. | |
order.refunds[].refund_line_items[].line_item.product_exists | boolean | False when the product has been deleted. | |
order.refunds[].refund_line_items[].line_item.fulfillment_service | string | null | Who fulfills the item. | |
order.refunds[].refund_line_items[].line_item.fulfillment_status | string | null | Fulfillment status of this line. | |
order.refunds[].refund_line_items[].line_item.properties | array | null | Custom properties of the line item. | |
order.refunds[].refund_line_items[].line_item.image | object | Variant image. | |
order.refunds[].refund_line_items[].line_item.image.src | string | Image URL. | |
order.refunds[].transactions | array of object | Money returned, as refund transactions. | |
order.refunds[].transactions[].id | integer | Transaction id. | |
order.refunds[].transactions[].order_id | integer | Order the transaction belongs to. | |
order.refunds[].transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.refunds[].transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.refunds[].transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.refunds[].transactions[].amount | number | Amount, VND; negative for refunds. | |
order.refunds[].transactions[].currency | string | null | Currency code, e.g. VND. | |
order.refunds[].transactions[].gateway | string | Name of the payment gateway. | |
order.refunds[].transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.refunds[].transactions[].authorization | string | null | Authorization code. | |
order.refunds[].transactions[].receipt | string | null | Receipt. | |
order.refunds[].transactions[].test | boolean | True for a test transaction. | |
order.refunds[].transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.refunds[].transactions[].location_id | integer | null | Location id. | |
order.refunds[].transactions[].device_id | integer | null | Device id. | |
order.refunds[].transactions[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.refunds[].transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.refunds[].transactions[].payment_details | object | null | Payment details, if any. | |
order.refunds[].transactions[].send_email | boolean | Whether an email was sent. |
Mở lại đơn hàng (Reopen order) — haravan.open_order
Reopen a closed order.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | com.write_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
order | Đơn hàng | object | The order. |
order.id | integer | Order id used by the API. | |
order.name | string | Order name shown to the shop and customer, e.g. #100020. | |
order.order_number | string | Order number shown to the shop and customer. | |
order.number | integer | Position of the order in the shop's order count. | |
order.token | string | Unique token of the order. | |
order.email | string | null | Customer email. | |
order.contact_email | string | null | Contact email of the buyer. | |
order.note | string | null | Order note. | |
order.note_attributes | array of object | Extra name/value details added to the order. | |
order.note_attributes[].name | string | Name. | |
order.note_attributes[].value | string | Value. | |
order.tags | string | null | Comma-separated tags. | |
order.currency | string | Currency code, e.g. VND. | |
order.total_price | number | Total of items, discounts, shipping and tax, VND. | |
order.subtotal_price | number | Price after discounts, before shipping and tax, VND. | |
order.total_line_items_price | number | Sum of line item prices, VND. | |
order.total_discounts | number | Total discounts, VND. | |
order.total_tax | number | Total tax, VND. | |
order.total_weight | number | Total weight in grams. | |
order.taxes_included | boolean | null | Whether tax is included in the subtotal. | |
order.financial_status | string | Payment status: pending, authorized, partially_paid, paid, partially_refunded, refunded or voided. | |
order.fulfillment_status | string | null | Delivery status: fulfilled, partial, restocked, or null/notfulfilled when nothing shipped. | |
order.gateway | string | null | Payment gateway name. | |
order.gateway_code | string | null | Payment gateway code, e.g. COD. | |
order.processing_method | string | null | How the payment was processed: checkout, direct, manual or offsite. | |
order.closed_status | string | unclosed or closed. | |
order.cancelled_status | string | uncancelled or cancelled. | |
order.confirmed_status | string | unconfirmed or confirmed. | |
order.cancel_reason | string | null | Why it was cancelled: customer, fraud, inventory, declined or other. | |
order.created_at | string | When the order was created (ISO 8601). | |
order.updated_at | string | When the order was last updated (ISO 8601). | |
order.closed_at | string | null | When the order was closed (ISO 8601). | |
order.cancelled_at | string | null | When the order was cancelled (ISO 8601). | |
order.confirmed_at | string | null | When the order was confirmed (ISO 8601). | |
order.source_name | string | null | Where the order came from, e.g. web or pos. | |
order.source | string | null | Channel that created the order. | |
order.landing_site | string | null | Page where the buyer entered the shop. | |
order.landing_site_ref | string | null | Ref of the landing page. | |
order.referring_site | string | null | Site that referred the buyer. | |
order.utm_source | string | null | UTM source. | |
order.utm_medium | string | null | UTM medium. | |
order.utm_campaign | string | null | UTM campaign. | |
order.utm_term | string | null | UTM term. | |
order.utm_content | string | null | UTM content. | |
order.buyer_accepts_marketing | boolean | Whether the buyer accepts marketing. | |
order.browser_ip | string | null | Buyer's IP address. | |
order.cart_token | string | null | Token of the cart behind the order. | |
order.checkout_token | string | null | Token of the checkout behind the order. | |
order.user_id | integer | null | Staff who processed the order; 0 if none. | |
order.location_id | integer | null | Location where the order was processed. | |
order.location_name | string | null | Name of that location. | |
order.assigned_location_id | integer | null | Location assigned to handle it. | |
order.assigned_location_name | string | null | Name of the assigned location. | |
order.assigned_location_at | string | null | When the location was assigned. | |
order.client_details | object | Browser the customer used. | |
order.client_details.accept_language | string | null | Browser languages. | |
order.client_details.browser_ip | string | null | IP address. | |
order.client_details.browser_height | integer | null | Screen height in pixels. | |
order.client_details.browser_width | integer | null | Screen width in pixels. | |
order.client_details.session_hash | string | null | Session hash. | |
order.client_details.user_agent | string | null | Browser user agent. | |
order.billing_address | object | Billing address. | |
order.billing_address.id | integer | Address id. | |
order.billing_address.name | string | Full name of the person at this address. | |
order.billing_address.first_name | string | First name. | |
order.billing_address.last_name | string | Last name. | |
order.billing_address.company | string | Company name. | |
order.billing_address.phone | string | Phone number. | |
order.billing_address.address1 | string | Street address: house number and street. | |
order.billing_address.address2 | string | Second address line. | |
order.billing_address.city | string | City, town or village. | |
order.billing_address.province | string | Province or city name. | |
order.billing_address.province_code | string | Province code; matches list_provinces. | |
order.billing_address.district | string | Ward name under the two-level model (district name before). | |
order.billing_address.district_code | string | Ward code; matches list_wards. | |
order.billing_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.billing_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.billing_address.country | string | Country name. | |
order.billing_address.country_code | string | Two-letter country code, e.g. VN. | |
order.billing_address.zip | string | Postal code. | |
order.billing_address.latitude | number | Latitude, if known. | |
order.billing_address.longitude | number | Longitude, if known. | |
order.billing_address.default | boolean | True when this is the default address. | |
order.shipping_address | object | Delivery address. | |
order.shipping_address.id | integer | Address id. | |
order.shipping_address.name | string | Full name of the person at this address. | |
order.shipping_address.first_name | string | First name. | |
order.shipping_address.last_name | string | Last name. | |
order.shipping_address.company | string | Company name. | |
order.shipping_address.phone | string | Phone number. | |
order.shipping_address.address1 | string | Street address: house number and street. | |
order.shipping_address.address2 | string | Second address line. | |
order.shipping_address.city | string | City, town or village. | |
order.shipping_address.province | string | Province or city name. | |
order.shipping_address.province_code | string | Province code; matches list_provinces. | |
order.shipping_address.district | string | Ward name under the two-level model (district name before). | |
order.shipping_address.district_code | string | Ward code; matches list_wards. | |
order.shipping_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.shipping_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.shipping_address.country | string | Country name. | |
order.shipping_address.country_code | string | Two-letter country code, e.g. VN. | |
order.shipping_address.zip | string | Postal code. | |
order.shipping_address.latitude | number | Latitude, if known. | |
order.shipping_address.longitude | number | Longitude, if known. | |
order.shipping_address.default | boolean | True when this is the default address. | |
order.customer | object | The customer; null for some POS orders. | |
order.customer.id | integer | Customer id. | |
order.customer.email | string | null | Email. | |
order.customer.phone | string | null | Phone number. | |
order.customer.first_name | string | null | First name. | |
order.customer.last_name | string | null | Last name. | |
order.customer.accepts_marketing | boolean | Whether the customer accepts marketing. | |
order.customer.tags | string | null | Comma-separated tags. | |
order.customer.note | string | null | Note about the customer. | |
order.customer.state | string | Account state. | |
order.customer.orders_count | integer | Number of orders. | |
order.customer.total_spent | number | Total spent, VND. | |
order.customer.last_order_id | integer | null | Latest order id. | |
order.customer.last_order_name | string | null | Latest order name. | |
order.customer.default_address | object | Default address. | |
order.customer.default_address.id | integer | Address id. | |
order.customer.default_address.name | string | Full name of the person at this address. | |
order.customer.default_address.first_name | string | First name. | |
order.customer.default_address.last_name | string | Last name. | |
order.customer.default_address.company | string | Company name. | |
order.customer.default_address.phone | string | Phone number. | |
order.customer.default_address.address1 | string | Street address: house number and street. | |
order.customer.default_address.address2 | string | Second address line. | |
order.customer.default_address.city | string | City, town or village. | |
order.customer.default_address.province | string | Province or city name. | |
order.customer.default_address.province_code | string | Province code; matches list_provinces. | |
order.customer.default_address.district | string | Ward name under the two-level model (district name before). | |
order.customer.default_address.district_code | string | Ward code; matches list_wards. | |
order.customer.default_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.default_address.country | string | Country name. | |
order.customer.default_address.country_code | string | Two-letter country code, e.g. VN. | |
order.customer.default_address.zip | string | Postal code. | |
order.customer.default_address.latitude | number | Latitude, if known. | |
order.customer.default_address.longitude | number | Longitude, if known. | |
order.customer.default_address.default | boolean | True when this is the default address. | |
order.customer.addresses | array of object | All addresses. | |
order.customer.addresses[].id | integer | Address id. | |
order.customer.addresses[].name | string | Full name of the person at this address. | |
order.customer.addresses[].first_name | string | First name. | |
order.customer.addresses[].last_name | string | Last name. | |
order.customer.addresses[].company | string | Company name. | |
order.customer.addresses[].phone | string | Phone number. | |
order.customer.addresses[].address1 | string | Street address: house number and street. | |
order.customer.addresses[].address2 | string | Second address line. | |
order.customer.addresses[].city | string | City, town or village. | |
order.customer.addresses[].province | string | Province or city name. | |
order.customer.addresses[].province_code | string | Province code; matches list_provinces. | |
order.customer.addresses[].district | string | Ward name under the two-level model (district name before). | |
order.customer.addresses[].district_code | string | Ward code; matches list_wards. | |
order.customer.addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.addresses[].country | string | Country name. | |
order.customer.addresses[].country_code | string | Two-letter country code, e.g. VN. | |
order.customer.addresses[].zip | string | Postal code. | |
order.customer.addresses[].latitude | number | Latitude, if known. | |
order.customer.addresses[].longitude | number | Longitude, if known. | |
order.customer.addresses[].default | boolean | True when this is the default address. | |
order.customer.created_at | string | When it was created (ISO 8601). | |
order.customer.updated_at | string | When it was last updated (ISO 8601). | |
order.line_items | array of object | Items ordered. | |
order.line_items[].id | integer | Line item id. | |
order.line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.line_items[].variant_id | integer | Variant id. | |
order.line_items[].title | string | Product title. | |
order.line_items[].variant_title | string | Variant title. | |
order.line_items[].name | string | Product and variant name. | |
order.line_items[].sku | string | null | SKU of the variant. | |
order.line_items[].barcode | string | null | Barcode of the variant. | |
order.line_items[].vendor | string | Supplier of the item. | |
order.line_items[].type | string | Product type. | |
order.line_items[].quantity | integer | Quantity ordered. | |
order.line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.line_items[].price | number | Unit price before discounts, VND. | |
order.line_items[].price_original | number | Unit price before any promotion, VND. | |
order.line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.line_items[].total_discount | number | Total discount on this line, VND. | |
order.line_items[].grams | number | Weight in grams. | |
order.line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.line_items[].taxable | boolean | Whether the item is taxable. | |
order.line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.line_items[].product_exists | boolean | False when the product has been deleted. | |
order.line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.line_items[].properties | array | null | Custom properties of the line item. | |
order.line_items[].image | object | Variant image. | |
order.line_items[].image.src | string | Image URL. | |
order.shipping_lines | array of object | Shipping methods used. | |
order.shipping_lines[].code | string | null | Shipping method reference. | |
order.shipping_lines[].title | string | null | Shipping method title. | |
order.shipping_lines[].price | number | Shipping price, VND. | |
order.shipping_lines[].source | string | null | Source of the shipping method. | |
order.discount_codes | array of object | Discount codes applied. | |
order.discount_codes[].code | string | The code. | |
order.discount_codes[].amount | number | Discount amount. | |
order.discount_codes[].type | string | percentage, shipping or fixed_amount. | |
order.fulfillments | array of object | Shipments of the order. | |
order.fulfillments[].id | integer | Fulfillment id. | |
order.fulfillments[].order_id | integer | Order id. | |
order.fulfillments[].status | string | Fulfillment status, e.g. success. | |
order.fulfillments[].tracking_company | string | null | Carrier name. | |
order.fulfillments[].tracking_company_code | string | null | Carrier code. | |
order.fulfillments[].tracking_number | string | null | Tracking number. | |
order.fulfillments[].tracking_numbers | array of string | Tracking numbers. | |
order.fulfillments[].tracking_url | string | null | Tracking URL. | |
order.fulfillments[].tracking_urls | array of string | Tracking URLs. | |
order.fulfillments[].carrier_status_code | string | null | Carrier delivery status code. | |
order.fulfillments[].carrier_status_name | string | null | Carrier delivery status. | |
order.fulfillments[].carrier_cod_status_code | string | null | Cash-on-delivery status code. | |
order.fulfillments[].carrier_cod_status_name | string | null | Cash-on-delivery status. | |
order.fulfillments[].cod_amount | number | Cash on delivery amount to collect, VND. | |
order.fulfillments[].real_shipping_fee | number | Actual shipping fee, VND. | |
order.fulfillments[].total_weight | number | Package weight in grams. | |
order.fulfillments[].location_id | integer | null | Location the order shipped from. | |
order.fulfillments[].notify_customer | boolean | Whether the customer was notified. | |
order.fulfillments[].note | string | null | Fulfillment note. | |
order.fulfillments[].created_at | string | When it was created (ISO 8601). | |
order.fulfillments[].updated_at | string | When it was last updated (ISO 8601). | |
order.fulfillments[].line_items | array of object | Items in this fulfillment. | |
order.fulfillments[].line_items[].id | integer | Line item id. | |
order.fulfillments[].line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.fulfillments[].line_items[].variant_id | integer | Variant id. | |
order.fulfillments[].line_items[].title | string | Product title. | |
order.fulfillments[].line_items[].variant_title | string | Variant title. | |
order.fulfillments[].line_items[].name | string | Product and variant name. | |
order.fulfillments[].line_items[].sku | string | null | SKU of the variant. | |
order.fulfillments[].line_items[].barcode | string | null | Barcode of the variant. | |
order.fulfillments[].line_items[].vendor | string | Supplier of the item. | |
order.fulfillments[].line_items[].type | string | Product type. | |
order.fulfillments[].line_items[].quantity | integer | Quantity ordered. | |
order.fulfillments[].line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.fulfillments[].line_items[].price | number | Unit price before discounts, VND. | |
order.fulfillments[].line_items[].price_original | number | Unit price before any promotion, VND. | |
order.fulfillments[].line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.fulfillments[].line_items[].total_discount | number | Total discount on this line, VND. | |
order.fulfillments[].line_items[].grams | number | Weight in grams. | |
order.fulfillments[].line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.fulfillments[].line_items[].taxable | boolean | Whether the item is taxable. | |
order.fulfillments[].line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.fulfillments[].line_items[].product_exists | boolean | False when the product has been deleted. | |
order.fulfillments[].line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.fulfillments[].line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.fulfillments[].line_items[].properties | array | null | Custom properties of the line item. | |
order.fulfillments[].line_items[].image | object | Variant image. | |
order.fulfillments[].line_items[].image.src | string | Image URL. | |
order.transactions | array of object | Payments on the order. | |
order.transactions[].id | integer | Transaction id. | |
order.transactions[].order_id | integer | Order the transaction belongs to. | |
order.transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.transactions[].amount | number | Amount, VND; negative for refunds. | |
order.transactions[].currency | string | null | Currency code, e.g. VND. | |
order.transactions[].gateway | string | Name of the payment gateway. | |
order.transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.transactions[].authorization | string | null | Authorization code. | |
order.transactions[].receipt | string | null | Receipt. | |
order.transactions[].test | boolean | True for a test transaction. | |
order.transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.transactions[].location_id | integer | null | Location id. | |
order.transactions[].device_id | integer | null | Device id. | |
order.transactions[].created_at | string | When it was created (ISO 8601). | |
order.transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.transactions[].payment_details | object | null | Payment details, if any. | |
order.transactions[].send_email | boolean | Whether an email was sent. | |
order.refunds | array of object | Refunds on the order. | |
order.refunds[].id | integer | Refund id. | |
order.refunds[].order_id | integer | Order id. | |
order.refunds[].note | string | null | Note attached to the refund. | |
order.refunds[].restock | boolean | null | Whether items went back to stock. | |
order.refunds[].user_id | integer | null | Staff who made the refund. | |
order.refunds[].location_id | integer | null | Location items were returned to. | |
order.refunds[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].refund_line_items | array of object | Items returned or refunded. | |
order.refunds[].refund_line_items[].id | integer | Refund line item id. | |
order.refunds[].refund_line_items[].line_item_id | integer | Order line item it refers to. | |
order.refunds[].refund_line_items[].quantity | integer | Quantity refunded. | |
order.refunds[].refund_line_items[].line_item | object | The order line item. | |
order.refunds[].refund_line_items[].line_item.id | integer | Line item id. | |
order.refunds[].refund_line_items[].line_item.product_id | integer | null | Product id; null when the product was deleted later. | |
order.refunds[].refund_line_items[].line_item.variant_id | integer | Variant id. | |
order.refunds[].refund_line_items[].line_item.title | string | Product title. | |
order.refunds[].refund_line_items[].line_item.variant_title | string | Variant title. | |
order.refunds[].refund_line_items[].line_item.name | string | Product and variant name. | |
order.refunds[].refund_line_items[].line_item.sku | string | null | SKU of the variant. | |
order.refunds[].refund_line_items[].line_item.barcode | string | null | Barcode of the variant. | |
order.refunds[].refund_line_items[].line_item.vendor | string | Supplier of the item. | |
order.refunds[].refund_line_items[].line_item.type | string | Product type. | |
order.refunds[].refund_line_items[].line_item.quantity | integer | Quantity ordered. | |
order.refunds[].refund_line_items[].line_item.fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.refunds[].refund_line_items[].line_item.price | number | Unit price before discounts, VND. | |
order.refunds[].refund_line_items[].line_item.price_original | number | Unit price before any promotion, VND. | |
order.refunds[].refund_line_items[].line_item.price_promotion | number | Promotion discount per unit, VND. | |
order.refunds[].refund_line_items[].line_item.total_discount | number | Total discount on this line, VND. | |
order.refunds[].refund_line_items[].line_item.grams | number | Weight in grams. | |
order.refunds[].refund_line_items[].line_item.requires_shipping | boolean | Whether the item needs shipping. | |
order.refunds[].refund_line_items[].line_item.taxable | boolean | Whether the item is taxable. | |
order.refunds[].refund_line_items[].line_item.gift_card | boolean | Whether the item is a gift card. | |
order.refunds[].refund_line_items[].line_item.product_exists | boolean | False when the product has been deleted. | |
order.refunds[].refund_line_items[].line_item.fulfillment_service | string | null | Who fulfills the item. | |
order.refunds[].refund_line_items[].line_item.fulfillment_status | string | null | Fulfillment status of this line. | |
order.refunds[].refund_line_items[].line_item.properties | array | null | Custom properties of the line item. | |
order.refunds[].refund_line_items[].line_item.image | object | Variant image. | |
order.refunds[].refund_line_items[].line_item.image.src | string | Image URL. | |
order.refunds[].transactions | array of object | Money returned, as refund transactions. | |
order.refunds[].transactions[].id | integer | Transaction id. | |
order.refunds[].transactions[].order_id | integer | Order the transaction belongs to. | |
order.refunds[].transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.refunds[].transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.refunds[].transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.refunds[].transactions[].amount | number | Amount, VND; negative for refunds. | |
order.refunds[].transactions[].currency | string | null | Currency code, e.g. VND. | |
order.refunds[].transactions[].gateway | string | Name of the payment gateway. | |
order.refunds[].transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.refunds[].transactions[].authorization | string | null | Authorization code. | |
order.refunds[].transactions[].receipt | string | null | Receipt. | |
order.refunds[].transactions[].test | boolean | True for a test transaction. | |
order.refunds[].transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.refunds[].transactions[].location_id | integer | null | Location id. | |
order.refunds[].transactions[].device_id | integer | null | Device id. | |
order.refunds[].transactions[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.refunds[].transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.refunds[].transactions[].payment_details | object | null | Payment details, if any. | |
order.refunds[].transactions[].send_email | boolean | Whether an email was sent. |
Huỷ đơn hàng (Cancel order) — haravan.cancel_order
Cancel an order, optionally restocking items and refunding an amount.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | có | không | com.write_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
reason | Lý do huỷ | string | có | Why the order is cancelled. One of: customer, inventory, fraud, declined, other. |
amount | Số tiền hoàn | string | không | Amount to refund, VND, e.g. '520000'. |
restock | Nhập lại kho | boolean | không | Put items back in stock. |
email | Gửi email cho khách | boolean | không | Email the customer about it. |
note | Ghi chú | string | không | Internal note. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
order | Đơn hàng | object | The order. |
order.id | integer | Order id used by the API. | |
order.name | string | Order name shown to the shop and customer, e.g. #100020. | |
order.order_number | string | Order number shown to the shop and customer. | |
order.number | integer | Position of the order in the shop's order count. | |
order.token | string | Unique token of the order. | |
order.email | string | null | Customer email. | |
order.contact_email | string | null | Contact email of the buyer. | |
order.note | string | null | Order note. | |
order.note_attributes | array of object | Extra name/value details added to the order. | |
order.note_attributes[].name | string | Name. | |
order.note_attributes[].value | string | Value. | |
order.tags | string | null | Comma-separated tags. | |
order.currency | string | Currency code, e.g. VND. | |
order.total_price | number | Total of items, discounts, shipping and tax, VND. | |
order.subtotal_price | number | Price after discounts, before shipping and tax, VND. | |
order.total_line_items_price | number | Sum of line item prices, VND. | |
order.total_discounts | number | Total discounts, VND. | |
order.total_tax | number | Total tax, VND. | |
order.total_weight | number | Total weight in grams. | |
order.taxes_included | boolean | null | Whether tax is included in the subtotal. | |
order.financial_status | string | Payment status: pending, authorized, partially_paid, paid, partially_refunded, refunded or voided. | |
order.fulfillment_status | string | null | Delivery status: fulfilled, partial, restocked, or null/notfulfilled when nothing shipped. | |
order.gateway | string | null | Payment gateway name. | |
order.gateway_code | string | null | Payment gateway code, e.g. COD. | |
order.processing_method | string | null | How the payment was processed: checkout, direct, manual or offsite. | |
order.closed_status | string | unclosed or closed. | |
order.cancelled_status | string | uncancelled or cancelled. | |
order.confirmed_status | string | unconfirmed or confirmed. | |
order.cancel_reason | string | null | Why it was cancelled: customer, fraud, inventory, declined or other. | |
order.created_at | string | When the order was created (ISO 8601). | |
order.updated_at | string | When the order was last updated (ISO 8601). | |
order.closed_at | string | null | When the order was closed (ISO 8601). | |
order.cancelled_at | string | null | When the order was cancelled (ISO 8601). | |
order.confirmed_at | string | null | When the order was confirmed (ISO 8601). | |
order.source_name | string | null | Where the order came from, e.g. web or pos. | |
order.source | string | null | Channel that created the order. | |
order.landing_site | string | null | Page where the buyer entered the shop. | |
order.landing_site_ref | string | null | Ref of the landing page. | |
order.referring_site | string | null | Site that referred the buyer. | |
order.utm_source | string | null | UTM source. | |
order.utm_medium | string | null | UTM medium. | |
order.utm_campaign | string | null | UTM campaign. | |
order.utm_term | string | null | UTM term. | |
order.utm_content | string | null | UTM content. | |
order.buyer_accepts_marketing | boolean | Whether the buyer accepts marketing. | |
order.browser_ip | string | null | Buyer's IP address. | |
order.cart_token | string | null | Token of the cart behind the order. | |
order.checkout_token | string | null | Token of the checkout behind the order. | |
order.user_id | integer | null | Staff who processed the order; 0 if none. | |
order.location_id | integer | null | Location where the order was processed. | |
order.location_name | string | null | Name of that location. | |
order.assigned_location_id | integer | null | Location assigned to handle it. | |
order.assigned_location_name | string | null | Name of the assigned location. | |
order.assigned_location_at | string | null | When the location was assigned. | |
order.client_details | object | Browser the customer used. | |
order.client_details.accept_language | string | null | Browser languages. | |
order.client_details.browser_ip | string | null | IP address. | |
order.client_details.browser_height | integer | null | Screen height in pixels. | |
order.client_details.browser_width | integer | null | Screen width in pixels. | |
order.client_details.session_hash | string | null | Session hash. | |
order.client_details.user_agent | string | null | Browser user agent. | |
order.billing_address | object | Billing address. | |
order.billing_address.id | integer | Address id. | |
order.billing_address.name | string | Full name of the person at this address. | |
order.billing_address.first_name | string | First name. | |
order.billing_address.last_name | string | Last name. | |
order.billing_address.company | string | Company name. | |
order.billing_address.phone | string | Phone number. | |
order.billing_address.address1 | string | Street address: house number and street. | |
order.billing_address.address2 | string | Second address line. | |
order.billing_address.city | string | City, town or village. | |
order.billing_address.province | string | Province or city name. | |
order.billing_address.province_code | string | Province code; matches list_provinces. | |
order.billing_address.district | string | Ward name under the two-level model (district name before). | |
order.billing_address.district_code | string | Ward code; matches list_wards. | |
order.billing_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.billing_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.billing_address.country | string | Country name. | |
order.billing_address.country_code | string | Two-letter country code, e.g. VN. | |
order.billing_address.zip | string | Postal code. | |
order.billing_address.latitude | number | Latitude, if known. | |
order.billing_address.longitude | number | Longitude, if known. | |
order.billing_address.default | boolean | True when this is the default address. | |
order.shipping_address | object | Delivery address. | |
order.shipping_address.id | integer | Address id. | |
order.shipping_address.name | string | Full name of the person at this address. | |
order.shipping_address.first_name | string | First name. | |
order.shipping_address.last_name | string | Last name. | |
order.shipping_address.company | string | Company name. | |
order.shipping_address.phone | string | Phone number. | |
order.shipping_address.address1 | string | Street address: house number and street. | |
order.shipping_address.address2 | string | Second address line. | |
order.shipping_address.city | string | City, town or village. | |
order.shipping_address.province | string | Province or city name. | |
order.shipping_address.province_code | string | Province code; matches list_provinces. | |
order.shipping_address.district | string | Ward name under the two-level model (district name before). | |
order.shipping_address.district_code | string | Ward code; matches list_wards. | |
order.shipping_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.shipping_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.shipping_address.country | string | Country name. | |
order.shipping_address.country_code | string | Two-letter country code, e.g. VN. | |
order.shipping_address.zip | string | Postal code. | |
order.shipping_address.latitude | number | Latitude, if known. | |
order.shipping_address.longitude | number | Longitude, if known. | |
order.shipping_address.default | boolean | True when this is the default address. | |
order.customer | object | The customer; null for some POS orders. | |
order.customer.id | integer | Customer id. | |
order.customer.email | string | null | Email. | |
order.customer.phone | string | null | Phone number. | |
order.customer.first_name | string | null | First name. | |
order.customer.last_name | string | null | Last name. | |
order.customer.accepts_marketing | boolean | Whether the customer accepts marketing. | |
order.customer.tags | string | null | Comma-separated tags. | |
order.customer.note | string | null | Note about the customer. | |
order.customer.state | string | Account state. | |
order.customer.orders_count | integer | Number of orders. | |
order.customer.total_spent | number | Total spent, VND. | |
order.customer.last_order_id | integer | null | Latest order id. | |
order.customer.last_order_name | string | null | Latest order name. | |
order.customer.default_address | object | Default address. | |
order.customer.default_address.id | integer | Address id. | |
order.customer.default_address.name | string | Full name of the person at this address. | |
order.customer.default_address.first_name | string | First name. | |
order.customer.default_address.last_name | string | Last name. | |
order.customer.default_address.company | string | Company name. | |
order.customer.default_address.phone | string | Phone number. | |
order.customer.default_address.address1 | string | Street address: house number and street. | |
order.customer.default_address.address2 | string | Second address line. | |
order.customer.default_address.city | string | City, town or village. | |
order.customer.default_address.province | string | Province or city name. | |
order.customer.default_address.province_code | string | Province code; matches list_provinces. | |
order.customer.default_address.district | string | Ward name under the two-level model (district name before). | |
order.customer.default_address.district_code | string | Ward code; matches list_wards. | |
order.customer.default_address.ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.default_address.ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.default_address.country | string | Country name. | |
order.customer.default_address.country_code | string | Two-letter country code, e.g. VN. | |
order.customer.default_address.zip | string | Postal code. | |
order.customer.default_address.latitude | number | Latitude, if known. | |
order.customer.default_address.longitude | number | Longitude, if known. | |
order.customer.default_address.default | boolean | True when this is the default address. | |
order.customer.addresses | array of object | All addresses. | |
order.customer.addresses[].id | integer | Address id. | |
order.customer.addresses[].name | string | Full name of the person at this address. | |
order.customer.addresses[].first_name | string | First name. | |
order.customer.addresses[].last_name | string | Last name. | |
order.customer.addresses[].company | string | Company name. | |
order.customer.addresses[].phone | string | Phone number. | |
order.customer.addresses[].address1 | string | Street address: house number and street. | |
order.customer.addresses[].address2 | string | Second address line. | |
order.customer.addresses[].city | string | City, town or village. | |
order.customer.addresses[].province | string | Province or city name. | |
order.customer.addresses[].province_code | string | Province code; matches list_provinces. | |
order.customer.addresses[].district | string | Ward name under the two-level model (district name before). | |
order.customer.addresses[].district_code | string | Ward code; matches list_wards. | |
order.customer.addresses[].ward | string | Ward name under the three-level model; usually empty now. | |
order.customer.addresses[].ward_code | string | Ward code under the three-level model; usually empty now. | |
order.customer.addresses[].country | string | Country name. | |
order.customer.addresses[].country_code | string | Two-letter country code, e.g. VN. | |
order.customer.addresses[].zip | string | Postal code. | |
order.customer.addresses[].latitude | number | Latitude, if known. | |
order.customer.addresses[].longitude | number | Longitude, if known. | |
order.customer.addresses[].default | boolean | True when this is the default address. | |
order.customer.created_at | string | When it was created (ISO 8601). | |
order.customer.updated_at | string | When it was last updated (ISO 8601). | |
order.line_items | array of object | Items ordered. | |
order.line_items[].id | integer | Line item id. | |
order.line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.line_items[].variant_id | integer | Variant id. | |
order.line_items[].title | string | Product title. | |
order.line_items[].variant_title | string | Variant title. | |
order.line_items[].name | string | Product and variant name. | |
order.line_items[].sku | string | null | SKU of the variant. | |
order.line_items[].barcode | string | null | Barcode of the variant. | |
order.line_items[].vendor | string | Supplier of the item. | |
order.line_items[].type | string | Product type. | |
order.line_items[].quantity | integer | Quantity ordered. | |
order.line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.line_items[].price | number | Unit price before discounts, VND. | |
order.line_items[].price_original | number | Unit price before any promotion, VND. | |
order.line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.line_items[].total_discount | number | Total discount on this line, VND. | |
order.line_items[].grams | number | Weight in grams. | |
order.line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.line_items[].taxable | boolean | Whether the item is taxable. | |
order.line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.line_items[].product_exists | boolean | False when the product has been deleted. | |
order.line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.line_items[].properties | array | null | Custom properties of the line item. | |
order.line_items[].image | object | Variant image. | |
order.line_items[].image.src | string | Image URL. | |
order.shipping_lines | array of object | Shipping methods used. | |
order.shipping_lines[].code | string | null | Shipping method reference. | |
order.shipping_lines[].title | string | null | Shipping method title. | |
order.shipping_lines[].price | number | Shipping price, VND. | |
order.shipping_lines[].source | string | null | Source of the shipping method. | |
order.discount_codes | array of object | Discount codes applied. | |
order.discount_codes[].code | string | The code. | |
order.discount_codes[].amount | number | Discount amount. | |
order.discount_codes[].type | string | percentage, shipping or fixed_amount. | |
order.fulfillments | array of object | Shipments of the order. | |
order.fulfillments[].id | integer | Fulfillment id. | |
order.fulfillments[].order_id | integer | Order id. | |
order.fulfillments[].status | string | Fulfillment status, e.g. success. | |
order.fulfillments[].tracking_company | string | null | Carrier name. | |
order.fulfillments[].tracking_company_code | string | null | Carrier code. | |
order.fulfillments[].tracking_number | string | null | Tracking number. | |
order.fulfillments[].tracking_numbers | array of string | Tracking numbers. | |
order.fulfillments[].tracking_url | string | null | Tracking URL. | |
order.fulfillments[].tracking_urls | array of string | Tracking URLs. | |
order.fulfillments[].carrier_status_code | string | null | Carrier delivery status code. | |
order.fulfillments[].carrier_status_name | string | null | Carrier delivery status. | |
order.fulfillments[].carrier_cod_status_code | string | null | Cash-on-delivery status code. | |
order.fulfillments[].carrier_cod_status_name | string | null | Cash-on-delivery status. | |
order.fulfillments[].cod_amount | number | Cash on delivery amount to collect, VND. | |
order.fulfillments[].real_shipping_fee | number | Actual shipping fee, VND. | |
order.fulfillments[].total_weight | number | Package weight in grams. | |
order.fulfillments[].location_id | integer | null | Location the order shipped from. | |
order.fulfillments[].notify_customer | boolean | Whether the customer was notified. | |
order.fulfillments[].note | string | null | Fulfillment note. | |
order.fulfillments[].created_at | string | When it was created (ISO 8601). | |
order.fulfillments[].updated_at | string | When it was last updated (ISO 8601). | |
order.fulfillments[].line_items | array of object | Items in this fulfillment. | |
order.fulfillments[].line_items[].id | integer | Line item id. | |
order.fulfillments[].line_items[].product_id | integer | null | Product id; null when the product was deleted later. | |
order.fulfillments[].line_items[].variant_id | integer | Variant id. | |
order.fulfillments[].line_items[].title | string | Product title. | |
order.fulfillments[].line_items[].variant_title | string | Variant title. | |
order.fulfillments[].line_items[].name | string | Product and variant name. | |
order.fulfillments[].line_items[].sku | string | null | SKU of the variant. | |
order.fulfillments[].line_items[].barcode | string | null | Barcode of the variant. | |
order.fulfillments[].line_items[].vendor | string | Supplier of the item. | |
order.fulfillments[].line_items[].type | string | Product type. | |
order.fulfillments[].line_items[].quantity | integer | Quantity ordered. | |
order.fulfillments[].line_items[].fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.fulfillments[].line_items[].price | number | Unit price before discounts, VND. | |
order.fulfillments[].line_items[].price_original | number | Unit price before any promotion, VND. | |
order.fulfillments[].line_items[].price_promotion | number | Promotion discount per unit, VND. | |
order.fulfillments[].line_items[].total_discount | number | Total discount on this line, VND. | |
order.fulfillments[].line_items[].grams | number | Weight in grams. | |
order.fulfillments[].line_items[].requires_shipping | boolean | Whether the item needs shipping. | |
order.fulfillments[].line_items[].taxable | boolean | Whether the item is taxable. | |
order.fulfillments[].line_items[].gift_card | boolean | Whether the item is a gift card. | |
order.fulfillments[].line_items[].product_exists | boolean | False when the product has been deleted. | |
order.fulfillments[].line_items[].fulfillment_service | string | null | Who fulfills the item. | |
order.fulfillments[].line_items[].fulfillment_status | string | null | Fulfillment status of this line. | |
order.fulfillments[].line_items[].properties | array | null | Custom properties of the line item. | |
order.fulfillments[].line_items[].image | object | Variant image. | |
order.fulfillments[].line_items[].image.src | string | Image URL. | |
order.transactions | array of object | Payments on the order. | |
order.transactions[].id | integer | Transaction id. | |
order.transactions[].order_id | integer | Order the transaction belongs to. | |
order.transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.transactions[].amount | number | Amount, VND; negative for refunds. | |
order.transactions[].currency | string | null | Currency code, e.g. VND. | |
order.transactions[].gateway | string | Name of the payment gateway. | |
order.transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.transactions[].authorization | string | null | Authorization code. | |
order.transactions[].receipt | string | null | Receipt. | |
order.transactions[].test | boolean | True for a test transaction. | |
order.transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.transactions[].location_id | integer | null | Location id. | |
order.transactions[].device_id | integer | null | Device id. | |
order.transactions[].created_at | string | When it was created (ISO 8601). | |
order.transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.transactions[].payment_details | object | null | Payment details, if any. | |
order.transactions[].send_email | boolean | Whether an email was sent. | |
order.refunds | array of object | Refunds on the order. | |
order.refunds[].id | integer | Refund id. | |
order.refunds[].order_id | integer | Order id. | |
order.refunds[].note | string | null | Note attached to the refund. | |
order.refunds[].restock | boolean | null | Whether items went back to stock. | |
order.refunds[].user_id | integer | null | Staff who made the refund. | |
order.refunds[].location_id | integer | null | Location items were returned to. | |
order.refunds[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].refund_line_items | array of object | Items returned or refunded. | |
order.refunds[].refund_line_items[].id | integer | Refund line item id. | |
order.refunds[].refund_line_items[].line_item_id | integer | Order line item it refers to. | |
order.refunds[].refund_line_items[].quantity | integer | Quantity refunded. | |
order.refunds[].refund_line_items[].line_item | object | The order line item. | |
order.refunds[].refund_line_items[].line_item.id | integer | Line item id. | |
order.refunds[].refund_line_items[].line_item.product_id | integer | null | Product id; null when the product was deleted later. | |
order.refunds[].refund_line_items[].line_item.variant_id | integer | Variant id. | |
order.refunds[].refund_line_items[].line_item.title | string | Product title. | |
order.refunds[].refund_line_items[].line_item.variant_title | string | Variant title. | |
order.refunds[].refund_line_items[].line_item.name | string | Product and variant name. | |
order.refunds[].refund_line_items[].line_item.sku | string | null | SKU of the variant. | |
order.refunds[].refund_line_items[].line_item.barcode | string | null | Barcode of the variant. | |
order.refunds[].refund_line_items[].line_item.vendor | string | Supplier of the item. | |
order.refunds[].refund_line_items[].line_item.type | string | Product type. | |
order.refunds[].refund_line_items[].line_item.quantity | integer | Quantity ordered. | |
order.refunds[].refund_line_items[].line_item.fulfillable_quantity | integer | Quantity still available to fulfill. | |
order.refunds[].refund_line_items[].line_item.price | number | Unit price before discounts, VND. | |
order.refunds[].refund_line_items[].line_item.price_original | number | Unit price before any promotion, VND. | |
order.refunds[].refund_line_items[].line_item.price_promotion | number | Promotion discount per unit, VND. | |
order.refunds[].refund_line_items[].line_item.total_discount | number | Total discount on this line, VND. | |
order.refunds[].refund_line_items[].line_item.grams | number | Weight in grams. | |
order.refunds[].refund_line_items[].line_item.requires_shipping | boolean | Whether the item needs shipping. | |
order.refunds[].refund_line_items[].line_item.taxable | boolean | Whether the item is taxable. | |
order.refunds[].refund_line_items[].line_item.gift_card | boolean | Whether the item is a gift card. | |
order.refunds[].refund_line_items[].line_item.product_exists | boolean | False when the product has been deleted. | |
order.refunds[].refund_line_items[].line_item.fulfillment_service | string | null | Who fulfills the item. | |
order.refunds[].refund_line_items[].line_item.fulfillment_status | string | null | Fulfillment status of this line. | |
order.refunds[].refund_line_items[].line_item.properties | array | null | Custom properties of the line item. | |
order.refunds[].refund_line_items[].line_item.image | object | Variant image. | |
order.refunds[].refund_line_items[].line_item.image.src | string | Image URL. | |
order.refunds[].transactions | array of object | Money returned, as refund transactions. | |
order.refunds[].transactions[].id | integer | Transaction id. | |
order.refunds[].transactions[].order_id | integer | Order the transaction belongs to. | |
order.refunds[].transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
order.refunds[].transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
order.refunds[].transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
order.refunds[].transactions[].amount | number | Amount, VND; negative for refunds. | |
order.refunds[].transactions[].currency | string | null | Currency code, e.g. VND. | |
order.refunds[].transactions[].gateway | string | Name of the payment gateway. | |
order.refunds[].transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
order.refunds[].transactions[].authorization | string | null | Authorization code. | |
order.refunds[].transactions[].receipt | string | null | Receipt. | |
order.refunds[].transactions[].test | boolean | True for a test transaction. | |
order.refunds[].transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
order.refunds[].transactions[].location_id | integer | null | Location id. | |
order.refunds[].transactions[].device_id | integer | null | Device id. | |
order.refunds[].transactions[].created_at | string | When it was created (ISO 8601). | |
order.refunds[].transactions[].external_transaction_id | string | null | Id at the payment provider. | |
order.refunds[].transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
order.refunds[].transactions[].payment_details | object | null | Payment details, if any. | |
order.refunds[].transactions[].send_email | boolean | Whether an email was sent. |
Thêm thẻ đơn hàng (Add order tags) — haravan.add_order_tags
Add tags to an order; existing tags are kept.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | com.write_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
tags | Thẻ | string | có | Comma-separated tags, e.g. 'vip,zalo'. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
tags | Thẻ | string | null | Order tags after the change. |
Xoá thẻ đơn hàng (Remove order tags) — haravan.remove_order_tags
Remove tags from an order.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | có | com.write_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
tags | Thẻ | string | có | Comma-separated tags, e.g. 'vip,zalo'. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
tags | Thẻ | string | null | Order tags after the change. |
Giao người xử lý đơn (Assign order) — haravan.assign_order
Assign staff to handle an order (advanced order processing only).
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | không | com.write_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
user_ids | Nhân viên | array of integer | không | Staff ids from list_staff. |
group_user_ids | Nhóm nhân viên | array of integer | không | Staff group ids. |
location_id | Chi nhánh | integer | không | Location id from list_locations. Min 1. |
Field thêm: bỏ qua.
Output
Trả về object rỗng.
Lịch sử đơn hàng (List order events) — haravan.list_order_events
List what happened to an order: created, paid, shipped, edited.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
events | Sự kiện | array of object | What happened to the order. |
events[].id | integer | Event id. | |
events[].subject_id | integer | Id of the resource that produced the event. | |
events[].subject_type | string | Type of that resource: Article, Blog, Collection, Comment, Order, Page or Product. | |
events[].verb | string | What happened, e.g. create, update, destroy or confirmed. | |
events[].message | string | Human-readable text of the event; may contain HTML links. | |
events[].description | string | null | Plain-text description. | |
events[].body | string | null | Extra text about the event. | |
events[].arguments | array of string | Values the message was built from. | |
events[].author | string | Who caused the event. | |
events[].path | string | null | Relative admin URL of the resource. | |
events[].created_at | string | When it happened (ISO 8601). |
Danh sách thanh toán của đơn (List order payments) — haravan.list_order_transactions
List payment transactions of an order.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
transactions | Giao dịch | array of object | Payment transactions of the order. |
transactions[].id | integer | Transaction id. | |
transactions[].order_id | integer | Order the transaction belongs to. | |
transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
transactions[].amount | number | Amount, VND; negative for refunds. | |
transactions[].currency | string | null | Currency code, e.g. VND. | |
transactions[].gateway | string | Name of the payment gateway. | |
transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
transactions[].authorization | string | null | Authorization code. | |
transactions[].receipt | string | null | Receipt. | |
transactions[].test | boolean | True for a test transaction. | |
transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
transactions[].location_id | integer | null | Location id. | |
transactions[].device_id | integer | null | Device id. | |
transactions[].created_at | string | When it was created (ISO 8601). | |
transactions[].external_transaction_id | string | null | Id at the payment provider. | |
transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
transactions[].payment_details | object | null | Payment details, if any. | |
transactions[].send_email | boolean | Whether an email was sent. |
Ghi nhận thanh toán đơn (Record order payment) — haravan.create_order_transaction
Record a payment on an order, e.g. kind 'capture' for a cash payment.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | có | không | com.write_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
transaction | Giao dịch | object | có | The payment. |
transaction.amount | number | có | Amount, VND. | |
transaction.kind | string | có | Transaction kind, e.g. capture. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
transaction | Giao dịch | object | The transaction that was recorded. |
transaction.id | integer | Transaction id. | |
transaction.order_id | integer | Order the transaction belongs to. | |
transaction.parent_id | integer | null | Id of the transaction this one follows. | |
transaction.kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
transaction.status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
transaction.amount | number | Amount, VND; negative for refunds. | |
transaction.currency | string | null | Currency code, e.g. VND. | |
transaction.gateway | string | Name of the payment gateway. | |
transaction.is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
transaction.authorization | string | null | Authorization code. | |
transaction.receipt | string | null | Receipt. | |
transaction.test | boolean | True for a test transaction. | |
transaction.user_id | integer | null | Staff who recorded it; 0 for the system. | |
transaction.location_id | integer | null | Location id. | |
transaction.device_id | integer | null | Device id. | |
transaction.created_at | string | When it was created (ISO 8601). | |
transaction.external_transaction_id | string | null | Id at the payment provider. | |
transaction.haravan_transaction_id | string | null | Haravan payment reference. | |
transaction.payment_details | object | null | Payment details, if any. | |
transaction.send_email | boolean | Whether an email was sent. |
Danh sách hoàn tiền của đơn (List order refunds) — haravan.list_order_refunds
List refunds of an order.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
refunds | Hoàn tiền | array of object | Refunds of the order. |
refunds[].id | integer | Refund id. | |
refunds[].order_id | integer | Order id. | |
refunds[].note | string | null | Note attached to the refund. | |
refunds[].restock | boolean | null | Whether items went back to stock. | |
refunds[].user_id | integer | null | Staff who made the refund. | |
refunds[].location_id | integer | null | Location items were returned to. | |
refunds[].created_at | string | When it was created (ISO 8601). | |
refunds[].refund_line_items | array of object | Items returned or refunded. | |
refunds[].refund_line_items[].id | integer | Refund line item id. | |
refunds[].refund_line_items[].line_item_id | integer | Order line item it refers to. | |
refunds[].refund_line_items[].quantity | integer | Quantity refunded. | |
refunds[].refund_line_items[].line_item | object | The order line item. | |
refunds[].refund_line_items[].line_item.id | integer | Line item id. | |
refunds[].refund_line_items[].line_item.product_id | integer | null | Product id; null when the product was deleted later. | |
refunds[].refund_line_items[].line_item.variant_id | integer | Variant id. | |
refunds[].refund_line_items[].line_item.title | string | Product title. | |
refunds[].refund_line_items[].line_item.variant_title | string | Variant title. | |
refunds[].refund_line_items[].line_item.name | string | Product and variant name. | |
refunds[].refund_line_items[].line_item.sku | string | null | SKU of the variant. | |
refunds[].refund_line_items[].line_item.barcode | string | null | Barcode of the variant. | |
refunds[].refund_line_items[].line_item.vendor | string | Supplier of the item. | |
refunds[].refund_line_items[].line_item.type | string | Product type. | |
refunds[].refund_line_items[].line_item.quantity | integer | Quantity ordered. | |
refunds[].refund_line_items[].line_item.fulfillable_quantity | integer | Quantity still available to fulfill. | |
refunds[].refund_line_items[].line_item.price | number | Unit price before discounts, VND. | |
refunds[].refund_line_items[].line_item.price_original | number | Unit price before any promotion, VND. | |
refunds[].refund_line_items[].line_item.price_promotion | number | Promotion discount per unit, VND. | |
refunds[].refund_line_items[].line_item.total_discount | number | Total discount on this line, VND. | |
refunds[].refund_line_items[].line_item.grams | number | Weight in grams. | |
refunds[].refund_line_items[].line_item.requires_shipping | boolean | Whether the item needs shipping. | |
refunds[].refund_line_items[].line_item.taxable | boolean | Whether the item is taxable. | |
refunds[].refund_line_items[].line_item.gift_card | boolean | Whether the item is a gift card. | |
refunds[].refund_line_items[].line_item.product_exists | boolean | False when the product has been deleted. | |
refunds[].refund_line_items[].line_item.fulfillment_service | string | null | Who fulfills the item. | |
refunds[].refund_line_items[].line_item.fulfillment_status | string | null | Fulfillment status of this line. | |
refunds[].refund_line_items[].line_item.properties | array | null | Custom properties of the line item. | |
refunds[].refund_line_items[].line_item.image | object | Variant image. | |
refunds[].refund_line_items[].line_item.image.src | string | Image URL. | |
refunds[].transactions | array of object | Money returned, as refund transactions. | |
refunds[].transactions[].id | integer | Transaction id. | |
refunds[].transactions[].order_id | integer | Order the transaction belongs to. | |
refunds[].transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
refunds[].transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
refunds[].transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
refunds[].transactions[].amount | number | Amount, VND; negative for refunds. | |
refunds[].transactions[].currency | string | null | Currency code, e.g. VND. | |
refunds[].transactions[].gateway | string | Name of the payment gateway. | |
refunds[].transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
refunds[].transactions[].authorization | string | null | Authorization code. | |
refunds[].transactions[].receipt | string | null | Receipt. | |
refunds[].transactions[].test | boolean | True for a test transaction. | |
refunds[].transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
refunds[].transactions[].location_id | integer | null | Location id. | |
refunds[].transactions[].device_id | integer | null | Device id. | |
refunds[].transactions[].created_at | string | When it was created (ISO 8601). | |
refunds[].transactions[].external_transaction_id | string | null | Id at the payment provider. | |
refunds[].transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
refunds[].transactions[].payment_details | object | null | Payment details, if any. | |
refunds[].transactions[].send_email | boolean | Whether an email was sent. |
Hoàn tiền đơn hàng (Refund order) — haravan.create_order_refund
Refund items or an amount on an order, optionally restocking.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | có | không | com.write_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
order_id | Mã đơn hàng | integer | có | Haravan order id. Min 1. |
refund | Hoàn tiền | object | có | The refund. |
refund.restock | boolean | không | Put items back in stock. | |
refund.notify | boolean | không | Notify the customer. | |
refund.note | string | không | Refund note. | |
refund.refund_line_items | array of object | không | Items to refund: line_item_id and quantity. | |
refund.transactions | array of object | không | Refund transactions: amount, kind 'refund'. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
refund | Hoàn tiền | object | The refund that was created. |
refund.id | integer | Refund id. | |
refund.order_id | integer | Order id. | |
refund.note | string | null | Note attached to the refund. | |
refund.restock | boolean | null | Whether items went back to stock. | |
refund.user_id | integer | null | Staff who made the refund. | |
refund.location_id | integer | null | Location items were returned to. | |
refund.created_at | string | When it was created (ISO 8601). | |
refund.refund_line_items | array of object | Items returned or refunded. | |
refund.refund_line_items[].id | integer | Refund line item id. | |
refund.refund_line_items[].line_item_id | integer | Order line item it refers to. | |
refund.refund_line_items[].quantity | integer | Quantity refunded. | |
refund.refund_line_items[].line_item | object | The order line item. | |
refund.refund_line_items[].line_item.id | integer | Line item id. | |
refund.refund_line_items[].line_item.product_id | integer | null | Product id; null when the product was deleted later. | |
refund.refund_line_items[].line_item.variant_id | integer | Variant id. | |
refund.refund_line_items[].line_item.title | string | Product title. | |
refund.refund_line_items[].line_item.variant_title | string | Variant title. | |
refund.refund_line_items[].line_item.name | string | Product and variant name. | |
refund.refund_line_items[].line_item.sku | string | null | SKU of the variant. | |
refund.refund_line_items[].line_item.barcode | string | null | Barcode of the variant. | |
refund.refund_line_items[].line_item.vendor | string | Supplier of the item. | |
refund.refund_line_items[].line_item.type | string | Product type. | |
refund.refund_line_items[].line_item.quantity | integer | Quantity ordered. | |
refund.refund_line_items[].line_item.fulfillable_quantity | integer | Quantity still available to fulfill. | |
refund.refund_line_items[].line_item.price | number | Unit price before discounts, VND. | |
refund.refund_line_items[].line_item.price_original | number | Unit price before any promotion, VND. | |
refund.refund_line_items[].line_item.price_promotion | number | Promotion discount per unit, VND. | |
refund.refund_line_items[].line_item.total_discount | number | Total discount on this line, VND. | |
refund.refund_line_items[].line_item.grams | number | Weight in grams. | |
refund.refund_line_items[].line_item.requires_shipping | boolean | Whether the item needs shipping. | |
refund.refund_line_items[].line_item.taxable | boolean | Whether the item is taxable. | |
refund.refund_line_items[].line_item.gift_card | boolean | Whether the item is a gift card. | |
refund.refund_line_items[].line_item.product_exists | boolean | False when the product has been deleted. | |
refund.refund_line_items[].line_item.fulfillment_service | string | null | Who fulfills the item. | |
refund.refund_line_items[].line_item.fulfillment_status | string | null | Fulfillment status of this line. | |
refund.refund_line_items[].line_item.properties | array | null | Custom properties of the line item. | |
refund.refund_line_items[].line_item.image | object | Variant image. | |
refund.refund_line_items[].line_item.image.src | string | Image URL. | |
refund.transactions | array of object | Money returned, as refund transactions. | |
refund.transactions[].id | integer | Transaction id. | |
refund.transactions[].order_id | integer | Order the transaction belongs to. | |
refund.transactions[].parent_id | integer | null | Id of the transaction this one follows. | |
refund.transactions[].kind | string | Kind: pending, authorization, capture, sale, void or refund (case varies). | |
refund.transactions[].status | string | null | Status: pending, failure, success or error; some shops return a Vietnamese label. | |
refund.transactions[].amount | number | Amount, VND; negative for refunds. | |
refund.transactions[].currency | string | null | Currency code, e.g. VND. | |
refund.transactions[].gateway | string | Name of the payment gateway. | |
refund.transactions[].is_cod_gateway | boolean | True when the gateway is cash on delivery. | |
refund.transactions[].authorization | string | null | Authorization code. | |
refund.transactions[].receipt | string | null | Receipt. | |
refund.transactions[].test | boolean | True for a test transaction. | |
refund.transactions[].user_id | integer | null | Staff who recorded it; 0 for the system. | |
refund.transactions[].location_id | integer | null | Location id. | |
refund.transactions[].device_id | integer | null | Device id. | |
refund.transactions[].created_at | string | When it was created (ISO 8601). | |
refund.transactions[].external_transaction_id | string | null | Id at the payment provider. | |
refund.transactions[].haravan_transaction_id | string | null | Haravan payment reference. | |
refund.transactions[].payment_details | object | null | Payment details, if any. | |
refund.transactions[].send_email | boolean | Whether an email was sent. |
Xem phí vận chuyển (Get shipping rates) — haravan.get_shipping_rates
Shipping rates for a destination, order value and weight.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | com.read_orders |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
country_id | Quốc gia | integer | không | Country id, 704 for Vietnam. Min 1. |
province_id | Tỉnh/thành | integer | không | Province id from list_provinces. Min 1. |
district_id | Phường/xã | integer | không | Ward id from list_wards. Min 1. |
total_price | Giá trị đơn | number | không | Order value, VND. |
total_weight | Khối lượng | number | không | Total weight in grams. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
shipping_rates | Phí vận chuyển | array of object | Shipping methods available for the destination. |
shipping_rates[].id | integer | Shipping rate id. | |
shipping_rates[].title | string | Rate title. | |
shipping_rates[].price | number | Price, VND. |