For AI agents: markdown of this page — /docs-content-en/entities/shipments/delete.md documentation index — /llms.txt
Delete a shipment
DELETE /v1/shipments/:id
Deletes an online store order shipment by its ID. A deleted shipment cannot be restored via the API; create a new one if needed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id (path) |
number | yes | Shipment ID, a non-negative integer. List: GET /v1/shipments |
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/shipments/1205" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/shipments/1205" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/shipments/1205', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
if (res.status === 204) {
console.log('Shipment deleted')
}
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/shipments/1205', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
if (res.status === 204) {
console.log('Shipment deleted')
}
Response
On successful deletion the API returns HTTP status 204 No Content with an empty body. Success is indicated by the status code, not the content.
Response example
HTTP/1.1 204 No Content
Error response example
422 — the shipment has the "shipped" mark:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "The shipment has already been shipped. Cancel the shipment",
"b24Code": "SALE_SHIPMENT_EXIST_SHIPPED"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_PARAMS |
The id in the path is not a non-negative integer. Error message: id must be a non-negative integer |
| 404 | ENTITY_NOT_FOUND |
No shipment with this id exists, or it has already been deleted. Error message: shipment is not exists |
| 422 | BITRIX_ERROR |
The shipment has the "shipped" mark, and b24Code is SALE_SHIPMENT_EXIST_SHIPPED. Clear the mark via POST /v1/shipments/:id/unship |
| 422 | BITRIX_ERROR |
Bitrix24 rejected the deletion for another reason. The reason is in message |
| 403 | BITRIX_ACCESS_DENIED |
The key's user has no permission to modify orders in Bitrix24 |
| 403 | WRITE_BLOCKED_READONLY_KEY |
The key is in read-only mode |
| 403 | SCOPE_DENIED |
The API key does not have the sale scope |
| 401 | MISSING_API_KEY |
The X-Api-Key header is missing |
| 401 | TOKEN_MISSING |
The API key has no configured tokens |
Full list of common API errors: Errors.