v1

latestOpenAPI 3.1.02026-07-2617501.1 MB

Create a new fuel purchase transaction

post/v1/fuel_purchases

Query parameters

sourcestring

This is the payment source of the current fuel purchase. Allowed values are as follows: <ul><li>EFS_INTEGRATION</li><li>COMDATA_INTEGRATION</li><li>WEX_INTEGRATION</li><li>Manual</li><li>Motive Card</li><li>GIR (GIR W150 Fuel Management System)</li><li>fluidsecure-integration</li><li>fleetcor-integration</li></ul>

Request body

vehicle_idinteger required

Specify the ID of the vehicle for which you want to create a new fuel purchase.

driver_idinteger required

Specify the ID of the driver.

purchased_atstring date required

Specify the time at which the fuel was purchased.

jurisdictionstring required

Specify the jurisdiction from where the fuel was purchased at.

fuel_typestring required

Specify the type of the fuel that was purchased. Allowed values are: ['diesel', 'gasoline', 'propane', 'lng', 'cng', 'ethanol', 'methanol', 'e85', 'm85', 'a55', 'biodiesel', 'other']

total_coststring

Specify the total cost of the fuel purchase.

currencystring

Specify the currency in which the fuel was purchased. Allowed values are USD or CAD.

fuelstring required

Specify the total amount of the fuel purchased.

fuel_unitstring required

Specify the units of the fuel. Allowed values are gal for Gallons, or ltr for Litres.

ref_nostring

Specify the reference number of the fuel purchase.

vendorstring

Enter the name of the fuel vendor.

odometerinteger

Mention the Odometer reading at the time of the fuel purchase.

odometer_unitstring

Specify the units of the odometer at the time of the fuel purchase. Allowed values are: KM for Kilometres, or MI for Miles.

receiptstring[]

Specify the URL of the location where the receipt is uploaded.

locationstring

Specify the location of the fuel purchase.

Response

200

Example response

{
  "fuel_purchase": {
    "id": 699,
    "offline_id": "c4ef3132-3a75-43c7-acc7-9b4aa8c866c9",
    "purchased_at": "2018-06-13T18:43:00Z",
    "jurisdiction": "AL",
    "fuel_type": "diesel",
    "total_cost": 150,
    "currency": "USD",
    "fuel": 12,
    "fuel_unit": "gal",
    "odometer_unit": "mi",
    "location": "location",
    "uploader": {
      "id": 8451,
      "first_name": "George",
      "last_name": "Henry",
      "email": "george.henry+bn@keeptruckin.com",
      "role": "dispatcher"
    },
    "vehicle": {
      "id": 4116,
      "number": "Jason's Vehicle"
    },
    "driver": {
      "id": 2463,
      "first_name": "Paul",
      "last_name": "Walker",
      "username": "paul",
      "email": "demo@keeptruckin.com",
      "status": "active",
      "role": "driver"
    }
  }
}