Discarding a task means canceling its execution and marking it as no longer active for delivery or pickup. When a task is discarded:
The task status changes to "DISCARDED";
It's removed from any assigned round (if applicable);
It becomes unavailable for optimization and delivery;
External carriers receive cancellation notifications if the task was associated with them;
The task appears in the "Discarded" section of the platform
Methods to discard
API methods:
Single Task Discard by Internal ID
| POST /task/{id}/discard |
Parameters:
id: Database ID of the task
removeFromRound (optional): Set to true to remove from round before discarding
Single Task Discard by by TaskId
| POST /task/bytaskid/{taskId}/discard |
Parameters:
taskId: The external task ID
removeFromRound (optional): Set to true to remove from round before discarding
Bulk Task Discard
| POST /task/discard |
| { "taskIds": ["taskId1", "taskId2", "taskId3"] } |
Body:
taskId: The external task ID
Web Platform:
Individual Task Discard
Navigate to the task details -> Use the delete option in the task interface:
Bulk Task Discard
Go to Tasks tab;
Select "Bulk Update";
Choose tasks either: Select all present tasks, or Define specific tasks by their IDs;
Select action: "Discard a task";
Important: Check "Remove task from the round" toggle for safety;
Click "Proceed" to discard all selected tasks.
Discard by Deleting Announcements
Delete the entire announcement containing the tasks.
ℹ️ Note ℹ️
If you delete an announcement before optimizing the tasks, all the tasks will go into DISCARDED status.
This is an irreversible operation - once an announcement is deleted, all its tasks become DISCARDED and cannot be optimized or processed further.
If you delete an announcement after optimizing the following tasks CAN or CANNOT be discarded:
CAN: Announcements with tasks in
ASSIGNED,PREPARED,GEOCODEDstatusCANNOT: Announcements with any tasks in
ONGOING,COMPLETED, orIN_PROGRESSstatus
The system protects against deleting announcements with tasks that are actively being executed or have been completed, ensuring data integrity and preventing disruption of ongoing operations.
Important Considerations
Tasks in Rounds
Default behavior: API rejects requests to discard tasks assigned to rounds
Solution: Use removeFromRound=true parameter to force removal from round before discarding
Race conditions: Discarding multiple tasks from the same round simultaneously can cause issues
Rate Limits and Performance
Bulk operations are recommended over multiple individual API calls
Discarding hundreds of tasks simultaneously may cause latency
Logging and Tracking
Discarded tasks appear in system logs
API discards show as "discard by SYSTEM" in logs
Task history tracks the discard action and who performed it
External Carrier Integration
When tasks associated with external carriers are discarded, cancellation requests are automatically sent to those carriers
This happens for discards via API, manual web app actions, or announcement deletions
Comments
0 comments
Please sign in to leave a comment.