Cancel an Order

Service URL: DELETE /orders/{orderId}

Tokens:

orderId – The id of the order to request cancellation for

Remarks:

Request cancellation of an order. If the order cannot be cancelled at this time, the service should respond with a 405 (Method Not Allowed) status code. Otherwise the cancellation request will be recorded and processed later, the service should respond with a 202 (Accepted) status code – this does not guarantee that cancellation will be possible. Note that the Order Status, returned on the Get Order Details service, will provide a hint to the client if a cancellation is possible.

Scenarios

ScenarioOutcomeExpected behaviourStatus CodeResponse
1The orders service recieves a valid order id and the order belongs to the customerSuccessThe customers orders has been requested to be cancelled by the order manager.202Response: 202 Accepted.
2The orders service recieves with a valid order id and the order does not belong to the customer.NotAllowedThe customer order is not cancelled. A NotAllowed error message is returned.405ErrorMessage: 405, Not allowed to cancel order, outcome: NotAllowed.
3The orders service recieves a invalid order idFailThe customer order is not cancelled .A Internal server error message is returned500ErrorMessage: 500, Failed to cancel order, outcome: Fail

Example Request:

DELETE http://localhost:8080/WebRestApi/rest/orders/00002905

Example Response:

Status: 202 Accepted
Go to Top