Usage scenario

The client pays for the order on the restaurant's website, which has integration with the payment system:

  1. Using the Delivery API, an order is created on the restaurant's website. In response to the creation request, r_k Delivery returns the order number
  2. If the automatic order taking and order confirmation functions are activated, then within the time set in the corporation, the status of the new order will change to Transferred to the kitchen. After that, the order will go to the cash register.
    If the corresponding functions of automatic taking and confirmation of the order are not activated, the order is first processed by the r_k Delivery call center operator or the r_k Delivery delivery manager, and only then transferred to the cash register.

  3. Using the API method, a request is sent simultaneously to r_keeper and r_k Delivery to pay for the order
  4. After successful payment, the order can be closed using the API method — the order will be closed in both r_keeper and r_k Delivery.

API Methods

Payment for the order

Request


PUT /orders/api/v1/orders/{orderId}/pay
CODE

Example request


PUT https://delivery.ucs.ru/orders/api/v1/orders/102/pay
CODE

Request body example

[
   {
      "code":"16D72549-14D8-4F31-9E2A-0A833D4F5EED",
      "amount":978,
      "paidAt":"2022-04-05T15:12:58.658+03:00",
      "name":""
   }
]
CODE
ParameterTypeDescription

code

string

Currency GUID in r_keeper

amountnumber

Amount to pay

paidAtstringPayment time
namestringCurrency name. Optional parameter.

Sample answers

The response contained an error with the payment settings.

{
    "code": "ERR_EXTERNAL_ERROR_WS",
    "msg": "WS Error: Error Code: WsaOrderError. RkInternal: Checkout [3373] Not enough funds to pay for the order in full.",
    "requestId": "0HMGNRL7KKKDF:00000001",
    "errors": null
}
CODE

Successful payment

{
    "result": {}
}
CODE

Closing the order

Request

PUT /orders/api/v1/orders/{orderId}/complete
CODE

Example request

PUT https://delivery.ucs.ru/orders/api/v1/orders/107/complete
CODE

Sample answers

Attempt to close an unpaid order:

Status code: 500

{
	"code": "rk7_close_order",
	"msg": "RkInternal: Checkout [3071] Unable to close order 1.73, it is not fully paid.",
	"requestId": "f3e391f697a9e2a72fe67c6ba69db771",
	"errors": null
}
CODE

Successful order closure:

Status code: 200 OK

{
	"result": {}
}
CODE