User Manual
Version 7.6
×

Refueling with fuel cards

 
Example:
https://<address>/api/api.php?cmd=fuel
 
Parameters:
cmd : fuel
imei : object id
start : start time of sampling
stop : stop time of sampling
 
Answer:
"cards": [
{
"id": 601, - card id in the PILOT system
"card_num": "257464691", - card number
"balance": "0", - fuel card balance
"type_name": "Highway", - fuel card type
"transactions": {
"1404206488": { - key - transaction time in unixtime
"operation": "Purchase", - operation type
"ts": 1404206488, - transaction time in unixtime
"azs": "Saratovnefteprodukt(new)", - gas station name
"liters": "20.0000",
"sum": "636.00", - amount with discount
"sumg": "658.26", - amount without discount
"fuel": "Diesel",
"price": "31.80", - discounted price
"priceg": "32.91", - price without discount
"saldo": "0.00" - saldo card to start of transaction
},
 
An array of the refills by sensor
 "fillings": {
       "1404205495": {
           "ts": 1404205495,
           "type_id": 1, (1-filling 2-drain-off)
           "liters": "23.2862",
           "lat": "51.9899",
           "lon": "47.8203",
           "place": "RU, Saratov region, Balakovo" - address
           "fuel_start":"223.68" - fuel in the tank at the beginning of event
       },
An array of fuel remains on the begining and the end of the day (a day are considered based on the time zone configured for the vehicles in PILOT)
 
 fuel: {
 "1404072000": { // key - value start of the day
 "ts": 1404072000,
 "te": 1404158400,
 "start": "4.76", //the ammount of fuel in liters at the start of the day
 "stop": "18.93" // the ammount of fuel in liters at the end of the day
 },
Fuel level at the beginning and end:
 "instant fuel":
 {"start":1150.3200000000002,
 "stop":1019.37}}
 
Request:
https://<address>//api/api.php?cmd=fuel&imei=863191018863&start=1690714408&stop=1690898408
 
Answer:
{
  "code": 0,
  "msg": "OK",
  "fillings": {
    "1690716642": {
      "ts": 1690716642,
      "type_id": 1,
      "liters": "600",
      "lat": "55.6222",
      "lon": "37.1352",
      "place": "0:552:87;41:552:83;101:552:85;143:552:88;206:552:25;222:552:0;883:1152:0;",
      "fuel_start": "552"
    },
    "1690716669": {
      "ts": 1690716669,
      "type_id": 2,
      "liters": "24",
      "lat": "55.622",
      "lon": "37.1338",
      "place": "0:1152:0;27:1150.5:0;115:1140:86;176:1140:73;217:1140:30;263:1140:64;326:1137.6:69;387:1128:34;430:1128:55;473:1128:5;732:1116:0;",
      "fuel_start": "1152"
    }
  },
  "fuel": {
    "1690664400": {
      "ts": 1690664400,
      "te": 1690750800,
      "start": "708",
      "stop": "1104"
    },
    "1690750800": {
      "ts": 1690750800,
      "te": 1690837200,
      "start": "1104",
      "stop": "900"
    },
    "1690837200": {
      "ts": 1690837200,
      "te": 1690923600,
      "start": "900",
      "stop": "768"
    }
  },
  "instantfuel": {
    "start": 576,
    "stop": 816
  },
  "fconsumption_sensor": {
    "consumption": 336      //  fuel consumption data.
  }
}