Skip to main content

Purchase Order Details

Endpoint: GET /api/v6.1/purchase_order

Description: This API is used to retrieve detailed information of a single purchase order, based on the order_code. The returned data includes financial information, customer details, products, status, and custom fields.


Request

Method: GET

Headers:

X-API-KEY: <your-api-key>
Cookie: <your-session-cookie>

Query Parameters:

ParameterTypeDescription
fieldsstringList of fields to retrieve
order_codestringOrder code to query (required)

Response

Status: 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": "Responsible Person",
"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": {
"sub_code": "",
"private_note": ""
},
"custom_fields": [],
"order_details": [
{
"id": 456,
"product_id": 789,
"product_name": "Product Name A",
"product_code": "SP123",
"quantity": 1,
"price": 1000000,
"amount": 1000000,
"unit_name": "Piece",
"product_avatar": "https://example.com/image.png"
}
]
}

Description of important fields

TrườngMô tả
order_codeUnique order code
real_amount, f_amountTotal actual value / before discount
discount, discount_amount, vat_amountDiscount and tax
order_date, created_at, updated_atRelated timestamps
status, valid, invalidOrder status and logical flags
assigned_user, assigned_user_nameResponsible staff
contact_*, account_*Contact and customer information
custom_fields, detail_custom_fieldsCustom extended fields
order_detailsList of accompanying products