---
title: "Create a fuel purchase transaction."
method: POST
path: "/fuel-purchase"
tags: ["Fuel and Energy"]
---

# Create a fuel purchase transaction.

`POST /fuel-purchase`

## Request

- Base URL: `https://api.samsara.com`
- URL: `https://api.samsara.com/fuel-purchase`
- Auth: HTTP bearer

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.

## Request body

- FuelPurchasePostFuelPurchaseRequestBody: Request payload for creating a new fuel purchase transaction.
  - `discount` PostFuelPurchaseRequestBodyDiscountRequestBody: The amount of money discounted from the gross purchase price of the fuel transaction in the currency of the country where the transaction occurred.
    - `amount` string, required: The money amount.
    - `currency` 'usd' | 'gbp' | 'cad' | 'eur' | 'chf' | 'mxn', required: The currency of money. This is a 3-letter ISO 4217 currency code. Valid values: `usd`, `gbp`, `cad`, `eur`, `chf`, `mxn`
  - `driverId` string: Samsara ID of the driver that purchased the fuel.
  - `fuelGrade` 'Unknown' | 'Regular' | 'Premium': The grade of the fuel purchased. Valid values: `Unknown`, `Regular`, `Premium`
  - `fuelQuantityLiters` string, 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`
  - `merchantName` string: Brand name of the fuel station the fuel was purchased at. For example: Shell, Bp, Exxon.
  - `source` string: The integration provider. For example: Customer, Shell Integration
  - `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).
  - `transactionPrice` PostFuelPurchaseRequestBodyPriceRequestBody, required: The price of the fuel transaction in the currency of the country where the transaction occurred.
    - `amount` string, required: The money amount.
    - `currency` 'usd' | 'gbp' | 'cad' | 'eur' | 'chf' | 'mxn', required: The currency of money. This is a 3-letter ISO 4217 currency code. Valid values: `usd`, `gbp`, `cad`, `eur`, `chf`, `mxn`
  - `transactionReference` string, required: The fuel transaction reference. This is the transaction identifier. For instance, this can be the Serial Number on the invoice.
  - `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.
  - `vehicleId` string: Samsara ID of the vehicle that purchased the fuel.

## Response `200`

OK response.

- FuelPurchasePostFuelPurchaseResponseBody
  - `data` PostFuelPurchaseResponseBodyResponseBody, required: Response after successfully adding a Fuel Purchase transaction
    - `uuid` string, required: Universally unique identifier for the fuel purchase.

## Other responses

- `401`: Unauthorized response.
- `404`: Not Found response.
- `405`: Method Not Allowed response.
- `413`: Content Too Large response.
- `429`: Too Many Requests response.
- `500`: Internal Server Error response.
- `501`: Not Implemented response.
- `502`: Bad Gateway response.
- `503`: Service Unavailable response.
- `504`: Gateway Timeout response.
- `default`: Bad Request response.

---

[API](https://skmtc.dev/samsara/apis/samsara-api.md) - [All operations](https://skmtc.dev/samsara/apis/samsara-api/llms.txt) - [OpenAPI document](https://skmtc.dev/samsara/apis/samsara-api/revisions/a9e35d4999be?raw)
