Delete delivery
DELETE/company/delivery/:id
Permanently delete a shipment from the database (soft delete). Only shipments with a 'planned' status that have not started tracking can be deleted. Requires JWT authentication.
Use Cases:
- Delete incorrectly created or duplicate shipments
- Clean up test shipments
- Remove erroneously planned shipments
Example of a successful response:
{
_id: 64d1a2b3e8b7a9001f8e7d12,
service_code: DEL-12345,
deleted: true,
deletedAt: 2025-08-08T15:20:00Z
}
Restrictions:
- Only shipments with a 'planned' status can be deleted
- Shipments with tracking initiated cannot be deleted
- Shipments already completed or canceled cannot be deleted
Request
Responses
- 200
- 400
- 401
- 404
Shipment deleted successfully
Operation not allowed. This occurs when:
- The shipment is not in 'planned' status
- The shipment already has tracking initiated
- The shipment was previously deleted
Unauthorized. The JWT token is invalid or has expired. You must authenticate again.
Shipment not found. The provided ID does not exist or does not belong to the authenticated user's company.