Service URL: PATCH /orders/{orderId}/return
Tokens:
orderId – The id of the order to be returned
Remarks:
Request return of an order. If the order 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 Status, returned on the Get Order Details service, will provide a hint to the client if a return is possible.
Scenarios
Scenario | Outcome | Expected behaviour | Status Code | Response | |
---|---|---|---|---|---|
1 | The orders service receives a valid order id and the order belongs to the customer | Success | The customer’s order has been requested to be returned by the order manager. | 202 | Response: 202 Accepted. |
2 | The orders service receives with a valid order id and the order does not belong to the customer. | NotAllowed | The customer order is not returned. A NotAllowed error message is returned. | 405 | ErrorMessage: 405, Not allowed to return order, outcome: NotAllowed. |
3 | The orders service receives an invalid order id | Fail | The customer order is not returned. An Internal server error message is returned | 500 | ErrorMessage: 500, Failed to return order, outcome: Fail |
Example Request
PATCH http: //localhost:8080/WebRestApi/rest/orders/00002905/return |
Example Response
Status: 202 Accepted