This API behaves slightly different under high load to many others. If the current statistics have expired and are being recalculated, callers can receive the older slightly stale information rather than waiting for the recalculation to occur.
Internal calculations for this API typically cache results for between 30 to 90 seconds during the day and around 400 seconds overnight.
Input Arguments
Arg# | Binary | Description |
3 | 's' | Required. Constant 'retailmax.elink.stats.today.department' |
9 | 's' | Predicates to select data to return. |
Output Fields
Field | Name | Description |
DEPT.f110 | Depid | Department Id |
DEPT.f111 | Description | Department Name |
DEPT.DATS.f120 | Location | The location id for this record |
DEPT.DATS.f121 | Qty | The total number of units sold. This is the sum of Quantity from items sold. If a department contains a mixture of different units of measure this figure will be meaningless. It is not possible to add 2 units and 355gram. If you need to use the Qty figure and have differing UOM you will need to make multiple calls specifying the UOM individually in each call |
DEPT.DATS.f122 | Count | Number of salelines referencing this department |
DEPT.DATS.f123 | TotalPrice | Total revenue, including taxes, for this department/location combination. |
Predicates
Field | Name | Description |
f100 | Restricts to specific locations
Examples: &9=f100,notin,88,89,93 &9=f100,lt,320 | |
f120 | pid | Restricts to certain product id groups.
Examples: &9=pid,notin,6011,2003 &9=pid,in,1,2,3,4,5,6 |
f122 | measurement | Includes or excludes specific Units of measure. Explicitly specifying "measurement=1"
means to select items encoded as measurement 1 (units) or with unspecified unit of measure.
Examples: &9=measurement=1 &9=f122,=,20 |
Examples
Return a JSON response but exclude product ids 6001 and 2003 from the calculations
/gnap/J/buck?3=retailmax.elink.stats.today.department&9=pid,notin,6011,2003Returns:
{ "RootType":"ARAY", "DEPT":[ { "Depid":20, "Description":"Health & Wellbeing", "DATS":[ { "Location":4, "Qty":1, "Count":1, "TotalPrice":20.700000 } ] }, { "Depid":100, "Description":"Lunchbar", "DATS":[ { "Location":4, "Qty":1, "Count":1, "TotalPrice":3.680000 }, { "Location":18, "Qty":3, "Count":2, "TotalPrice":14.250000 } ] } ] }
Return an XML response for unit based products only
/gnap/M/buck?3=retailmax.elink.stats.today.department&9=measurement,=,1<ARAY> <DEPT> <Depid>7</Depid> <Description>Imported</Description> <DATS> <Location>204</Location> <Qty>11</Qty> <Count>11</Count> <TotalPrice>2230.700000</TotalPrice> </DATS> </DEPT> ...