Add to Batch
Use this endpoint to add quote IDs to an existing batch. The batch must have status open. Quotes must be active, belong to the customer, and not already assigned to a different batch.
REST Endpoint
POST /restapi/v1/customers/:customerId/batch/:batchId/quotes
Request Content Type
application/json
Request JSON Example
POST /restapi/v1/customers/TEST00002/batch/42/quotes
{
"quoteIds": [
1237,
1238
]
}
Explanation of Request Fields
| Field | JSON Type | Required | Description |
|---|---|---|---|
| quoteIds | array | true | Array of quote IDs (integers) to add to the batch. Minimum 1, maximum 500. |
Response Status Code
200 OK
Response Content Type
application/json
Response JSON Example
{
"batchId": 42,
"name": "April Shipments",
"status": "open",
"quoteCount": 7,
"bookedCount": 0,
"errorCount": 0,
"createdAt": "2026-04-01 10:00:00",
"updatedAt": "2026-04-02 15:30: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 "open") |
| quoteCount | integer | Updated number of quotes in the batch |
| bookedCount | integer | Number of successfully booked quotes |
| errorCount | integer | Number of booking errors |
| createdAt | string | Timestamp when the batch was created |
| updatedAt | string | Timestamp when the batch was last updated |
| processedAt | string or null | Null for open batches |
Error Responses
| Status | Condition |
|---|---|
| 400 | Batch status is not "open" |
| 400 | One or more quote IDs not found |
| 400 | One or more quotes are not active (expired or already booked) |
| 400 | One or more quotes are already assigned to a different batch |
| 400 | Adding these quotes would exceed the maximum batch size of 500 |
| 403 | Quote does not belong to this customer |
| 404 | Batch not found |