Fetch the fuel purchases of your company

Purpose: Use this API to view all the fuel purchases done by your drivers or fleet admins in your company. This allows you to view and monitor the fuel purchases and at the same time prepare necessary data for tax filings.

📘

NOTE

You can use the below query parameters to filter out the response. Refer to the Query Parameters section for more details.

OAuth Token

require 'uri'
require 'net/http'

url = URI('https://api.gomotive.com/v1/fuel_purchases')

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"

response = http.request(request)
puts response.read_body

Response Parameters

id

  • Type: Integer
  • Description: The unique identifier for the fuel purchase.

offline_id

  • Type: String
  • Description: The offline identifier associated with the fuel purchase.

purchased_at

  • Type: String (DateTime)
  • Description: The date and time when the fuel was purchased.

jurisdiction

  • Type: String
  • Description: The jurisdiction where the fuel purchase occurred (e.g., state or region code).

fuel_type

  • Type: String
  • Description: The type of fuel purchased (e.g., diesel).

ref_no

  • Type: String
  • Description: The reference number for the fuel purchase.

vendor

  • Type: String
  • Description: The vendor from whom the fuel was purchased.

total_cost

  • Type: Integer
  • Description: The total cost of the fuel purchase.

currency

  • Type: String
  • Description: The currency used for the purchase (e.g., USD).

fuel

  • Type: Integer
  • Description: The amount of fuel purchased.

fuel_unit

  • Type: String
  • Description: The unit of measurement for the fuel (e.g., gal).

odometer

  • Type: Integer
  • Description: The odometer reading at the time of fuel purchase.

odometer_unit

  • Type: String
  • Description: The unit of measurement for the odometer (e.g., mi).

receipt_upload_url

  • Type: String
  • Description: The URL where the receipt can be downloaded.

receipt_filename

  • Type: String
  • Description: The filename of the receipt.

uploader

  • Type: Object
  • Description: Information about the person who uploaded the fuel purchase.
    • id: Integer — The unique identifier of the uploader.
    • first_name: String — The first name of the uploader.
    • last_name: String — The last name of the uploader.
    • email: String — The email address of the uploader.
    • role: String — The role of the uploader.
    • deactivated_at: String or Null — The date and time when the uploader was deactivated.

vehicle

  • Type: Object
  • Description: Information about the vehicle associated with the fuel purchase.
    • id: Integer — The unique identifier of the vehicle.
    • number: String — The vehicle number.
    • year: String — The year of the vehicle.
    • make: String — The make of the vehicle.
    • model: String — The model of the vehicle.
    • vin: String — The Vehicle Identification Number.
    • metric_units: Boolean — Indicates if the vehicle uses metric units.

driver

  • Type: Object
  • Description: Information about the driver associated with the fuel purchase.
    • id: Integer — The unique identifier of the driver.
    • first_name: String — The first name of the driver.
    • last_name: String — The last name of the driver.
    • username: String — The username of the driver.
    • email: String — The email address of the driver.
    • driver_company_id: String or Null — The ID of the driver's company.
    • status: String — The status of the driver (e.g., active).
    • role: String — The role of the driver.

Query Params
date

Specify the start date of the fuel purchases. Default: TODAY - 7 DAYS AGO

date

Specify the end date of the fuel purchases. Default: TODAY

string

Specify the type of fuel for which you want to check the purchases. Allowed values are: [“diesel”, “gasoline”, “propane”, “lng”, “cng”, “ethanol”, “methanol”, “e85”, “m85”, “a55”, “biodiesel”, “other”]

int32

Specify the ID of the vehicle for which you want to check the fuel purchases.

string

Specify the type of the vehicle for which you want to check the fuel purchases. Allowed values are: ["ifta", "all"]

string

Specify the jurisdictions under which you want to check the fuel purchases of your company.

string

Upload source of fuel purchase (manual, efs-integration etc.)

int32
Defaults to 25

Denotes the number of records per page.

int32
Defaults to 1

The current page number

Response

Language
Credentials
Header
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json