Delete a draft booking
Delete a draft booking (a quote you have not confirmed), along with its items and addresses.
DELETE /api/v5/bookings/{id}Requires your API key in the api-key header.
Every quote creates a draft booking. Drafts are never charged or sent to a courier, and they do not appear in list bookings, so you do not have to delete them. Delete one when you want it gone, for example after a customer abandons checkout.
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
id | integer | The Transdirect booking id from your quote. |
Example request
Section titled “Example request”curl -X DELETE https://api.transdirect.com.au/api/v5/bookings/623630 \ -H "api-key: $TD_API_KEY"import { client, deleteApiV5BookingsById } from '@transdirect/api-sdk';
client.setConfig({ headers: { 'api-key': process.env.TD_API_KEY! } });
const { response } = await deleteApiV5BookingsById({ path: { id: '623630' } });if (response.status !== 204) { // 500 means the booking is already paid: use the cancel endpoint for an eligible credit-account or demo booking.}Response
Section titled “Response”204 No Content with an empty body. The booking, its items and its sender and receiver addresses are removed.
Confirmed bookings
Section titled “Confirmed bookings”You cannot delete a booking once it has been paid or confirmed. Use POST /api/v5/bookings/{id}/cancel with a required reason for an eligible account-credit or demo booking. Demo bookings are cancelled without a refund. An eligible booking that cannot be cancelled automatically is sent to support, and stays active until support handles it.
Card and PayPal bookings return 422 on the cancel endpoint. Cancel those in the members area or contact support@transdirect.com.au.
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, or it has already been deleted. |
429 | {"error":"rate_limited"} | More than 600 requests a minute on this key. Wait for the retry-after seconds. |
500 | {"errors":["Cannot update. Booking has been processed."]} | The booking has been paid (including a demo or credit-account confirm). Treat this as “cannot delete”, not as a server fault. |
Try it
Section titled “Try it”Open the API Explorer, add your key, and find Delete a draft booking. This deletes the booking for real, so use a quote you created for testing.