inquireOrderDetail
POST /v2/pds/order/inquireOrderDetail
With this API call, D-store Platform can request the SaaS provider or ISV to inquire about the order detail (for example, order status) by requestOrderId and return the result.
The message structure of this API is defined by D-store Platform. Follow the specifications below when the SaaS provider or ISV develops this API.
Note: This API is very important for ordering interaction. If the notification is lost or delayed when notifying the merchant to accept orders, D-store Platform can call this API to query the order status to ensure a normal transaction.
Before you begin
Before you integrate with this API, it is recommended to learn the following basic concepts:
- Eat-before-payment
Eat-before-payment is a dining scenario where the users enjoy their meals first and check out later. In mini programs, this dining scenario is only applicable to dining-in orders and allows users to add items to their original order by placing multiple additional orders.
- Main order
A main order is the combination of the first order and all additional orders placed for one single dining experience. This type of order is available only in the eat-before-payment scenario and can have one or more subordinate orders.
- Subordinate order
A subordinate order is the first order or an additional order placed for one single dining experience. This type of order is available only in the eat-before-payment scenario and related to a main order.
- Whole order
A whole order is a dining-in order placed with a payment, which users cannot add items to. This concept is used to refer to dining-in orders that are not placed in the eat-before-payment scenario.
Structure
A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:
Request parameters
Field | Data type | Required | Description | Example |
requestOrderId | String | Yes | Indicates the unique ID assigned by D-store Platform to identify an order.
| "pds_2109220007538584_2022050900338308584_1" |
Response parameters
Field | Data type | Required | Description | |
result | Yes | Indicates the request result, such as status and error codes. | - | |
orderId | String | Yes | Indicates the unique ID assigned by the SaaS provider or ISV to identify the order.
| "1437327" |
orderStatus | String | Yes | Indicates the status of the order. Valid values are:
| "REJECTED" |
extendInfo | Map<String,String> | No | Indicates the extended information about this API.
Take the following examples:
| Example 1: {"rebatedAssets":"{\"POINT\":100,\"BALANCE\":{\"currency\":\"SGD\",\"amountValue\":100}}"} Example 2: {"rejectOrderReason": "The store is closed."} |
Result process logic
In the response, the result.resultStatus field indicates the result of processing a request. The following table describes each result status:
Result status | Description |
S | The inquiry is successful. The corresponding result.resultCode is |
U | The status of the inquiry request is unknown. The corresponding result.resultCode is For details, see the Common error codes section. |
F | The inquiry is failed. The corresponding result.resultCode and result.resultMessage may vary based on different situations. For details, see the following Error codes section. |
Error codes
Error codes are usually classified into the following categories:
- Common error codes are common for F&B mini program OpenAPIs.
Samples
Request
{
"requestOrderId": "pds_2109220007538584_2022050900338308584_1"
}
Response
The orderId, orderStatus, and result parameters must be returned.
See the following example:
{
"orderId": "1437327",
"orderStatus": "REJECTED",
"result": {
"resultCode": "SUCCESS",
"resultMessage": "success",
"resultStatus": "S"
},
"extendInfo":"{\"rejectOrderReason\":\"The store is closed.\"}"
}