Skip to main content
POST
/
fuel-purchase
Create a fuel purchase transaction.
curl --request POST \
  --url https://api.samsara.com/fuel-purchase \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fuelQuantityLiters": "676.8",
  "transactionLocation": "350 Rhode Island St, San Francisco, CA 94103",
  "transactionPrice": {
    "amount": "640.2",
    "currency": "usd"
  },
  "transactionReference": "5454534",
  "transactionTime": "2022-07-13T14:20:50.52-07:00",
  "driverId": "1234",
  "fuelGrade": "Regular",
  "iftaFuelType": "Biodiesel",
  "merchantName": "Shell",
  "source": "Shell Integration",
  "vehicleId": "281474900488527"
}
'
{
  "data": {
    "uuid": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7"
  }
}

Documentation Index

Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request payload for creating a new fuel purchase transaction.

fuelQuantityLiters
string
required

The amount of fuel purchased in liters.

Example:

"676.8"

transactionLocation
string
required

The full street address for the location of the fuel transaction, as it might be recognized by Google Maps. Ideal entries should be in accordance with the format used by the national postal service of the country concerned (example: 1 De Haro St, San Francisco, CA 94107, United States). Alternatively, exact latitude/longitude can be provided (example: 40.748441, -73.985664).

Example:

"350 Rhode Island St, San Francisco, CA 94103"

transactionPrice
object
required

The price of the fuel transaction in the currency of the country where the transaction occurred.

transactionReference
string
required

The fuel transaction reference. This is the transaction identifier. For instance, this can be the Serial Number on the invoice.

Required string length: 1 - 32
Pattern: ^[a-zA-Z0-9\-]+$
Example:

"5454534"

transactionTime
string
required

The time of the fuel transaction in RFC 3339 format. Timezone must be specified. For example, 2022-07-13T14:20:50.52-07:00 is a time in Pacific Daylight Time.

Example:

"2022-07-13T14:20:50.52-07:00"

discount
object

The amount of money discounted from the gross purchase price of the fuel transaction in the currency of the country where the transaction occurred.

driverId
string

Samsara ID of the driver that purchased the fuel.

Example:

"1234"

fuelGrade
enum<string>

The grade of the fuel purchased. Valid values: Unknown, Regular, Premium

Available options:
Unknown,
Regular,
Premium
Example:

"Regular"

iftaFuelType
enum<string>

The type of fuel purchased supported by IFTA. Valid values: Unspecified, A55, Biodiesel, CompressedNaturalGas, Diesel, E85, Electricity, Ethanol, Gasohol, Gasoline, Hydrogen, LiquifiedNaturalGas, M85, Methanol, Propane, Other

Available options:
Unspecified,
A55,
Biodiesel,
CompressedNaturalGas,
Diesel,
E85,
Electricity,
Ethanol,
Gasohol,
Gasoline,
Hydrogen,
LiquifiedNaturalGas,
M85,
Methanol,
Propane,
Other
Example:

"Biodiesel"

merchantName
string

Brand name of the fuel station the fuel was purchased at. For example: Shell, Bp, Exxon.

Example:

"Shell"

source
string

The integration provider. For example: Customer, Shell Integration

Example:

"Shell Integration"

vehicleId
string

Samsara ID of the vehicle that purchased the fuel.

Example:

"281474900488527"

Response

OK response.

data
object
required

Response after successfully adding a Fuel Purchase transaction