List booking items
Get the item lines on a booking. Each line is one package type with its weight, dimensions and quantity.
GET /api/v5/bookings/{id}/itemsRequires your API key in the api-key header.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
id | integer | The Transdirect booking id. |
Example request
Section titled “Example request”curl https://api.transdirect.com.au/api/v5/bookings/623630/items \ -H "api-key: $TD_API_KEY"import { client, getApiV5BookingsByIdItems } from '@transdirect/api-sdk';
client.setConfig({ headers: { 'api-key': process.env.TD_API_KEY! } });
const { data: items } = await getApiV5BookingsByIdItems({ path: { id: '623630' } });Response
Section titled “Response”200 OK with an array of items.
[ { "id": 46885332, "description": "Carton", "weight": 5, "length": 40, "width": 30, "height": 20, "quantity": 1 }]| Field | Description |
|---|---|
id | Item line id. Use it to get, update or delete the line. |
description | Package type, for example Carton, Satchel or Pallet. See items and packaging. |
weight | Weight of one item, in kg. |
length, width, height | Dimensions of one item, in cm. |
quantity | Number of identical items on this 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 | Empty | The booking has no items. |
Try it
Section titled “Try it”Open the API Explorer, add your key, and find List booking items.