Sender and receiver addresses
Read just the pickup or delivery address of a booking. To change an address, send sender or receiver to update a booking.
GET /api/v5/bookings/{id}/senderGET /api/v5/bookings/{id}/receiverRequires 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/sender \ -H "api-key: $TD_API_KEY"import { client, getApiV5BookingsByIdSender, getApiV5BookingsByIdReceiver } from '@transdirect/api-sdk';
client.setConfig({ headers: { 'api-key': process.env.TD_API_KEY! } });
const { data: from } = await getApiV5BookingsByIdSender({ path: { id: '623630' } });const { data: to } = await getApiV5BookingsByIdReceiver({ path: { id: '623630' } });console.log(from?.sender.suburb, '->', to?.receiver.suburb);Response
Section titled “Response”200 OK. The address is wrapped in a sender or receiver key.
{ "sender": { "id": 69194889, "address": "1 Martin Place", "company_name": "Example Books Pty Ltd", "email": "dispatch@example.com", "name": "Sam Taylor", "postcode": "2000", "phone": "0291234567", "state": "NSW", "suburb": "SYDNEY", "type": "business", "country": "AU" }}/receiver returns {"receiver": {...}} with the same fields.
| Field | Description |
|---|---|
id | Address record id. |
name, company_name | Contact name and business name. |
address | Street address. |
suburb, state, postcode | Locality. postcode is a string. |
country | Two-letter ISO country code, for example AU. |
type | business or residential. |
phone, email | Contact details. |
Fields you have not filled in come back as empty strings or null.
Errors
Section titled “Errors”| Status | Body | Cause |
|---|---|---|
400 | Empty | The booking has no address of that kind. |
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. |
429 | {"error":"rate_limited"} | More than 600 requests a minute on this key. Wait for the retry-after seconds. |
Try it
Section titled “Try it”Open the API Explorer, add your key, and find Get booking sender details or Get booking receiver details.