Skip to main content

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

ParameterTypeDescription
fieldsstringList of data fields to retrieve
order_codestringOrder 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

FieldTypeDescription
idintOrder ID
order_codestringOrder code
real_amountintTotal actual amount of the order
account_idintCustomer ID
account_codestringCustomer code
account_addressstringCustomer address
order_datestring (YYYY-MM-DD)Order date
statusintOrder status code
status_labelstringOrder status label
payment_statusstringPayment status
assigned_userintAssigned employee ID
assigned_user_namestringAssigned employee name
order_detailsarrayList of products in the order
lading_codestringBill of lading code
tracking_urlstringBill of lading tracking URL
custom_fieldsobjectCustom 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.