---
title: "Update a fuel purchase"
method: PUT
path: "/v1/fuel_purchases/{id}"
---

# Update a fuel purchase

`PUT /v1/fuel_purchases/{id}`

## Request

- Base URL: `https://api.gomotive.com`
- URL: `https://api.gomotive.com/v1/fuel_purchases/{id}`
- Auth: API key in header `x-api-key`

## Path parameters

- `id` integer, required

## Query parameters

- `source` string

## Request body

- object
  - `vehicle_id` string, required: Specify the ID of the vehicle for which you are updating the fuel purchase.
  - `driver_id` string, required: Specify the ID of the driver for whom you are updating this fuel purchase.
  - `purchased_at` string, date: Time of fuel purchase
  - `jurisdiction` string: Jurisdiction in which fuel was purchased
  - `fuel_type` string: Type of fuel. Valid values are ['diesel', 'gasoline', 'propane', 'lng', 'cng', 'ethanol', 'methanol', 'e85', 'm85', 'a55', 'biodiesel', 'other']
  - `total_cost` string: Specify the total cost of the fuel purchase.
  - `currency` string: Specify the currency in which the fuel was purchased. Allowed values are USD or CAD.
  - `fuel` string: Specify the total amount of the fuel purchased.
  - `fuel_unit` string: Specify the units of the fuel. Allowed values are gal for Gallons, or ltr for Litres.
  - `ref_no` string: Specify the reference number of the fuel purchase.
  - `vendor` string: Enter the name of the fuel vendor.
  - `odometer` integer: Odometer reading at time of fuel purchase
  - `odometer_unit` string: Specify the units of the odometer at the time of the fuel purchase. Allowed values are: KM for Kilometres, or MI for Miles.
  - `receipt` string[]: Specify the URL of the location where the receipt is uploaded.
  - `location` string: Specify the location of the fuel purchase.

## Response `200`

200

- object
  - `fuel_purchase` object
    - `id` integer
    - `offline_id` string
    - `purchased_at` string
    - `jurisdiction` string
    - `fuel_type` string
    - `ref_no` unknown
    - `vendor` unknown
    - `total_cost` integer
    - `currency` string
    - `fuel` integer
    - `fuel_unit` string
    - `odometer` unknown
    - `odometer_unit` string
    - `receipt_upload_url` unknown
    - `receipt_filename` unknown
    - `location` string
    - `uploader` object
      - `id` integer
      - `first_name` string
      - `last_name` string
      - `email` string
      - `role` string
      - `deactivated_at` unknown
    - `vehicle` object
      - `id` integer
      - `number` string
      - `year` string
      - `make` string
      - `model` string
      - `vin` string
      - `metric_units` boolean
    - `driver` object
      - `id` integer
      - `first_name` string
      - `last_name` string
      - `username` string
      - `email` string
      - `driver_company_id` unknown
      - `status` string
      - `role` string

## Other responses

- `400`: 400
- `404`: 404

---

[API](https://skmtc.dev/gomotive/apis/motive.md) - [All operations](https://skmtc.dev/gomotive/apis/motive/llms.txt) - [OpenAPI document](https://skmtc.dev/gomotive/apis/motive/revisions/c71780e497f5?raw)
