Request Return of an Order Item

Service URL: PATCH /orders/{orderId}/items/{lineNumber}/return

Tokens:

orderId – The id of the order that holds the line to be cancelled

lineNumber – The line number of the item to be cancelled.

Request Body:

Quantity – The number of items to be returned (optional). Defaults to the ordered quantity.

ReasonKey – The key for the return reason

Remarks:

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

Scenarios

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

Example Request

PATCH http://localhost:8080/WebRestApi/rest/orders/00002905/items/1/return

Example Response

Status: 202 Accepted

Go to Top