Purpose

Getting a list of Receiving Reports for a period

Request typeAsynchronous/synchronous
Supported agent version, SHv2 — SH5
PluggetSystemTypeStoreHouse

Request format


JSON

{
   "taskType":"ShGetReceivingReports",
   "params":{
    "async": {
      "objectId": number,
       "timeout": number
    },
    "sync": {
      "objectId": number,
       "timeout": number
    },
      "startDate": "YYYY-MM-DD",
      "endDate": "YYYY-MM-DD"
   }
}

Parameter

Type

Mandatory

Description

taskTypestringyesTask type
async

Asynchronous method call: either synchronous or asynchronous
sync

Synchronous method call: either synchronous or asynchronous
timeoutintnoAgent response time in seconds. Default is 120 seconds
objectIdintyesRestaurant code in the licensing system
startDatedateyesFirst day of the requested period
endDatedateyesLast day of the requested period

Response format


{
   "responseCommon":{
      "taskGuid": "guid",
      "taskType": "ShGetReceivingReports",
      "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
Error container

Asynchronous response format

// Successful response
{
    "taskResponse": {
        "reports": [
            {
                "rid": "rid",
                "date": "YYYY-MM-DD",
                "corr": "rid",
                "store": "rid",
                "active": "0,1",
                "items": [
                    {
                        "rid": "rid",
                        "quantity": "number",
                        "mu": "rid",
                        "sum": "number",
                        "vatSum": "number",
                        "vatrate": "number"
                    }
                ]
            }
        ]
    },
    "responseCommon": {
        "taskGuid": "string",
        "taskType": "ShGetReceivingReports",
        "objectId": "number"
    }
}
    
    
// Error response from server
{
    "responseCommon": {
        "taskGuid": "string",
        "taskType": "ShGetReceivingReports",
        "objectId": "number"
    },
    "error": {
        "wsError": {
            "code": "string",
            "desc": "string"
        }
    }
}
  
// Error response from agent
{
    "responseCommon": {
        "taskGuid": "string",
        "taskType": "ShGetReceivingReports",
        "objectId": "number"
    },
    "error": {
        "agentError": {
            "code": "string",
            "desc": "string"
        }
    }
}

Parameter

Type

Mandatory

Description

reports
yesReceiving Reports
ridintyesrid of the report
datestringyesDate of the report
corrintyesrid of supplier
storeintyesrid of warehouse
activeint
If the report is active: 0 — no, 1 — yes
itemsarray

ridint
rid of the item
quantitydecimal
Quantity, fractional values ​​supported
muint
rid of the unit
sumint
Amount without VAT * 100
vatSumintnoVAT amount * 100
vatRateintnoVAT rate * 100
SH5 should already have this rate set as standard