Purpose

Completes the order if the prepayment made is equal to the order amount.

After executing this command, the paid order becomes unavailable for editing.

Request typeasynchronous/synchronous
Supported agent versionv2
PluggetSystemTypeRKMid

Request format


JSON

{
  "taskType": "CompleteOrder",
  "params": {
    "async": {
      "objectId": number,
       "timeout": number
    },
    "sync": {
      "objectId": number,
       "timeout": number
    },
   "orderGuid": "guid"
  }
}

Parameter

Type

Mandatory

Description

taskTypestringyesTask type
-async

Asynchronous method call: either synchronous or asynchronous
-sync

Synchronous method call: either synchronous or asynchronous
--timeoutintnoAgent response timeout in seconds, default is 120 seconds
--objectIdintyesRestaurant code in the licensing system
-orderGuidguidyesGuid of the order for which payment is required

Synchronous response format

JSON

{
   "responseCommon":{
      "taskGuid":"guid",
      "taskType":"CompleteOrder",
      "objectId": number
   },
   "error":{
      "wsError":{
         "code":"string",
         "desc":"string"
      }
   }
}

Parameter

Type

Description

-taskGuidguidUnique code of this task, used when receiving a task through the queue
-taskTypestring enumTask type
-objectIdintRestaurant code in the licensing system
error
Error container, for more details see the article Error Description

Asynchronous response format

// A successful response means that the paid order has been verified and completed; it cannot be changed now.
{
  "taskResponse": {
     "order": {
        "price": {
           "total": number,
        }
     }
  },
  "responseCommon": {
    "taskGuid": "string",
    "taskType": "CompleteOrder",
    "objectId": number
  }
}
  
// Response with an error
{
  "responseCommon": {
    "taskGuid": "string",
    "taskType": "CompleteOrder",
    "objectId": number
  },
  "error": {
    "wsError": {
      "code": "string",
      "desc": "string"
    },
    "agentError": {
      "code": "string",
      "desc": "string"
    }
  }
}

Parameter

Parameter type

Mandatory

Description

order
yes
price.totalmoneyyesTotal cost of the order
errorstring enum
Error container, for more details see the article Error Description
-wsErrorstring enum
Whiteserver Error
--codestring
Error code
--descstring
Error description
-agentErrorstring enum
Error from agent
--codestring

In addition to the existing ones, the following error codes will appear (in numbers in the old agent):

value

description

OrderIsLockedthe order is blocked
OrderIsClosedthe order is closed

PaymentIsMoreThanTotalPrice

payment transferred is more than the order value
--descstring
Error description