Skip to content

Add a booking item

Add an item line to a draft booking. The booking’s charged weight is recalculated.

POST /api/v5/bookings/{id}/items

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, so quote again if you need to show your customer the new price first.

ParameterTypeDescription
idintegerThe Transdirect booking id.

Send JSON with Content-Type: application/json. All fields are required and no others are accepted.

FieldTypeDescription
descriptionstringPackage type, for example Carton, Satchel or Pallet (any case). See items and packaging for the full list. What is inside the parcel belongs in the booking’s goods_description, not here.
weightnumberWeight of one item in kg. Greater than 0.
lengthnumberLength in cm. Greater than 0.
widthnumberWidth in cm. Greater than 0.
heightnumberHeight in cm. Greater than 0.
quantityintegerNumber of identical items. At least 1.
Terminal window
curl -X POST https://api.transdirect.com.au/api/v5/bookings/623630/items \
-H "api-key: $TD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Satchel",
"weight": 1,
"length": 30,
"width": 25,
"height": 5,
"quantity": 2
}'
import { client, postApiV5BookingsByIdItems } from '@transdirect/api-sdk';
client.setConfig({ headers: { 'api-key': process.env.TD_API_KEY! } });
const { data: item, error } = await postApiV5BookingsByIdItems({
path: { id: '623630' },
body: { description: 'Satchel', weight: 1, length: 30, width: 25, height: 5, quantity: 2 },
});

201 Created with the new item. The package type is returned in its standard spelling.

{
"id": 46885333,
"description": "Satchel",
"weight": 1,
"length": 30,
"width": 25,
"height": 5,
"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, whose items cannot be changed.
400{"success":false,"error":{"name":"ZodError","message":"..."}}A field is missing, not positive, or not recognised. message is a JSON-encoded list of issues.
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.

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