Get a booking item
Get a single item line on a booking.
GET /api/v5/bookings/{id}/items/{item_id}Requires your API key in the api-key header.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
id | integer | The Transdirect booking id. |
item_id | integer | The item line id, from list booking items or the booking’s items array. |
Example request
Section titled “Example request”curl https://api.transdirect.com.au/api/v5/bookings/623630/items/46885332 \ -H "api-key: $TD_API_KEY"import { client, getApiV5BookingsByIdItemsByItemId } from '@transdirect/api-sdk';
client.setConfig({ headers: { 'api-key': process.env.TD_API_KEY! } });
const { data: item } = await getApiV5BookingsByIdItemsByItemId({ path: { id: '623630', item_id: '46885332' },});Response
Section titled “Response”200 OK
{ "id": 46885332, "description": "Carton", "weight": 5, "length": 40, "width": 30, "height": 20, "quantity": 1}Weight is in kg and dimensions are in cm, for one item. quantity is the number of identical items on the line.
Errors
Section titled “Errors”| Status | Body | Cause |
|---|---|---|
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 Get a booking item.