Sales Order Details
1. API Information
- Endpoint:
/api/v6.1/sale_order
- Method:
GET
- Authentication: Requires
X-API-KEY
- Header:
X-API-KEY: <your_api_key>
2. Request Parameters
Parameter | Type | Description |
---|---|---|
fields | string | List of data fields to retrieve |
order_code | string | Order code to query |
Request example:
curl --location 'https://example.com/api/v6.1/sale_order?fields=id,order_code,real_amount&order_code=ORDER123' \
--header 'X-API-KEY: YOUR_API_KEY' \
--header 'Cookie: session_id=YOUR_SESSION_ID'
3. Response
{
"id": 93,
"order_code": "ORDER123",
"real_amount": 65000,
"f_amount": 0,
"discount": 0,
"discount_amount": 0,
"vat_amount": 0,
"account_id": 12021,
"account_code": "CUSTOMER_2025_001",
"account_email": "",
"account_phone": "",
"account_address": "Address A",
"order_date": "2025-02-03",
"created_at": "2025-02-03 08:23:40",
"updated_at": "2025-02-03 08:23:40",
"status": 1,
"status_label": "Pending Approval",
"payment_status": "Unpaid",
"assigned_user": 2,
"assigned_user_name": "Employee A",
"order_details": [
{
"id": 140,
"product_id": 2507,
"product_code": "PRODUCT_2507",
"product_name": "Product X",
"unit_name": "Service",
"quantity": 1,
"price": 65000,
"amount": 65000,
"product_avatar": "https://example.com/no_image.png"
}
],
"lading_code": "",
"tracking_url": "",
"custom_fields": {
"send_order_confirmation_message": 6,
"so_ne": "0"
}
}
4. Data Field Descriptions
Field | Type | Description |
---|---|---|
id | int | Order ID |
order_code | string | Order code |
real_amount | int | Total actual amount of the order |
account_id | int | Customer ID |
account_code | string | Customer code |
account_address | string | Customer address |
order_date | string (YYYY-MM-DD) | Order date |
status | int | Order status code |
status_label | string | Order status label |
payment_status | string | Payment status |
assigned_user | int | Assigned employee ID |
assigned_user_name | string | Assigned employee name |
order_details | array | List of products in the order |
lading_code | string | Bill of lading code |
tracking_url | string | Bill of lading tracking URL |
custom_fields | object | Custom data fields |
5. Notes
- If
status
=1
, the order is in "Pending Approval" status.\ - Payment status can be "Unpaid", "Partially Paid", "Paid".\
- Some fields like
lading_code
,tracking_url
can be empty if the bill of lading has not been updated.\ - Data fields in
custom_fields
will vary depending on system configuration.