Create an order
Endpoint
Section titled “Endpoint”POST /api/ordersCreates (or upserts) an order linked to a booking for the authenticated member. This is the integration path used by store plugins (WooCommerce and similar). For a simpler CSV-style create without a full booking, see POST /api/orders/create-simple (members area / internal tooling).
Authentication
Section titled “Authentication”Requires authentication via API key or basic auth.
Request body
Section titled “Request body”The create path expects store-style field names. Required fields when creating a brand-new order through the full sync-style payload used by plugins:
| Field | Type | Required | Description |
|---|---|---|---|
order_id | string | Yes | External order number from your system. |
imported_from | string | Yes | Source platform (e.g. "Woocommerce", "Shopify", "csv"). |
purchased_time | string | Yes | When the customer purchased. |
sale_price | number | Yes | Order sale price. |
paid_time | string | Yes | When the order was paid. |
buyer_name | string | Yes | Buyer name. |
buyer_email | string | Yes | Buyer email. |
delivery_name | string | Yes | Delivery recipient name. |
delivery_email | string | Yes | Delivery recipient email. |
delivery_phone | string | Yes | Delivery recipient phone. |
delivery_address | string | Yes | Delivery street address. |
shipping_postcode | string | Yes | Delivery postcode. |
shipping_city | string | Yes | Delivery suburb/city. |
shipping_state | string | No | Delivery state. |
shipping_country | string | No | Delivery country. |
shipping_first_name / shipping_last_name | string | No | Split name fields used when building the receiver address. |
shipping_address / shipping_address2 | string | No | Street lines. |
shipping_phone / shipping_email / shipping_company | string | No | Optional receiver contact fields. |
courier_price | number | No | Quoted shipping price. |
items | array | Conditional | Line items with description, weight, width, length, height, quantity (defaults come from API module settings when omitted). |
transdirect_order_id | integer | Conditional | Booking id to attach the order to (required on the update/link path). |
selected_courier | string | Conditional | Courier string_id when attaching to a booking for quoting. |
Example response
Section titled “Example response”A successful create returns 201 with the order object as returned by the API (not a simplified view model):
{ "id": 5003, "transdirect_order_id": 12345678, "transdirect_member_id": 12345, "transdirect_order_status": "pending", "order_id": "ORD-10042", "goods_summary": "", "goods_dump": null, "imported_from": "Woocommerce", "imported_time": "2025-08-20T04:00:00+00:00", "purchased_time": "2025-08-20 10:00:00", "sale_price": "49.95", "selected_courier": null, "courier_price": "0", "paid_time": "2025-08-20 10:05:00", "buyer_name": "John Smith", "buyer_email": "john@example.com.au", "delivery": { "name": "John Smith", "email": "john@example.com.au", "phone": "0498765432", "address": "42 George Street" }, "last_updated": "2025-08-20T04:00:00+00:00"}Response fields
Section titled “Response fields”| Field | Type | Description |
|---|---|---|
id | integer | Transdirect order primary key. |
order_id | string | External order number. |
transdirect_order_id | integer | null | Linked booking id when the order is attached to a booking. |
transdirect_member_id | integer | Owning member id. |
transdirect_order_status | string | Order status (pending, ready_to_book, booked, manually_dispatched, cancelled, deleted, removed). |
imported_from | string | Source platform. |
imported_time | string | ISO 8601 import time. |
delivery | object | Nested delivery contact: name, email, phone, address. |
buyer_name / buyer_email | string | Buyer details. |
goods_summary / goods_dump | string | Goods summary / raw dump when provided by the importer. |
sale_price / courier_price | string | number | Commercial values. |
selected_courier | string | null | Selected courier string_id when set. |
last_updated | string | Last update timestamp. |
Error responses
Section titled “Error responses”| Status code | Meaning |
|---|---|
400 | Bad request — missing or invalid fields |
401 | Unauthorised — invalid credentials or API key |
500 | Server error while saving the order or linking a booking |