Cancel Batch

Use this endpoint to cancel an open batch. Only batches with status open can be cancelled. Quotes associated with the batch remain intact.

REST Endpoint

POST /restapi/v1/customers/:customerId/batch/:batchId/cancel

Request Example

POST /restapi/v1/customers/TEST00002/batch/42/cancel

No request body is required.

Response Status Code

200 OK

Response Content Type

application/json

Response JSON Example

{
  "batchId": 42,
  "name": "April Shipments",
  "status": "cancelled",
  "quoteCount": 5,
  "bookedCount": 0,
  "errorCount": 0,
  "createdAt": "2026-04-01 10:00:00",
  "updatedAt": "2026-04-02 15:00:00",
  "processedAt": null
}

Explanation of Response Fields

Field Type Description
batchId integer System-generated batch ID
name string Customer-provided batch name
status string Batch status (will be "cancelled" after a successful cancel)
quoteCount integer Number of quotes in the batch
bookedCount integer Number of successfully booked quotes (0 for cancelled batches)
errorCount integer Number of booking errors (0 for cancelled batches)
createdAt string Timestamp when the batch was created
updatedAt string Timestamp when the batch was last updated
processedAt string or null Null for cancelled batches

Error Responses

Status Condition
422 Batch status is not "open" (e.g., already processing, completed, failed, or cancelled)
404 Batch not found
403 Batch does not belong to this customer