# Miscellaneous Location

Last updated:

<!-- -->

October 18, 2026

<!-- -->

\| 10 minutes read

<br />

<br />

The **Miscellaneous Location Rest API** allows you to manage miscellaneous locations within the Fleet Management system. You can create, retrieve, update, and delete miscellaneous locations. This API supports filtering, sorting, and pagination to help manage large datasets efficiently.

### Miscellaneous Location Object Fields[​](#miscellaneous-location-object-fields "Direct link to Miscellaneous Location Object Fields")

| Field      | Type    | Description                                       |
| ---------- | ------- | ------------------------------------------------- |
| `id`       | Integer | Unique identifier for the miscellaneous location. |
| `isDepot`  | Boolean | Indicates whether the location is a depot.        |
| `alias`    | String  | Short name or identifier for the location.        |
| `address`  | Object  | Detailed address information of the location.     |
| `location` | Object  | Coordinates of the miscellaneous location.        |

***

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

### 1. Create Miscellaneous Location[​](#1-create-miscellaneous-location "Direct link to 1. Create Miscellaneous Location")

**Description:** Adds a new miscellaneous location to the database.

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

* **Endpoint:** `POST /fleetmanagement/misc-locations`

* **Headers:**

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

* **Returned error codes:**

| Error Code                  | Description                                                                                                                                                          |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200 Successful`            | Successful operation.                                                                                                                                                |
| `400 Bad Request`           | - The miscLocation does not have the coordinates set. Please try to set a correct set of coordinates.<br />- The miscLocation is curently used in another operation. |
| `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 `Miscellaneous Location` object will have its `id` 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

* `isDepot`(

  <!-- -->

  boolean

  <!-- -->

  )

  Indicates whether the location is a depot.

* `alias`(

  <!-- -->

  string

  <!-- -->

  )

  Short name or identifier for the location.

* ▶`address`(

  <!-- -->

  object

  <!-- -->

  )

  Detailed address information of the location.

* `location`(

  <!-- -->

  array\[double]

  <!-- -->

  )

  Coordinates of the miscellaneous location as \[latitude, longitude].

```json
[
  {
    "isDepot": true,
    "alias": "Depot 1",
    "location": [
      48.870569,
      2.356448
    ],
    "address": {
      "country": "France",
      "state": "Ile-de-France",
      "county": "Paris",
      "city": "Paris",
      "postalCode": "75001",
      "streetName": "Rue de Rivoli",
      "streetNumber": "1"
    }
  },
  {
    "isDepot": true,
    "alias": "Depot 2",
    "location": [
      45.652871,
      25.585588
    ],
    "address": {
      "country": "France",
      "state": "Aquitaine",
      "county": "Aquitaine",
      "city": "Bordeaux",
      "postalCode": "33300",
      "streetName": "Jean Jaures",
      "streetNumber": "82"
    }
  }
]

```

```json
[
  {
    "isDepot": true,
    "alias": "string",
    "location": [
      0,
      0
    ],
    "address": {
      "country": "string",
      "state": "string",
      "county": "string",
      "city": "string",
      "postalCode": "string",
      "streetName": "string",
      "streetNumber": "string",
      "extra": "string"
    }
  }
]

```

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

- Schema View
- JSON Example
- JSON View

* ▶`miscLocations`(

  <!-- -->

  array

  <!-- -->

  )

  List of miscellaneous location objects.

```json
{
  "miscLocations": [
    {
      "id": 16262,
      "isDepot": true,
      "alias": "Depot 1",
      "location": [
        48.870569,
        2.356448
      ],
      "address": {
        "country": "France",
        "state": "Ile-de-France",
        "county": "Paris",
        "city": "Paris",
        "postalCode": "75001",
        "streetName": "Rue de Rivoli",
        "streetNumber": "1"
      }
    },
    {
      "id": 16263,
      "isDepot": true,
      "alias": "Depot 2",
      "location": [
        45.652871,
        25.585588
      ],
      "address": {
        "country": "France",
        "state": "Aquitaine",
        "county": "Aquitaine",
        "city": "Bordeaux",
        "postalCode": "33300",
        "streetName": "Jean Jaures",
        "streetNumber": "82"
      }
    }
  ]
}

```

```json
{
  "miscLocations": [
    {
      "id": 0,
      "isDepot": true,
      "alias": "string",
      "location": [
        0,
        0
      ],
      "address": {
        "country": "string",
        "state": "string",
        "county": "string",
        "city": "string",
        "postalCode": "string",
        "streetName": "string",
        "streetNumber": "string",
        "extra": "string"
      }
    }
  ]
}

```

***

### 2. Get All Miscellaneous Location[​](#2-get-all-miscellaneous-location "Direct link to 2. Get All Miscellaneous Location")

**Description:** Fetches a list of all miscellaneous locations with optional filtering.

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

* **Endpoint:** `GET /fleetmanagement/misc-locations`

* **Headers:**
  * `Authorization: YOUR_API_KEY`

* **Query Parameters:**

  * `search` (string, *optional*) – General search term across miscLocations.
  * `id` (string, *optional*) – Filter by miscLocation ID (`id=value:exact` for exact match).
  * `alias` (string, *optional*) – Filter by miscLocation alias (`alias=value:exact` for exact match).
  * `location` (string, *optional*) – Filter by location (`location=value:exact` for exact match).
  * `country` (string, *optional*) – Filter by country (`country=value:exact` for exact match).
  * `state` (string, *optional*) – Filter by state (`state=value:exact` for exact match).
  * `county` (string, *optional*) – Filter by county (`county=value:exact` for exact match).
  * `city` (string, *optional*) – Filter by city (`city=value:exact` for exact match).
  * `postalCode` (string, *optional*) – Filter by postal code (`postalCode=value:exact` for exact match).
  * `streetName` (string, *optional*) – Filter by street name (`streetName=value:exact` for exact match).
  * `streetNumber` (string, *optional*) – Filter by street number (`streetNumber=value:exact` for exact match).
  * `extra` (string, *optional*) – Filter by extra address value (`extra=value:exact` for exact match).
  * `sort` (string, *optional*) – Sorting format: `column1:asc/desc,column2:asc/desc`
    * Available columns: `id, isDepot, alias, latitude, longitude, country, state, county, city, postalCode, streetName, streetNumber, extra`
  * `includeColumns` (string, *optional*) – Specify which columns to include.
    <!-- -->
    * Available columns: `id, isDepot, alias, latitude, longitude, country, state, county, city, postalCode, streetName, streetNumber, extra`
  * `page` (integer, *optional*) – Page number for pagination.
  * `per_page` (integer, *optional*) – Number of items per page.

* **Returned error codes:**

| Error Code                  | Description                                                                                |
| --------------------------- | ------------------------------------------------------------------------------------------ |
| `200 Successful`            | Successful operation.                                                                      |
| `400 Bad Request`           | The values sent for page and per\_page parameters are incorrect; should be greater than 0. |
| `401 Unauthorized`          | API key is missing or invalid.                                                             |
| `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

* ▶`miscLocations`(

  <!-- -->

  array

  <!-- -->

  )

  List of miscellaneous location objects.

```json
{
  "miscLocations": [
    {
      "id": 16262,
      "isDepot": true,
      "alias": "Depot 1",
      "location": [
        48.870569,
        2.356448
      ],
      "address": {
        "country": "France",
        "state": "Ile-de-France",
        "county": "Paris",
        "city": "Paris",
        "postalCode": "75001",
        "streetName": "Rue de Rivoli",
        "streetNumber": "1"
      }
    },
    {
      "id": 16263,
      "isDepot": true,
      "alias": "Depot 2",
      "location": [
        45.652871,
        25.585588
      ],
      "address": {
        "country": "France",
        "state": "Aquitaine",
        "county": "Aquitaine",
        "city": "Bordeaux",
        "postalCode": "33300",
        "streetName": "Jean Jaures",
        "streetNumber": "82"
      }
    }
  ]
}

```

```json
{
  "miscLocations": [
    {
      "id": 0,
      "isDepot": true,
      "alias": "string",
      "location": [
        0,
        0
      ],
      "address": {
        "country": "string",
        "state": "string",
        "county": "string",
        "city": "string",
        "postalCode": "string",
        "streetName": "string",
        "streetNumber": "string",
        "extra": "string"
      }
    }
  ]
}

```

***

### 3. Get a Miscellaneous Location by ID[​](#3-get-a-miscellaneous-location-by-id "Direct link to 3. Get a Miscellaneous Location by ID")

**Description:** Retrieves a specific miscellaneous location by ID.

* **Base URL:** `https://api.magiclane.net/api/v1`
* **Endpoint:** `GET /fleetmanagement/misc-locations/{id}`
* **Headers:**
  * `Authorization: YOUR_API_KEY`
* **Path Parameter:**
  * `id` (integer, \**required*) - The unique location ID.
* **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`             | MiscLocation not found in database.       |
| `405 Method Not Allowed`    | Incorrect method type.                    |
| `500 Internal Server Error` | Database error occurred.                  |

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

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

- Schema View
- JSON Example
- JSON View

* `id`(

  <!-- -->

  integer

  <!-- -->

  )

  Unique identifier for the miscellaneous location.

* `isDepot`(

  <!-- -->

  boolean

  <!-- -->

  )

  Indicates whether the location is a depot.

* `alias`(

  <!-- -->

  string

  <!-- -->

  )

  Short name or identifier for the location.

* ▶`address`(

  <!-- -->

  object

  <!-- -->

  )

  Detailed address information of the location.

* `location`(

  <!-- -->

  array\[double]

  <!-- -->

  )

  Coordinates of the miscellaneous location as \[latitude, longitude].

```json
{
  "id": 16262,
  "isDepot": true,
  "alias": "Depot 1",
  "location": [
    48.870569,
    2.356448
  ],
  "address": {
    "country": "France",
    "state": "Ile-de-France",
    "county": "Paris",
    "city": "Paris",
    "postalCode": "75001",
    "streetName": "Rue de Rivoli",
    "streetNumber": "1"
  }
}

```

```json
{
  "id": 0,
  "isDepot": true,
  "alias": "string",
  "location": [
    0,
    0
  ],
  "address": {
    "country": "string",
    "state": "string",
    "county": "string",
    "city": "string",
    "postalCode": "string",
    "streetName": "string",
    "streetNumber": "string",
    "extra": "string"
  }
}

```

***

### 4. Update a Miscellaneous Location[​](#4-update-a-miscellaneous-location "Direct link to 4. Update a Miscellaneous Location")

**Description:** Updates an existing miscellaneous location record.

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

* **Endpoint:** `PUT /fleetmanagement/misc-locations/{id}`

* **Headers:**

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

* **Path Parameter:**
  * `id` (integer, \**required*) - The unique location ID.

* **Returned error codes:**

| Error Code                  | Description                                                                                                                                                          |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200 Successful`            | Successful operation.                                                                                                                                                |
| `400 Bad Request`           | - The miscLocation does not have the coordinates set. Please try to set a correct set of coordinates.<br />- The miscLocation is curently used in another operation. |
| `401 Unauthorized`          | API key is missing or invalid.                                                                                                                                       |
| `404 Not Found`             | MiscLocation not found in database.                                                                                                                                  |
| `405 Method Not Allowed`    | Incorrect method type.                                                                                                                                               |
| `500 Internal Server Error` | Database error occurred.                                                                                                                                             |

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

* **Request Body:**

- Schema View
- JSON Example
- JSON View

* `id`(

  <!-- -->

  integer

  <!-- -->

  )

  Unique identifier for the miscellaneous location.

* `isDepot`(

  <!-- -->

  boolean

  <!-- -->

  )

  Indicates whether the location is a depot.

* `alias`(

  <!-- -->

  string

  <!-- -->

  )

  Short name or identifier for the location.

* ▶`address`(

  <!-- -->

  object

  <!-- -->

  )

  Detailed address information of the location.

* `location`(

  <!-- -->

  array\[double]

  <!-- -->

  )

  Coordinates of the miscellaneous location as \[latitude, longitude].

```json
{
  "id": 16262,
  "isDepot": true,
  "alias": "Depot 1",
  "location": [
    48.870569,
    2.356448
  ],
  "address": {
    "country": "France",
    "state": "Ile-de-France",
    "county": "Paris",
    "city": "Paris",
    "postalCode": "75001",
    "streetName": "Rue de Rivoli",
    "streetNumber": "1"
  }
}

```

```json
{
  "id": 0,
  "isDepot": true,
  "alias": "string",
  "location": [
    0,
    0
  ],
  "address": {
    "country": "string",
    "state": "string",
    "county": "string",
    "city": "string",
    "postalCode": "string",
    "streetName": "string",
    "streetNumber": "string",
    "extra": "string"
  }
}

```

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

```json
{
  "message": "Operation done successfully",
}

```

***

### 5. Delete MiscLocations[​](#5-delete-misclocations "Direct link to 5. Delete MiscLocations")

**Description:** Deletes miscellaneous locations.

* **Base URL:** `https://api.magiclane.net/api/v1`
* **Endpoint:** `DELETE /fleetmanagement/misc-locations`
* **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`             | Can't delete misc locations because at least one of them does not exist. |
| `405 Method Not Allowed`    | Incorrect method type.                                                   |
| `500 Internal Server Error` | Database error occurred.                                                 |

Note

If a miscellaneous location that needs to be deleted was previously used to create orders or as a departure point, the id\_depot in those orders or the departure field will be set to 0.

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

* **Request Body:**

```json
   [98765, 98766, 98767 ]

```

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

```json
{
  "message": "Operation done successfully",
}

```
