Using REST API to Access Fuel Transaction Data
This post will guide you to integrate and use our REST API to access and filter fuel transaction data. This API can be used to list fuel control system devices and generate reports in your custom dashboards or software solutions.
Prerequisites
Before making API calls, ensure you have the following:
- A valid API key (format:
APK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) - The base URL of the API (
https://api.gatex.ai/fcs) - An HTTP client such as Postman, CURL, or your preferred programming language
Step 1: Validate Your API Key
To confirm that your API key is valid and the API is accessible, make a simple GET request to the validation endpoint:
GET https://api.gatex.ai/fcs/API?key=APK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
If the key is valid, you will receive a confirmation response.
Step 2: List Available Fuel Control Devices
Once the API key is validated, you can fetch the list of all fuel control devices:
GET https://api.gatex.ai/fcs/Devices?key=APK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This will return a list of devices with their respective IDs, which are required for querying transactions.
Step 3: Retrieve Fuel Transactions
To get the fuel transaction records for specific devices within a date range, use the following endpoint:
Example curl Command:
GET https://api.gatex.ai/fcs/FCS/Transactions?key=APK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&deviceId=301,303&start=2025-06-01%2009:46:31&end=2025-06-09%2012:46:31&reportId=1
Query Parameters:
key– your API keydeviceId– one or more comma-separated device IDsstart– start of the date/time range (format:YYYY-MM-DD HH:MM:SS)end– end of the date/time rangereportId– filter type (explained below)
The reportId parameter determines how transactions are filtered:
- 1 → Filter by Transaction DateTime
- 2 → Filter by Server Timestamp
- 3 → Filter by Update Timestamp
- 4 → Filter by Group
The API returns a JSON array of transactions like the following:
[
{
"Id": 7828691,
"SequenceId": 16205,
"DeviceId": 301,
"Meter": "Dispenser 01",
"SecondaryTag": "200683223078A440",
"Category": null,
"Operator": "Operator",
"Asset": "22020",
"AccumulatorType": "O",
"Sitecode": null,
"Project": null,
"PlateNo": "22022",
"Master": null,
"Accumulator": 23400,
"Volume": 6.54,
"Allowance": 0,
"Type": "Hybrid",
"StartTime": "2025-03-01T10:02:25",
"EndTime": "2025-03-01T10:03:19",
"Status": "E",
"ServerTimestamp": "2025-03-01T10:03:19",
"UpdateTimestamp": null
}
}
Transaction JSON Structure
Id:int => Unique transaction ID,
SequenceId:int => Internal device transaction ID,
DeviceId:int => The unique device identifier,
Meter:string => Name of the device,
SecondaryTag:string => Asset RFID String,
Category:string => Reserved,
Operator:string => Name of the Operator using the device,
Asset:string => Asset code,
AccumulatorType:string => O is for Odometer nd E = is for engine hours,
Sitecode:string => Area or Country code,
Project:string Project or Contract Number,
PlateNo:string Asset plate no,
Master:string => Fuel Issuer’s master tag – will be null if Nozzle Reader is used ,
Accumulator:int => Odometer or Engine Hours value,
Volume:float => Dispensed fuel volume,
Allowance:float => Used fuel allowance,
Type:string => Asset Type,
StartTime:string => YYYY-MM-DDTHH:MM:SS UTC DateTime for start of the transaction,
EndTime:string => YYYY-MM-DDTHH:MM:SS UTC DateTime for end of the transaction,
Status:string => Status of the transaction,
ServerTimestamp:string => The insert timestamp of the transaction on the server,
UpdateTimestamp:string => The latest change timestamp of this transaction in the database
