View the fuel purchases by an ID

Purpose: Use this API to find out the fuel purchases by entering its ID.

📘

NOTE

You must specify the ID of the fuel purchase transactions as a path parameter. Refer to the Path Parameter section for more info.

OAuth Token

require 'uri'
require 'net/http'

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

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.

Language
Credentials
Header
Click Try It! to start a request and see the response here!