Fieldpine Logo Documentation Home  
Library
» Overview
» eLink API

eLink retailmax.elink.stats.today.department

Selects all sales made today and groups them by store and location. Intended to be used to create dynamic reports for users.


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#BinaryDescription
3's'Required. Constant 'retailmax.elink.stats.today.department'
9's'Predicates to select data to return.

Output Fields

FieldNameDescription
DEPT.f110DepidDepartment Id
DEPT.f111DescriptionDepartment Name
DEPT.DATS.f120LocationThe location id for this record
DEPT.DATS.f121QtyThe 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.f122CountNumber of salelines referencing this department
DEPT.DATS.f123TotalPriceTotal revenue, including taxes, for this department/location combination.

Predicates

FieldNameDescription
f100Restricts to specific locations
Examples:
&9=f100,notin,88,89,93
&9=f100,lt,320
f120pidRestricts to certain product id groups.
Examples:
&9=pid,notin,6011,2003
&9=pid,in,1,2,3,4,5,6
f122measurementIncludes 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,2003

Returns:

{
 "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>
   ...