OMSĐơn hàng
Cập nhật đơn hàng
Thay đổi thông tin đơn hàng
API này cho phép cập nhật các thông tin cơ bản của đơn hàng như thông tin khách hàng, địa chỉ giao hàng, phương thức thanh toán, trạng thái và các thông tin khác. Việc cập nhật chi tiết sản phẩm trong đơn hàng có thể yêu cầu các API chuyên biệt khác.
Endpoint
PUT /v1/orders/:id
Path Parameters
| Tên | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
id | int | Có | ID đơn hàng |
Request Payload
JSON Object Payload:
{
"id": 10002414,
"source": 1,
"source_name": "",
"store_id": 32,
"pickup_store_id": 0,
"shift_id": 0,
"warehouse_id": 33,
"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_final": 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_coupon": "",
"promotion_id": 0,
"billing_full_name": "Hoàng Văn Hải",
"billing_phone": "0909876543",
"billing_email": "",
"billing_address": "15 Trần Phú",
"billing_region_id": 88831,
"billing_sub_region_id": 88810507,
"billing_sub_sub_region_id": 88811332,
"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_region_id": 88831,
"shipping_sub_region_id": 888303,
"shipping_sub_sub_region_id": 88811296,
"shipping_address_line_2": "",
"shipping_instruction": "",
"shipping_legacy_province_name": "",
"shipping_legacy_district_name": "",
"shipping_legacy_ward_name": "",
"shipping_carrier_id": 23,
"shipping_status": 9,
"tax_name": "",
"tax_is_company": 0,
"tax_code": "",
"tax_address": "",
"tax_email": "",
"tax_invoice_type": 7,
"tax_invoice_status": 1,
"file_id_list": [],
"note": "",
"tag": "",
"count_return_order": 0,
"origin_order_id": 0,
"status": 13,
"aff_id": 0,
"aff_code_id": 0,
"aff_code": "",
"aff_click_token": "",
"details": [
{
"company_id": 10311,
"creator_id": 0,
"order_id": 10002414,
"product_id": 486,
"product_variant_id": 948,
"id": 3787,
"type": 1,
"item_type": 1,
"item_serial_number": "",
"item_option_value_id_list": [4, 13],
"sku": "2397540229784",
"item_option_value_text": "Đen, M",
"item_name": "PUMA - Áo khoác nam thể thao cổ trụ phối zip Fit Woven Half Zip Training 522129",
"item_quantity": 3,
"item_weight": 400,
"item_unit_price_original": 599000,
"item_unit_price": 479200,
"price_discount": 359400,
"price_tax": 0,
"price_final": 1437600,
"tax_ratio": 11,
"tax_is_included": 1,
"note": "",
"promotion_id": 0,
"promotion_detail": [],
"is_catch_weight": 0,
"uom_id": 1000,
"uom_name": "Cái",
"uom_factor": 1,
"uom_quantity": 3,
"uom_unit_price": 479200,
"uom_unit_price_original": 599000,
"customize_required": 0,
"customize_description": "",
"file_id_list": [],
"file_list": [],
"item_quantity_fulfilled": 2,
"item_unit_price_fulfilled": 0,
"uom_quantity_fulfilled": 2,
"uom_unit_price_fulfilled": 0,
"price_sell_fulfilled": 0,
"price_tax_fulfilled": 0,
"price_final_fulfilled": 0,
"price_discount_fulfilled": 0,
"pick_detail_id_list": [],
"bundle_identifier": "",
"bundle_promotion_id": 0,
"bundle_promotion_product_id": 0,
"bundle_promotion_multiplier": 0,
"bundle_index": 0,
"bundle_allocation_rule": "",
"bundle_discount_allocated": 0,
"bundle_promotion_name": "",
"bundle_promotion_type": 0
}
]
}Response Schema
HTTP 200 - JSON Object
Error Codes
| HTTP | Code | Mô tả |
|---|---|---|
| 422 | error_setting_fetch_error | Lỗi lấy cấu hình công ty |
| 422 | error_not_permission | Không có quyền chỉnh sửa đơn hàng tại cửa hàng này |
| 422 | error_details_have_invalid_data_line | Chi tiết đơn hàng có dữ liệu không hợp lệ |
| 422 | error_not_permission_edit_detail | Không có quyền chỉnh sửa chi tiết đơn hàng |
| 422 | error_not_allow_change_detail_in_complete_or_cancel_order | Không được phép thay đổi chi tiết đơn hàng đã hoàn thành hoặc hủy |
| 422 | error_detail_item_required_imei (SKU: [sku]) | Sản phẩm IMEI bắt buộc phải có số IMEI |
| 422 | error_billing_region_id_not_exist | Vùng thanh toán không tồn tại |
| 422 | error_billing_sub_region_id_not_exist | Quận/huyện thanh toán không tồn tại |
| 422 | error_billing_sub_sub_region_id_not_exist | Phường/xã thanh toán không tồn tại |
| 422 | error_shipping_region_id_not_exist | Vùng giao hàng không tồn tại |
| 422 | error_shipping_sub_region_id_not_exist | Quận/huyện giao hàng không tồn tại |
| 422 | error_shipping_sub_sub_region_id_not_exist | Phường/xã giao hàng không tồn tại |