Cancel delivery service
DELETE/company/delivery/:service_code
Cancels an existing shipment by changing its status to 'canceled'. Only shipments in 'planned' or 'in_progress' status can be canceled. Requires JWT authentication.
Use Cases:
- Cancel a planned shipment that will no longer be carried out
- Stop an in-progress shipment due to logistical problems
- Reverse a poorly planned shipment
Example of a successful response:
{
service_code: DEL-12345,
status: canceled,
etl_date: 2025-08-10T08:00:00Z,
updated_at: 2025-08-08T15:30:00Z
}
Restrictions:
- A completed shipment cannot be canceled
- An already canceled shipment cannot be canceled
Request
Responses
- 200
- 400
- 401
- 404
Shipment canceled successfully.
Invalid state. This occurs when:
- The shipment is already completed
- The shipment is already canceled
Unauthorized. The JWT token is invalid or has expired. You must authenticate again.
Shipment not found. The provided service_code does not exist or does not belong to the authenticated user's company.