PurposeRequest for the "Statement of Balances" report
Request typeAsynchronous
Supported agent version, shv1(sh4, sh5), v2(sh5)



In sh5, grouping options differ significantly.

Request format

{
   "taskType":"ShRepBillOfBalance",
   "params":{
      "async":{
         "objectId": number,
         "timeout": number
      },
      "reportParams":{
         "reportDate":{
            "date": "YYYY-MM-DD"
         },
         "goodsGroup":{
            "rid": number,
            "withNestedGroups": number
         },
         "category":{
            "mainRid": number,
            "bookeepingRid": number
         },
         "classify":{
            "itemRid": number
         },
         "store":{
            "rid": number,
            "groupRid": number
         },
         "currency":{
            "rid": number
         },
         "constraints":{
            "groupFor": "string",
            "onlyWithMovementForStore": number
         },
         "remnants":{
            "condition": "string",
            "value": "string"
         }
      }
   }
}


Parameter

Type

Mandatory

Description

taskTypestring+Task type
async

Asynchronous method
timeoutint-Agent response timeout in seconds, default is 120 seconds
objectIdint+Restaurant code in the licensing system
reportParams


reportDate
+
datestring+The date for which the report will be created
goodsGroup


ridint
rid of the item group
withNestedGroupsint
include data on nested groups in the report (0 - no, 1 - yes)
category


mainRidint_or_null
rid of main category
bookeepingRidint_or_null
rid of accounting category
classify


itemRidint_or_null
rid of item classifier values
store


ridint_or_null
rid of the warehouse. If this attribute is present, then the STORE.group_rid attribute should not be present.
groupRidint_or_null
rid of warehouse groups. If this attribute is present, then the STORE.rid attribute should not be present.
store
+
ridint+currencies rid 
constraints


groupForenum
By what value to group the report. The attribute can take the values: - None - do not group (used if the attribute is missing); - ForStores - group by warehouses; - ForGoodGroups - group by item groups;
onlyWithMovementForStoreint_or_null
display only products for which there are warehouse/warehouses transactions (0 - no, 1 - yes)
remnants

Condition for the presence/absence of residues
conditionenum
Condition, can take the values: - Less - less; - NotMore - no more; - Equal - equal; - NotLess - no less; - More - more; - NotEqual - not equal;
valueenum
The attribute can take the values: - Zero - zero; - MinimumStock - min. stock; - MaximumStock - max. stock; If REMNANTS.condition is not filled, then the value of the REMNANTS.value attribute is ignored.

Response format

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

Asynchronous response format

// Successful response
{
   "taskResponse":{
      "groups":[
         {
            "name": "string",
            "id": number
         }
      ],
      "lines":[
         {
            "rid": number,
            "goodName": "string",
            "attributeText": "string",
            "attributeNumber": "string",
            "mUnitsRid": number,
            "mUnitsName": "string",
            "quantity": number,
            "sumWithoutTax": number,
            "sumNds": number,
            "sumNsp": number,
            "minReserve": number,
            "maxReserve": number,
            "groupId": "int_or_null"
         }
      ]
   },
   "responseCommon":{
      "taskGuid": "string",
      "taskType": "ShRepBillOfBalance",
      "objectId": number
   }
}
   
// Response with error
{
  "responseCommon": {
    "taskGuid": "string",
    "taskType": "ShRepBillOfBalance",
    "objectId": number
  },
  "error": {
    "wsError": {
      "code": "string",
      "desc": "string"
    },
    "agentError": {
      "code": "string",
      "desc": "string"
    }
  }
}