1. Locations
  2. Delete Location

Locations

Delete Location

When deleting location, you will just need to pass in the ID of the location you want to delete into the request URL params.

DANGER

When deleting a location, it will be a soft delete. deleted_at: {{Deleted date time}}

DELETE
`/v1/locations/:location`
js
        fetch(`https://api.packagex.io/v1/locations/${location_id}`, {
  method: "DELETE",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  },
});

      

Activate Locations

To activate a deleted location, you need to pass activate_location:true in the body of the request.

POST
`/v1/locations/:location`
js
        const data = {
activate_location: true;
};

fetch(`https://api.packagex.io/v1/locations/${location_id}`, {
  method: "POST",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  }
 body: JSON.stringify(data),
});