Add an item
Endpoint
Section titled “Endpoint”POST /api/bookings/v4/{id}/itemsAdds a new item (parcel or package) to an existing booking.
Path parameters
Section titled “Path parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The booking ID |
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
weight | number | Yes | Weight in kilograms |
height | number | Yes | Height in centimetres |
width | number | Yes | Width in centimetres |
length | number | Yes | Length in centimetres |
quantity | integer | Yes | Number of identical items (minimum 1) |
description | string | Yes | Packaging type from the allowed list (case-insensitive). Not free-text contents. |
Allowed description values
Section titled “Allowed description values”| Value | Notes |
|---|---|
Carton | Also accepts carton/box |
Wine/Beer/Liquor Carton | |
Carton containing Fragile goods | |
Carton containing Liquids | |
Carton containing Glass | |
Heavy Carton | |
Skid | |
Pallet | |
Tube | |
Crate | |
Satchel | |
Satchel 250g / 500g / 1kg / 3kg / 5kg | |
Bag | |
Envelope | |
Other/Misc | |
Unpackaged |
Request
Section titled “Request”curl -X POST \ -H "Api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "weight": 5, "height": 20, "width": 30, "length": 40, "quantity": 1, "description": "Carton" }' \ https://www.transdirect.com.au/api/bookings/v4/123456/itemsResponse
Section titled “Response”A successful response returns 201 with the created item (no booking_id field):
{ "id": 3, "description": "Carton", "weight": 5, "length": 40, "width": 30, "height": 20, "quantity": 1}Error responses
Section titled “Error responses”| Status code | Meaning |
|---|---|
400 | Missing/invalid fields, invalid packaging type, or multipickup booking |
401 | Unauthorised |
404 | Booking not found |
500 | Server error |