Fuel and Energy

Create a fuel purchase transaction.

Create a fuel purchase transaction.

<b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

To use this endpoint, select Write Fuel Purchase under the Fuel & Energy category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>

Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

post/fuel-purchase

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Request body

driverIdstring

Samsara ID of the driver that purchased the fuel.

fuelGrade'Unknown' | 'Regular' | 'Premium'

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

fuelQuantityLitersstring required

The amount of fuel purchased in liters.

iftaFuelType'Unspecified' | 'A55' | 'Biodiesel' | 'CompressedNaturalGas' | 'Diesel' | 'E85' | 'Electricity' | 'Ethanol' | 'Gasohol' | 'Gasoline' | 'Hydrogen' | 'LiquifiedNaturalGas' | 'M85' | 'Methanol' | 'Propane' | 'Other'

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

merchantNamestring

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

sourcestring

The integration provider. For example: Customer, Shell Integration

transactionLocationstring 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).

transactionReferencestring required

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

transactionTimestring 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.

vehicleIdstring

Samsara ID of the vehicle that purchased the fuel.

Example request

{
  "discount": {
    "amount": "640.2",
    "currency": "usd"
  },
  "driverId": "1234",
  "fuelGrade": "Regular",
  "fuelQuantityLiters": "676.8",
  "iftaFuelType": "Biodiesel",
  "merchantName": "Shell",
  "source": "Shell Integration",
  "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",
  "vehicleId": "281474900488527"
}

Response

OK response.

Example response

{
  "data": {
    "uuid": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.