Add an item
Endpoint
Section titled “Endpoint”POST /api/bookings/v4/{id}/itemsAdds a new item (parcel or package) to an existing booking. You can add multiple items by making separate requests.
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 | No | Description of the item contents |
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": "Electronics" }' \ https://www.transdirect.com.au/api/bookings/v4/123456/itemsResponse
Section titled “Response”A successful response returns a 201 status code with the created item.
{ "id": 3, "booking_id": 123456, "weight": 5, "height": 20, "width": 30, "length": 40, "quantity": 1, "description": "Electronics"}Error responses
Section titled “Error responses”| Status code | Meaning |
|---|---|
400 | Bad request — missing or invalid fields |
401 | Unauthorised — invalid credentials or API key |
404 | Not found — the booking does not exist or does not belong to your account |
422 | Unprocessable entity — validation errors (e.g. weight must be greater than 0) |