Get Order List
Use this api to get order list in EMS
URL : api-auth/inner/orders
Method : GET
Authorization : Use OAuth token
Validate Rule
'status' => ['nullable', 'string'], // for multiple status use "," to separate
'order_code' => ['nullable', 'string'],
'phone' => ['nullable', 'string'],
'store_code' => ['nullable', 'string'],
'fulfillment_type' => ['nullable', 'int'],
'create_start' => ['nullable', 'string'],
'create_end' => ['nullable', 'string'],
'source' => ['nullable', 'string'], // for multiple status use "," to separate
'customer_id' => ['nullable', 'string'],
'payment_status' => ['nullable', 'int'],
'page_size' => ['nullable', 'int'],
'page' => ['nullable', 'int'],
'sort_by' => ['nullable', 'string'],
'sort_type' => ['nullable', 'string'],
list Order Status enum
'NEW' => 1,
'PROCESSING' => 2,
'APPROVED' => 3,
'PICKED' => 4,
'SHIPPED' => 5,
'CANCELLED' => 7,
'CLOSED' => 8,
'FAIL_DELIVERY' => 9,
'DELIVERED' => 10,
'RETURNED' => 11,
'TF_PROCESSING' => 12,
'PACKED' => 13,
'PENDING_CANCEL' => 14,
'PENDING_TO_REFUND' => 15,
Sort
sort_by: order_code,customer,created_at,store,status,check_by
sort_type: asc, desc
Payment status
'UNPAID' => 0,
'PAID' => 1,
Fulfillment Type
'DELIVERY' => 0,
'PICKUP' => 1,
Example : https://api-gateway.develop.pharmacity.io/pmc-oms-order-manage-api/api-auth/inner/orders?source=hellobacsi,cs-hotline,cs-zalo,cs-telemedicine,cs-webchat,cs-internal,cs-online_prescription,cs-others,cs-facebook&payment_status=0&create_start=2024-07-20&create_end=2024-08-20&status=3&page=1&page_size=10&sort_by=created_at&sort_type=desc
Success Response
Code : 200 OK
Content example
{
"result": "success",
"error": "",
"error_code": "",
"data": {
"sort_by": "created_at",
"sort_type": "desc",
"orders": [
{
"order_id": 490300,
"order_number": "1909954699",
"customer": {
"id": 138513,
"full_name": "Khách hàng",
"phone_number": "0839032743"
},
"store": null,
"receive_store": {
"id": 14,
"name": "Trần Cao Vân",
"phone": null,
"address": "136 Hai Bà Trưng",
"province": "Thành phố Hồ Chí Minh",
"district": "Quận 1",
"type": "Pharmacy",
"code": "TCV"
},
"payment_status": "Unpaid",
"status": 3,
"source_status": 2,
"ops_note": null,
"approve_by": null,
"approve_at": "2024-08-20T06:12:36.000000Z",
"total": 31000,
"ax_status": 2,
"ax_status_label": "Approved",
"created_at": "2024-08-20T06:12:33.000000Z",
"source": "Cs Hotline",
"sync_ax_status": "SUCCESS",
"fulfillment_type": "Delivery",
"receiver": {
"id": 225355,
"full_name": "Minh Hieu",
"phone_number": "0347922560"
},
"auto_approve": 1,
"auto_approve_status": 4,
"auto_approve_reason": null,
"invalid_order_type": 0,
"med_request_code": null
},
{
"order_id": 490221,
"order_number": "1839177083",
"customer": {
"id": 138163,
"full_name": "Khách hàng",
"phone_number": "0979007831"
},
"store": null,
"receive_store": {
"id": 83,
"name": "Xóm Chiếu",
"phone": null,
"address": "124 Xóm Chiếu",
"province": "Thành phố Hồ Chí Minh",
"district": "Quận 4",
"type": "Supper Drugstore",
"code": "SGPMC079"
},
"payment_status": "Unpaid",
"status": 3,
"source_status": 2,
"ops_note": null,
"approve_by": null,
"approve_at": "2024-08-19T06:53:07.000000Z",
"total": 51480,
"ax_status": 2,
"ax_status_label": "Approved",
"created_at": "2024-08-19T06:53:04.000000Z",
"source": "Cs Hotline",
"sync_ax_status": "SUCCESS",
"fulfillment_type": "Delivery",
"receiver": {
"id": 225167,
"full_name": "Trang test",
"phone_number": "0111111111"
},
"auto_approve": 1,
"auto_approve_status": 4,
"auto_approve_reason": null,
"invalid_order_type": 0,
"med_request_code": null
}
],
"page": 1,
"page_size": 2,
"next_page": 2,
"previous_page": null,
"total_page": 23,
"total_records": 46
}
}
Error Response
Code : 401 Unauthorized
Content :
{
"success": false,
"errors": "Invalid token",
"errorCode": "UNAUTHORIZED",
"data": null
}
cURL
curl --location 'https://api-gateway.develop.pharmacity.io/pmc-oms-order-manage-api/api-auth/inner/orders?source=hellobacsi%2Ccs-hotline%2Ccs-zalo%2Ccs-telemedicine%2Ccs-webchat%2Ccs-internal%2Ccs-online_prescription%2Ccs-others%2Ccs-facebook&payment_status=0&create_start=2024-07-20&create_end=2024-08-20&status=3&page=1&page_size=2&sort_by=created_at&sort_type=desc' \
--header 'Authorization: Bearer XXXXX'