Skip to content

Update a booking item

Change one item line on a draft booking. Fields you leave out keep their current value, and the booking’s charged weight is recalculated.

PUT /api/v5/bookings/{id}/items/{item_id}

Requires your API key in the api-key header.

Make item changes before you confirm. Transdirect prices the booking again at confirm from the items it holds then. To change several lines in one request, send items to update a booking.

ParameterTypeDescription
idintegerThe Transdirect booking id.
item_idintegerThe item line id.

Send JSON with Content-Type: application/json. Every field is optional.

FieldTypeDescription
descriptionstringPackage type, for example Carton or Pallet. See items and packaging.
weightnumberWeight of one item in kg. Greater than 0.
length, width, heightnumberDimensions in cm. Greater than 0.
quantityintegerNumber of identical items. At least 1.
Terminal window
curl -X PUT https://api.transdirect.com.au/api/v5/bookings/623630/items/46885332 \
-H "api-key: $TD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "weight": 6.5, "quantity": 2 }'
import { client, putApiV5BookingsByIdItemsByItemId } from '@transdirect/api-sdk';
client.setConfig({ headers: { 'api-key': process.env.TD_API_KEY! } });
const { data: item } = await putApiV5BookingsByIdItemsByItemId({
path: { id: '623630', item_id: '46885332' },
body: { weight: 6.5, quantity: 2 },
});

200 OK with the whole item after the change.

{
"id": 46885332,
"description": "Carton",
"weight": 6.5,
"length": 40,
"width": 30,
"height": 20,
"quantity": 2
}
StatusBodyCause
400{"errors":["Cannot update. Booking has been processed."]}The booking has already been paid.
400{"errors":"Invalid Item description."}description is not a known package type.
400{"errors":"Cannot update items is Multipick bookings"}The booking is a multi-pickup booking.
400{"success":false,"error":{"name":"ZodError","message":"..."}}A value is not positive, or a field is not recognised.
401{"error":"missing_api_key"} or {"error":"invalid_api_key"}No key, or a key that is not active.
404{"error":"booking_not_found"}No booking with that id belongs to your account.
404{"error":"item_not_found"}The item is not on this booking.

Open the API Explorer, add your key, and find Update a booking item.