Update an item
Endpoint
Section titled “Endpoint”PUT /api/bookings/v4/{id}/items/{item_id}Updates an existing item. Multipickup bookings reject item changes with 400.
Path parameters
Section titled “Path parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The booking ID |
item_id | integer | Yes | The item ID |
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
weight | number | No | Weight in kilograms |
height | number | No | Height in centimetres |
width | number | No | Width in centimetres |
length | number | No | Length in centimetres |
quantity | integer | No | Number of identical items |
description | string | No | Packaging type from the allowed list |
Request
Section titled “Request”curl -X PUT \ -H "Api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "weight": 7.5, "description": "Carton" }' \ https://www.transdirect.com.au/api/bookings/v4/123456/items/1Response
Section titled “Response”A successful response returns 200 with the updated item:
{ "id": 1, "description": "Carton", "weight": 7.5, "length": 40, "width": 30, "height": 20, "quantity": 1}Error responses
Section titled “Error responses”| Status code | Meaning |
|---|---|
400 | Invalid fields, invalid packaging type, or multipickup booking |
401 | Unauthorised |
404 | Booking or item not found |