# Fuel Price

Last updated:

<!-- -->

October 18, 2026

<!-- -->

\| 5 minutes read

<br />

<br />

The **Fuel Price Rest API** allows you to manage fuel price records within the Fleet Management system. You can create, retrieve, update, and delete fuel price data. This Rest API supports filtering, sorting, and pagination to help manage large datasets efficiently.

Currency Note

No specific currency is used for the fuel price to keep the method as generic as possible. However, it is recommended that users apply the same currency consistently to ensure route cost calculations reflect reality as closely as possible.

### Fuel Price Object Fields[​](#fuel-price-object-fields "Direct link to Fuel Price Object Fields")

| Field               | Type    | Description                                                       |
| ------------------- | ------- | ----------------------------------------------------------------- |
| `creationTimestamp` | Integer | Timestamp when the fuel prices were created.                      |
| `dieselStandard`    | Float   | Price per unit of standard diesel fuel. Default: `1.09`.          |
| `dieselPremium`     | Float   | Price per unit of premium diesel fuel. Default: `1.17`.           |
| `gasolineStandard`  | Float   | Price per unit of standard gasoline. Default: `1.07`.             |
| `gasolinePremium`   | Float   | Price per unit of premium gasoline. Default: `1.19`.              |
| `electric`          | Float   | Price per unit of electric charging (e.g., kWh). Default: `0.10`. |
| `lpg`               | Float   | Price per unit of LPG fuel. Default: `0.55`.                      |

***

## Endpoints[​](#endpoints "Direct link to Endpoints")

### 1. Create Fuel Price[​](#1-create-fuel-price "Direct link to 1. Create Fuel Price")

**Description:** Adds a new fuel price record to the database.

* **Base URL:** `https://api.magiclane.net/api/v1`

* **Endpoint:** `POST /fleetmanagement/fuel-prices`

* **Headers:**

  * `Authorization: YOUR_API_KEY`
  * `Content-Type: application/json`

* **Returned error codes:**

| Error Code                  | Description                               |
| --------------------------- | ----------------------------------------- |
| `200 Successful`            | Successful operation.                     |
| `400 Bad Request`           | Invalid input or missing required fields. |
| `401 Unauthorized`          | API key is missing or invalid.            |
| `405 Method Not Allowed`    | Incorrect method type.                    |
| `500 Internal Server Error` | Database error occurred.                  |

Note

If the operation is successful, the `Fuel Price` object will have its `creationTimestamp` field populated. If the operation fails, an error code is returned, which can be interpreted as described in the **Returned error codes** section.

#### Example:[​](#example "Direct link to Example:")

* **Request Body:**

- Schema View
- JSON Example
- JSON View

* `dieselStandard`(

  <!-- -->

  float

  <!-- -->

  )

  Price per unit of standard diesel fuel. Default: 1.09.

* `dieselPremium`(

  <!-- -->

  float

  <!-- -->

  )

  Price per unit of premium diesel fuel. Default: 1.17.

* `gasolineStandard`(

  <!-- -->

  float

  <!-- -->

  )

  Price per unit of standard gasoline. Default: 1.07.

* `gasolinePremium`(

  <!-- -->

  float

  <!-- -->

  )

  Price per unit of premium gasoline. Default: 1.19.

* `electric`(

  <!-- -->

  float

  <!-- -->

  )

  Price per unit of electric charging (e.g., kWh). Default: 0.10.

* `lpg`(

  <!-- -->

  float

  <!-- -->

  )

  Price per unit of LPG fuel. Default: 0.55.

```json
{
  "dieselStandard": 1.5,
  "dieselPremium": 2,
  "gasolineStandard": 1.51,
  "gasolinePremium": 1.48,
  "electric": 0.18,
  "lpg": 0.6
}

```

```json
{
  "dieselStandard": 0,
  "dieselPremium": 0,
  "gasolineStandard": 0,
  "gasolinePremium": 0,
  "electric": 0,
  "lpg": 0
}

```

* **Response Body:** (error code `200`)

- Schema View
- JSON Example
- JSON View

* `creationTimestamp`(

  <!-- -->

  integer

  <!-- -->

  )

  Timestamp when the fuel prices were created.

* `dieselStandard`(

  <!-- -->

  float

  <!-- -->

  )

  Price per unit of standard diesel fuel. Default: 1.09.

* `dieselPremium`(

  <!-- -->

  float

  <!-- -->

  )

  Price per unit of premium diesel fuel. Default: 1.17.

* `gasolineStandard`(

  <!-- -->

  float

  <!-- -->

  )

  Price per unit of standard gasoline. Default: 1.07.

* `gasolinePremium`(

  <!-- -->

  float

  <!-- -->

  )

  Price per unit of premium gasoline. Default: 1.19.

* `electric`(

  <!-- -->

  float

  <!-- -->

  )

  Price per unit of electric charging (e.g., kWh). Default: 0.10.

* `lpg`(

  <!-- -->

  float

  <!-- -->

  )

  Price per unit of LPG fuel. Default: 0.55.

```json
{
  "creationTimestamp": 1602684618476,
  "dieselStandard": 1.5,
  "dieselPremium": 2,
  "gasolineStandard": 1.51,
  "gasolinePremium": 1.48,
  "electric": 0.18,
  "lpg": 0.6
}

```

```json
{
  "creationTimestamp": 0,
  "dieselStandard": 0,
  "dieselPremium": 0,
  "gasolineStandard": 0,
  "gasolinePremium": 0,
  "electric": 0,
  "lpg": 0
}

```

***

### 2. Get All Fuel Prices[​](#2-get-all-fuel-prices "Direct link to 2. Get All Fuel Prices")

**Description:** Get fuel prices. If no entry was previously added, the default values will be returned

* **Base URL:** `https://api.magiclane.net/api/v1`
* **Endpoint:** `GET /fleetmanagement/fuel-prices`
* **Headers:**
  * `Authorization: YOUR_API_KEY`
* **Returned error codes:**

| Error Code                  | Description                               |
| --------------------------- | ----------------------------------------- |
| `200 Successful`            | Successful operation.                     |
| `400 Bad Request`           | Invalid input or missing required fields. |
| `401 Unauthorized`          | API key is missing or invalid.            |
| `404 Not Found`             | The fuel prices were not found.           |
| `405 Method Not Allowed`    | Incorrect method type.                    |
| `500 Internal Server Error` | Database error occurred.                  |

#### Example:[​](#example-1 "Direct link to Example:")

* **Response Body:** (error code `200`)

- Schema View
- JSON Example
- JSON View

* ▶`fuelPrices`(

  <!-- -->

  array\[object]

  <!-- -->

  )

  List of fuel price objects.

```json
{
  "creationTimestamp": 1602684618476,
  "dieselStandard": 1.5,
  "dieselPremium": 2,
  "gasolineStandard": 1.51,
  "gasolinePremium": 1.48,
  "electric": 0.18,
  "lpg": 0.6
}

```

```json
{
  "creationTimestamp": 0,
  "dieselStandard": 0,
  "dieselPremium": 0,
  "gasolineStandard": 0,
  "gasolinePremium": 0,
  "electric": 0,
  "lpg": 0
}

```

```
```
