OMSĐơn hàng
Order Object Schema
Chi tiết các trường dữ liệu của một object `Order`
JSON Schema
| Trường (Field) | Kiểu (Type) | Mô tả (Description) |
|---|---|---|
| Thông tin cơ bản | ||
company_id | integer | ID công ty |
creator_id | integer | User ID người tạo đơn |
id | int | ID đơn hàng (Mã đơn hàng) |
uuid | string | UUID duy nhất của đơn hàng |
company_id | int | ID công ty (tenant) |
creator_id | int | ID người tạo đơn |
source | int | Nguồn đơn hàng (Xem constant SOURCE_*) |
source_name | string | Tên nguồn đơn hàng nếu source là SOURCE_CUSTOM |
external_id | string | ID từ hệ thống bên ngoài |
store_id | int | ID cửa hàng tạo đơn |
pickup_store_id | int | ID cửa hàng khách muốn đến lấy hàng (SHIPPING_TYPE_PICKUP) |
shift_id | int | ID ca làm việc của nhân viên tại POS |
customer_id | int | ID khách hàng |
warehouse_id | int | ID nhà kho xử lý |
sale_id | int | ID nhân viên kinh doanh |
| Thông tin người đặt hàng | ||
billing_full_name | string | Tên đầy đủ người đặt hàng |
billing_phone | string | Số điện thoại người đặt hàng |
billing_email | string | Email người đặt hàng |
billing_address | string | Địa chỉ người đặt hàng |
billing_region_id | integer | ID Tỉnh/Thànhh phố của địa chỉ đặt hàng |
billing_sub_region_id | integer | ID Quận/huyện của địa chỉ đặt hàng |
billing_sub_sub_region_id | integer | ID Phường/xã của địa chỉ đặt hàng |
| Thông tin vận chuyển | ||
shipping_type | integer | Loại vận chuyển (xem constant SHIPPING_TYPE_*) |
shipping_address_id | integer | ID địa chỉ giao hàng (CustomerAddress) |
shipping_full_name | string | Tên người nhận hàng |
shipping_phone | string | Số điện thoại người nhận |
shipping_email | string | Email người nhận |
shipping_address | string | Địa chỉ giao hàng |
shipping_region_id | integer | ID Tỉnh/Thànhh phố của địa chỉ giao hàng |
shipping_sub_region_id | integer | ID Quận/huyện của địa chỉ giao hàng |
shipping_sub_sub_region_id | integer | ID Phường/xã của địa chỉ giao hàng |
shipping_address_line_2 | string | Địa chỉ phủ (Block, Căn hộ, Chung cư..) |
shipping_instruction | string | Hướng dẫn giao hàng |
shipping_legacy_province_name | string | Tên tỉnh/thành phố cũ (legacy) |
shipping_legacy_district_name | string | Tên quận/huyện cũ (legacy) |
shipping_legacy_ward_name | string | Tên phường/xã cũ (legacy) |
shipping_profile_id | integer | ID profile phí giao hàng |
shipping_profile_detail | array | Chi tiết profile rate áp dụng phí giao hàng |
shipping_profile_rate_id | integer | ID cách tính phí giao hàng (Rate ID) |
shipping_carrier_id | integer | ID đối tác vận chuyển |
shipping_code | string | Mã vận đơn |
shipping_cod_amount | integer | Số tiền thu hộ |
shipping_status | integer | Trạng thái vận chuyển |
| Thông tin thanh toán, xử lý | ||
payment_method | integer | Phương thức thanh toán (xem constant PAYMENT_METHOD_*) |
payment_status | integer | Trạng thái thanh toán (xem constant PAYMENT_STATUS_*) |
fulfillment_status | integer | Trạng thái fulfillment (xem constant FULFILLMENT_STATUS_*) |
exception_status | integer | Trạng thái ngoại lệ (xem constant EXCEPTION_STATUS_*) |
exception_count_total | integer | Tổng số ngoại lệ |
exception_count_unresolved | integer | Số ngoại lệ chưa giải quyết |
| Thông tin giá bán | ||
quantity | integer | Tổng số lượng (Tính theo UOM Quantity) |
weight | integer | Tổng trọng lượng |
price_policy_id | integer | ID chính sách giá |
price_sell | integer | Tổng tiền hàng |
price_shipping | integer | Phí vận chuyển |
price_discount_order | integer | Giảm giá đơn hàng |
price_discount_shipping | integer | Giảm phí giao hàng |
price_discount_coupon | integer | Giảm giá bằng coupon |
price_discount_manual | integer | Giảm giá thủ công |
price_discount | integer | Tổng giảm giá (cộng 4 trường trên) |
price_handling | integer | Phí xử lý |
price_tax | integer | Thuế |
price_final | integer | Tổng tiền báo khách |
price_deposit | integer | Tiền cọc |
price_debt | integer | Công nợ (KHÔNG SỬ DỤNG) |
| Thông tin thực tế (fulfillment) | ||
quantity_fulfilled | int | Số lượng bán thực tế (Theo UOM Quantity) |
weight_fulfilled | int | Trọng lượng bán thực tế (gram) |
price_sell_fulfilled | int | Tổng tiền hàng thực tế |
price_shipping_fulfilled | int | Phí giao hàng thực tế |
price_discount_order_fulfilled | int | Chiết khấu đơn hàng thực tế |
price_discount_coupon_fulfilled | int | Chiết khấu coupon thực tế |
price_discount_shipping_fulfilled | int | Chiết khấu giao hàng thực tế |
price_discount_manual_fulfilled | int | Chiết khấu thủ công thực tế |
price_discount_fulfilled | int | Tổng chiết khấu thực tế |
price_handling_fulfilled | int | Phí xử lý thực tế |
price_tax_fulfilled | int | Thuế thực tế |
price_final_fulfilled | int | Tổng tiền thực tế khách cần thanh toán |
| Thông tin hoá đơn | ||
tax_name | string | Xuất hoá đơn cho (Tên cá nhân, tổ chức) |
tax_is_company | integer | Có phải công ty không (0 hoặc 1) |
tax_code | string | Mã số thuế |
tax_address | string | Địa chỉ |
tax_email | string | Email nhận hoá đơn |
tax_invoice_type | integer | Hình thức xuất hoá đơn (Xem constant TAX_INVOICE_TYPE_*) |
tax_invoice_status | integer | Trạng thái hóa đơn (Xem constant TAX_INVOICE_STATUS_*) |
| Thông tin affiliate | ||
aff_id | int | ID đối tác affiliate |
aff_code_id | int | ID của mã giới thiệu |
aff_code | string | Mã giới thiệu (Affiliate Code) |
aff_click_token | string | Token click affiliate |
aff_check_status | int | Trạng thái đơn affiliate (Xem constant AFF_CHECK_STATUS_*) |
| Thông tin khác | ||
note | string | Ghi chú của khách hàng |
tag | string | Tag |
count_return_order | int | Số lần trả hàng |
origin_order_id | int | ID đơn hàng gốc |
status | int | Trạng thái đơn hàng |
cancel_reason | int | Lý do hủy đơn |
workflow_id | string | ID workflow |
picking_list_id | int | ID danh sách lấy hàng |
file_id_list | array | Danh sách ID file |
user_id_confirm | int | ID user xác nhận |
holding_reason | int | Lý do tạm giữ |
holding_note | string | Ghi chú tạm giữ |
ip_address | string | Địa chỉ IP máy tạo đơn hàng |
file_list | File[] | Danh sách file đính kèm |
details | array | Không dùng, chỉ là Placeholder cho object |
| Thông tin thời gian | ||
date_created | int | Thời gian tạo đơn (UNIX timestamp) |
date_modified | int | Thời gian sửa đơn (UNIX timestamp) |
date_confirm_customer | int | Thời gian xác nhận với khách (UNIX timestamp) |
date_holding | int | Thời gian tạm giữ (UNIX timestamp) |
date_picking | int | Thời gian lấy hàng (UNIX timestamp) |
date_packing | int | Thời gian đóng gói (UNIX timestamp) |
date_wait_pickup | int | Thời gian chờ lấy hàng (UNIX timestamp) |
date_shipping | int | Thời gian giao hàng (UNIX timestamp) |
date_shipped | int | Thời gian đã giao (UNIX timestamp) |
date_shipped_planning | int | Thời gian dự kiến giao (UNIX timestamp) |
date_returning | int | Thời gian đang trả (UNIX timestamp) |
date_returned | int | Thời gian đã trả (UNIX timestamp) |
date_completed | int | Thời gian hoàn thành (UNIX timestamp) |
date_cancelled | int | Thời gian hủy đơn (UNIX timestamp) |
date_fulfilled | int | Thời gian hoàn tất fulfillment (UNIX timestamp) |
date_calculate_fulfill_price | int | Thời gian tính giá thực tế fulfillment (UNIX timestamp) |
Lưu ý
Để lấy danh sách chi tiết đơn hàng, cần gọi API
/v1/orderdetails/order/:order_id để lấy danh sách chi tiết đơn hàng.
Ví dụ JSON object
{
"company_id": 10311,
"creator_id": 1,
"id": 10002414,
"uuid": "3b733736-2278-42d1-8c2f-31d5cef7cd81",
"source": 1,
"source_name": "",
"external_id": "",
"store_id": 32,
"pickup_store_id": 0,
"shift_id": 0,
"warehouse_id": 33,
"customer_id": 101,
"sale_id": 0,
"quantity": 7,
"weight": 2700,
"price_policy_id": 1,
"price_sell": 1963600,
"price_discount_order": 98180,
"price_discount_coupon": 0,
"price_discount_shipping": 12000,
"price_discount_manual": 0,
"price_discount": 110180,
"price_shipping": 20000,
"price_handling": 0,
"price_tax": 0,
"price_final": 1873420,
"price_deposit": 0,
"price_debt": 1873420,
"quantity_fulfilled": 7,
"weight_fulfilled": 2700,
"price_sell_fulfilled": 1963600,
"price_shipping_fulfilled": 20000,
"price_discount_order_fulfilled": 98180,
"price_discount_coupon_fulfilled": 0,
"price_discount_shipping_fulfilled": 12000,
"price_discount_manual_fulfilled": 0,
"price_discount_fulfilled": 110180,
"price_handling_fulfilled": 0,
"price_tax_fulfilled": 0,
"price_final_fulfilled": 1873420,
"promotion_id": 0,
"promotion_coupon": "",
"promotion_detail": {
"coupons": [],
"promotions": []
},
"billing_full_name": "Hoàng Văn Hải",
"billing_phone": "0909876543",
"billing_email": "",
"billing_address": "15 Trần Phú",
"billing_sub_sub_region_id": 88811332,
"billing_sub_region_id": 88810507,
"billing_region_id": 88831,
"payment_method": 11,
"payment_status": 1,
"fulfillment_status": 13,
"exception_status": 0,
"exception_count_total": 0,
"exception_count_unresolved": 0,
"shipping_type": 3,
"shipping_address_id": 0,
"shipping_full_name": "Hoàng Văn Hải",
"shipping_phone": "0909876543",
"shipping_email": "",
"shipping_address": "15 Trần Phú",
"shipping_sub_sub_region_id": 88811296,
"shipping_sub_region_id": 888303,
"shipping_region_id": 88831,
"shipping_address_line_2": "",
"shipping_instruction": "",
"shipping_legacy_province_name": "",
"shipping_legacy_district_name": "",
"shipping_legacy_ward_name": "",
"shipping_profile_id": 0,
"shipping_profile_detail": [],
"shipping_profile_rate_id": 0,
"shipping_carrier_id": 23,
"shipping_code": "",
"shipping_cod_amount": 0,
"shipping_status": 9,
"tax_name": "",
"tax_is_company": 0,
"tax_code": "",
"tax_address": "",
"tax_email": "",
"tax_invoice_type": 7,
"tax_invoice_status": 1,
"note": "",
"tag": "",
"count_return_order": 0,
"origin_order_id": 0,
"status": 13,
"cancel_reason": 0,
"workflow_id": "",
"picking_list_id": 10043,
"file_id_list": [],
"user_id_confirm": 0,
"holding_reason": 0,
"holding_note": "",
"aff_id": 0,
"aff_code_id": 0,
"aff_code": "",
"aff_click_token": "",
"aff_check_status": 0,
"ip_address": "14.169.11.81",
"date_created": 1761449740,
"date_modified": 1761459503,
"date_confirm_customer": 1761449740,
"date_holding": 0,
"date_picking": 1761449773,
"date_packing": 1761449804,
"date_wait_pickup": 0,
"date_shipping": 0,
"date_shipped": 0,
"date_shipped_planning": 0,
"date_returning": 0,
"date_returned": 0,
"date_completed": 0,
"date_cancelled": 0,
"date_fulfilled": 0,
"date_calculate_fulfill_price": 0,
"details": [],
"file_list": []
}