Chuyển tới nội dung chính

Chi tiết Đơn hàng mua

Endpoint: GET /api/v6.1/purchase_order

Mô tả: API này được sử dụng để lấy thông tin chi tiết của một đơn hàng mua duy nhất, dựa trên mã order_code. Dữ liệu trả về bao gồm các thông tin tài chính, khách hàng, sản phẩm, trạng thái và trường tùy chỉnh.


Yêu cầu

Phương thức: GET

Headers:

X-API-KEY: <api-key-của-bạn>
Cookie: <session-cookie-của-bạn>

Query Parameters:

Tham sốKiểuMô tả
fieldsstringDanh sách trường muốn lấy
order_codestringMã đơn hàng cần truy xuất (bắt buộc)

Phản hồi

Trạng thái: 200 OK

{
"order_code": "PO001",
"real_amount": 1000000,
"f_amount": 1000000,
"discount": 0,
"discount_amount": 0,
"vat_amount": 0,
"account_id": null,
"account_code": "",
"account_email": "",
"account_phone": "",
"account_address": "",
"order_date": "2025-05-12 00:00:00",
"created_at": "2025-05-12 09:10:48",
"updated_at": "2025-05-12 09:10:48",
"status": 1,
"assigned_user": 2,
"assigned_user_name": "Người phụ trách",
"contact_name": "",
"contact_phone": "",
"contact_email": "",
"r_account_manager": null,
"sheet_in_creator": null,
"approval_user": null,
"create_user": 2,
"invalid": 0,
"valid": 1,
"attachment_code": "",
"can_importable": 0,
"can_repayable": 0,
"detail_custom_fields": {
"ma_phu": "",
"ghi_chu_rieng": ""
},
"custom_fields": [],
"order_details": [
{
"id": 456,
"product_id": 789,
"product_name": "Tên sản phẩm A",
"product_code": "SP123",
"quantity": 1,
"price": 1000000,
"amount": 1000000,
"unit_name": "Chiếc",
"product_avatar": "https://example.com/image.png"
}
]
}

Mô tả các trường quan trọng

TrườngMô tả
order_codeMã đơn hàng duy nhất
real_amount, f_amountTổng giá trị thực tế / trước chiết khấu
discount, discount_amount, vat_amountChiết khấu và thuế
order_date, created_at, updated_atCác mốc thời gian liên quan
status, valid, invalidTrạng thái đơn hàng và cờ logic
assigned_user, assigned_user_nameNhân viên phụ trách
contact_*, account_*Thông tin liên hệ và khách hàng
custom_fields, detail_custom_fieldsTrường mở rộng tùy chỉnh
order_detailsDanh sách sản phẩm đi kèm