Description

Purpose in WSA v1

Pay for the order using Objectid+OrderGuid keys on a prepayment basis. If the transferred amount of money is more than required to pay for the order, the payment is not accepted. An error returns

Purpose in WSA v2Pay for the order using Objectid+OrderGuid keys on a payment basis. If the transferred amount of money is more or less than required to pay for the order, the payment is not accepted. An error returns
Request typeAsynchronous
Supported agent versionv1, v2

Nuances

If the payment is 100% discounted, then it is required to transfer this payment without a single cent

Request format


JSON

{
  "taskType": "PayOrder",
  "params": {
     "async": {
       "objectId": number,
       "timeout": number
     },
       "orderGuid": "guid",
       "isFullOrderRequired": bool,
       "payments": [{
            "amount": number,
            "currency": "guid"
         }
       ]
    }
  }



Description of parameters

Parameter

Type

Mandatory

Description

taskType

Task type
async

Asynchronous method
timeoutint-Agent response timeout in seconds, default is 120 seconds
objectIdint+Restaurant code in the licensing system
isFullOrderRequiredbool-If true - the entire order is returned
orderGuidguid+Guid of the order for which payment is required
paymentsarray+payment data array
amountstring+value of the amount to be paid. The separator between the integer and fractional parts of the amount must be a dot.
currencystring+currency guid

Response format


JSON

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

Parameter

Type

Description

taskGuidguidThe unique code of this task is used when receiving the task through the queue.
taskTypestring enumTask type
objectIdintRestaurant code in the licensing system
error
Restaurant code in the licensing system
- wsError
Errors received from the WhiteServer service
– codestringError code
– descstringError description

Asynchronous response format


JSON

// Successful response (means that prepayment was successful!), detailed order information not requested
// Successful response (means that prepayment was successful!), detailed order information not requested
{
  "taskResponse": {
     "order": {      
        "price": {
           "total": number,
           "summToPay": number
        }
     }
  },
  "responseCommon": {
    "taskGuid": "string",
    "taskType": "PayOrder",
    "objectId": number
  }
}
  
// Successful response (means that prepayment was successful!), the entire order has been requested
{
  "taskResponse": {
     "order": {
        "originalOrderId": "string",
        "createdAt": "2008-10-17T00:00:00",
        "status": {
           "value": "string"
        },
        "delivery": {
           "expectedTime": "2008-10-17T00:00:00"
        },
        "products": [
           { // simple variant
             "ingredients": [
                 {
                   "id": "string",
                   "name": "string",
                   "quantity": "number"
                 }
             ],
             "voidingReason":"string",
             "id": "string",
             "name": "string",
             "price": "string",
             "quantity": number
          }
        ],
        "comment": "string",
        "personsQuantity": number
        },
        "price": {
           "total": number,
           "summToPay": number
        }
     }
  },
  "responseCommon": {
    "taskGuid": "string",
    "taskType": "PayOrder",
    "objectId": number
  }
}
  
// Response with error
{
  "responseCommon": {
    "taskGuid": "string",
    "taskType": "PayOrder",
    "objectId": number
  },
  "error": {
    "wsError": {
      "code": "string",
      "desc": "string"
    },
    "agentError": {
      "code": "string",
      "desc": "string"
    }
  }
}