Remove Items from Batch


This method is used to remove specific items from a batch. The batch must not be in validating, processing, or completed status. Removing an item also deletes its associated shipment order.

Endpoint

Method URI Headers
PUT /batches/{batch_id}/remove-items default

Request

Field Required Type Description
batch_id Yes String The batch hash ID. (URL parameter)
batch_shipment_ids [] Yes Array Array of item hash IDs to remove. Maximum 10,000 items.

Request Example

{
    "batch_shipment_ids": [
        "d34b4588-8e98-4e26-8ae8-5145f6a61c47",
        "a12c5678-9f01-4b23-cdef-6789abcd0123"
    ]
}

Response

Field Type Description
id String The batch hash ID.
status String Updated batch status after removal.
default_service String The service code for this batch.
default_shipper_id String The shipper hash ID for this batch.
results {} Object Updated batch statistics.

Response Examples

Successful

{
    "success": true,
    "data": {
        "id": "12345678",
        "status": "ready",
        "default_service": "USPS-3",
        "default_shipper_id": "99999999",
        "results": {
            "total_count": 10,
            "valid_count": 10,
            "invalid_count": 0,
            "completed_count": 0,
            "failed_count": 0,
            "completion_percentage": "0%"
        }
    }
}

Failed

{
    "success": false,
    "message": "Shipment batch is being processed."
}