/stocks/warehouses/{warehouseId}
Deletes a specific Warehouse and its associated stock. Before deleting, ensure any related operators and ongoing purchases are handled using the 'associations' parameter. If 'associations' is not provided and the warehouse has linked operators or purchases, the deletion will fail to prevent data loss. Important: To avoid deleting the stock, you must transfer it to another warehouse before deleting this one.
deleteStockWarehouse
| Name | Type | Description |
|---|---|---|
warehouseId
required
|
string |
The unique identifier of the warehouse within the system. This ID is immutable and assigned upon creation. Example: |
| Name | Type | Description |
|---|---|---|
associations
|
string |
A comma-separated list of dependencies (related resources). operators
purchases
|
destinationWarehouseId
|
integer |
The ID of the target warehouse to which associated resources (operators or purchases) should be moved when deleting the current warehouse. Example: |
status
string
error
error
object
http_code
integer
400
message
string
more_info
string
status
string
error
error
object
http_code
integer
401
message
string
Example: Authentication token invalid.
more_info
string
status
string
error
error
object
http_code
integer
404
message
string
Example: Resource not found
more_info
string | null
status
string
error
error
object
http_code
integer
429
message
string
Example: Too Many Requests.
more_info
string
status
string
error
error
object
http_code
integer
500
message
string
Example: An error has occurred during the request.
more_info
string
curl -X DELETE \
'https://api.sandbox.infraspeak.com/v3/stocks/warehouses/1?destinationWarehouseId=1' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://api.sandbox.infraspeak.com/v3/stocks/warehouses/1?destinationWarehouseId=1', {
method: 'DELETE',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
});
const data = await response.json();
$response = Http::withHeaders([
'Accept' => 'application/json',
'Content-Type' => 'application/json',
])->withToken('YOUR_API_TOKEN')
->delete('https://api.sandbox.infraspeak.com/v3/stocks/warehouses/1?destinationWarehouseId=1');
import requests
response = requests.delete(
'https://api.sandbox.infraspeak.com/v3/stocks/warehouses/1?destinationWarehouseId=1',
headers={
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
},
)
data = response.json()