Deleting an order
The deletion of an order from Order Service is an exceptional process. The process is designed to delete orders from Order Service only when the orders are deleted from Sterling™ Order Management System Software for business reasons.
The built-in integration with Order Service automatically performs deletion of
orders when they are deleted in Sterling Order Management System Software. Any other way of deleting order from
Order Service causes data integrity issues, and hence is strictly forbidden. Both
the saveOrderSummary or saveBulkOrderSummary API can delete an
order from the Order Search service. The API input request for delete order is
similar to the save order request. But instead of passing the order summary, you must pass the
forDelete=true parameter, as shown in the following sample request.
{
"order": {
"orderId": {
"id": "ORD001",
"orderNo": "order1",
"documentType": "001",
"enterpriseCode": "Ent1"
},
"forDelete": true
}
}
However, a summary is also passed in the input along with the forDelete=true
parameter. The API does not consider it as a delete request. Instead, it initiates the save
action.
The following are the possible scenarios:
| 'forDelete' status | Order summary | API action |
|---|---|---|
true |
Absent or NULL | Initiates order deletion. |
true |
Empty JSON | Initiates order save. Then, reports an error that mentions that the order summary is empty. |
true |
A valid JSON | Initiates order save. |