Ship Batch


This method is used to ship all valid items in a batch. The batch must be in ready status. Your account will be charged for all items in the batch.

{info} Shipping is processed asynchronously. The batch status will change to processing immediately and then to completed once all items have been processed. Labels will be merged into PDF files in groups of 100.

Endpoint

Method URI Headers
POST /batches/{batch_id}/ship default

Request

Field Required Type Description
batch_id Yes String The batch hash ID. (URL parameter)

Response

Field Type Description
id String The batch hash ID.
status String Will be processing immediately after shipping is initiated.
default_service String The service code for this batch.
default_shipper_id String The shipper hash ID for this batch.
results {} Object Batch statistics at time of shipping.

Response Examples

Successful

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

Failed - Invalid Items

{
    "success": false,
    "message": "Batch contains invalid items that must be fixed or removed before shipping.",
    "data": {
        "invalid_order_ids": [
            "d34b4588-8e98-4e26-8ae8-5145f6a61c47",
            "a12c5678-9f01-4b23-cdef-6789abcd0123"
        ]
    }
}

Failed - Insufficient Credit

{
    "success": false,
    "message": "You don't have enough credit for this batch. Please add funds to your account."
}

Failed - Wrong Status

{
    "success": false,
    "message": "Batch is not ready to ship."
}