Delete a booking item
Remove an item line from a draft booking. The booking’s charged weight is recalculated.
DELETE /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.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
id | integer | The Transdirect booking id. |
item_id | integer | The item line id. |
Example request
Section titled “Example request”curl -X DELETE https://api.transdirect.com.au/api/v5/bookings/623630/items/46885333 \ -H "api-key: $TD_API_KEY"import { client, deleteApiV5BookingsByIdItemsByItemId } from '@transdirect/api-sdk';
client.setConfig({ headers: { 'api-key': process.env.TD_API_KEY! } });
const { response } = await deleteApiV5BookingsByIdItemsByItemId({ path: { id: '623630', item_id: '46885333' },});// response.status === 204 on successResponse
Section titled “Response”204 No Content with an empty body.
Errors
Section titled “Errors”| Status | Body | Cause |
|---|---|---|
400 | {"errors":["Cannot update. Booking has been processed."]} | The booking has already been paid. |
400 | {"errors":"Cannot update items is Multipick bookings"} | The booking is a multi-pickup booking. |
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. |
Try it
Section titled “Try it”Open the API Explorer, add your key, and find Delete a booking item.