# Delete Location

Completely removes a location and its metadata from Bead once it is no longer in use. Deletion succeeds only when the location has no terminals.

#### Endpoint

`DELETE /Locations/{id}`

#### Path parameters

| Name | Type   | Required | Description                           |
| ---- | ------ | -------- | ------------------------------------- |
| `id` | string | Yes      | The `locationId` you intend to delete |

#### Request headers

| Header          | Value                   |
| --------------- | ----------------------- |
| `Authorization` | `Bearer <access_token>` |
| `Accept`        | `application/json`      |

#### Example request

```bash
curl -X DELETE "https://api.test.devs.beadpay.io/Locations/loc_bfdc6a7f" \
     -H "Authorization: Bearer $TOKEN"
```

#### Successful response

| HTTP           | Body |
| -------------- | ---- |
| 204 No Content | None |

#### Error responses

| Code | Condition                                                                                                   |
| ---- | ----------------------------------------------------------------------------------------------------------- |
| 400  | Invalid request or business rule violation such as attempting to delete a location that still has terminals |
| 401  | Missing or invalid token                                                                                    |
| 403  | Authenticated but not permitted to delete this location                                                     |
| 404  | Location `id` does not exist or is not visible to your token                                                |

#### Best practices

| Action                                                              | Why                                                             |
| ------------------------------------------------------------------- | --------------------------------------------------------------- |
| Disable every terminal under the location before deletion           | Ensures no new transactions while you decommission the location |
| Use `GET /Locations/{id}` to confirm the `terminals` array is empty | Prevents repeat failures due to remaining devices               |
| Archive the location details in your system before you delete       | The record cannot be retrieved after deletion                   |
| Perform deletes during low traffic windows                          | Reduces risk of concurrent device provisioning                  |

#### Related endpoints

| Action          | Endpoint                 |
| --------------- | ------------------------ |
| Update Location | `PUT /Locations/{id}`    |
| Get Location    | `GET /Locations/{id}`    |
| Delete Terminal | `DELETE /Terminals/{id}` |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.bead.xyz/entity-management/location-management/delete-location.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
