Getting a list of reasons for order cancellation

To call the order cancellation method if order cancellation reasons are enabled, you need to get a list of possible order cancellation reasons.

Example request

GET https://delivery.ucs.ru/orders/api/v1/rejectionReasons

Example answer

{
	"result": [
   	  {
   	    "id": "a762a6da-2379-4fa2-9a04-7f5ca82b39d4",
		"reason": "Test order",
		"type": "simple",
		"isPossibleDelete": true
	  },
      {
	    "id": "4239979e-093c-43c0-8351-6918364c5c94",
	    "reason": "Double",
		"type": "simple",
		"isPossibleDelete": true
	  },
      {
	    "id": "37631981-7d11-4e36-8465-dd1887d888cc",
		"reason": "The guest refused the order",
		"type": "simple",
		"isPossibleDelete": true
	  },
      {
        "id": "7c224784-7382-4a47-8e5a-849d8529a34a",
	    "reason": "The guest is unavailable / did not open the door",
		"type": "simple",
		"isPossibleDelete": true
	  },
      {
	    "id": "bb8502fa-dfcc-4196-a306-08ec526abc91",
		"reason": "The dish is out of stock",
		"type": "simple",
		"isPossibleDelete": true
	  },
      {
		"id": "73f8e0eb-06d5-489f-8258-42a941bede14",
		"reason": "Cancelled by the restaurant",
		"type": "simple",
		"isPossibleDelete": false
	  },
      {
		"id": "5ff37e88-61ef-46ff-9f6c-4c9579e74210",
		"reason": "Other",
		"type": "text"
		"isPossibleDelete": true
	  }
   ]
}
CODE

Response after successful order cancellation: 200 OK.

Order cancellation

Request

PUT https://delivery.ucs.ru/orders/api/v1/orders/{orderId}/reject

Content-Type: application/json

Example request

{
   "rejectionReasonId": "7ca12506-0c20-4417-88b2-2a5b0d237770",
   "rejectionReasonText": "The guest refused the order"
}
CODE

Example request (if order cancellation reasons are disabled)

{
   "rejectionReasonId": "",
   "rejectionReasonText": ""
}
CODE

Description of parameters

Parameter
Description
rejectionReasonIdstringid reason for order cancellation
rejectionReasonTextstring

Text of the reason for order cancellation

The order number is used as an identifier - orderId.

As additional information, the request may contain restaurantId (establishment ID).

The description of errors is given in a separate article.