13000 XPRESS (97737)
xfm.com.au

Freight API

Integration Guide

Everything you need to connect your system to XFM freight through the TransVirtual platform — every endpoint, every field, in one place.

// Anytime, Anywhere

Before you begin

This API connects to XFM's live freight system. Ensure that all fields are mapped correctly and all required data is filled in before sending a request. Incomplete or incorrectly mapped data can lead to unexpected results.

01

Getting started

Every request runs over HTTPS and carries a single authorisation header built from your XFM-issued account number and Auth Token, separated by a pipe. There are no unauthenticated endpoints.

HeaderValue
AuthorizationAccountNumber|AuthToken

Getting your credentials

Your account number and Auth Token are issued by XFM. To request them, contact the XFM team and we'll set you up with the credentials for your integration.

Need credentials? Reach out to your XFM contact, or call 13000 XPRESS (97737), to request an Auth Token for your account.
Keep your key secure. These credentials can create and modify live freight. Store them safely, never expose them in client-side code, and contact XFM if a key may have been compromised so it can be reissued.

All calls go to https://api.transvirtual.com.au. The default response format is JSON; XML and JSONP (for cross-domain requests) are also supported. Every response returns a consistent envelope.

Response envelope

FieldMeaning
StatusCodeThe outcome of the request. If it is not 200, only StatusCode and StatusText are guaranteed to be meaningful.
StatusTextHuman-readable outcome — log it for troubleshooting.
TransactionIDAlways returned, even on errors. Quote it when contacting XFM support.
DataPresent on all 200 responses, but may be empty.

Supported formats

FormatNotes
JSONDefault response format.
XMLSupported alternative.
JSONPFor cross-domain requests via a callback method.
02

Consignments

Supports POST (insert), PUT (update) and DELETE. Only SenderName and ReceiverName are strictly required for a POST, but a complete address is needed for freight to move correctly.

Request properties (POST & PUT)

PropertyRequiredDescription
UniqueIdRecommendedYour system's unique key for this consignment. Max 200.
NumberOptionalConsignment / tracking number. Max 100.
DateOptionalConsignment date. Format yyyy-MM-dd.
SenderNameRequiredSender name. Max 100.
SenderAddressRecommendedSender address line 1. Max 100.
SenderSuburbRecommendedSender suburb (must exist). Max 60.
SenderPostcodeRecommendedSender postcode. Max 20.
SenderStateRecommendedSender state. Max 30.
ReceiverNameRequiredReceiver name. Max 100.
ReceiverAddressRecommendedReceiver address line 1. Max 100.
ReceiverSuburbRecommendedReceiver suburb (must exist). Max 60.
ReceiverPostcodeRecommendedReceiver postcode. Max 20.
ReceiverStateRecommendedReceiver state. Max 30.
SpecialInstructionsOptionalDelivery instructions shown to the driver on mobile. Max 500.
ConsignmentPickupSpecialInstructionsOptionalPickup instructions shown to the driver on mobile. Max 500.
ConsignmentSenderContactOptionalSender contact name. Max 100.
ConsignmentSenderPhoneOptionalSender contact phone. Max 50.
ConsignmentReceiverContactOptionalReceiver contact name. Max 100.
ConsignmentReceiverPhoneOptionalReceiver contact phone. Max 50.
SenderReferenceOptionalSender reference. Max 100.
ReceiverReferenceOptionalReceiver reference. Max 100.
SenderEmailOptionalSender tracking email (multiple separated by |). Max 500.
ReceiverEmailOptionalReceiver tracking email (multiple separated by |). Max 500.
SignatureRequiredOptionaly or n.
PickupRequestOptionaly if pickup required. POST only.
ConsignmentOtherReferencesOptionalExtra references separated by |. Max 500.
ConsignmentBookingDateTimeOptionalDelivery booking time. Format yyyy-MM-dd HH:mm or ISO-8601.
ConsignmentPickupBookingTimeOptionalPickup booking time. Format yyyy-MM-dd HH:mm or ISO-8601.
ConsignmentServiceTypeOptionalService level. Max 50.
ConsignmentAuthToLeaveNoteOptionalAuthority-to-leave note — appended to delivery special instructions.
AdditionalServiceListOptionalAdditional services, separated with |.
DangerousGoodsNotesConditionalAny value flags the consignment as dangerous goods. Max 200.
ReturnPdfLabelsOptional'y' to include Base64 PDF labels in the response.
ReturnPdfConsignmentOptional'y' to include the Base64 PDF consignment in the response.
Suburb fields. Always supply a complete, valid suburb for both the sender and receiver. If a suburb is missing or unrecognised, the system may apply a default value, which can affect where freight is routed.

POST response properties

PropertyRequiredDescription
IdOptionalTransVirtual Id of the created consignment.
PdfLabelsOptionalPDF labels, Base64 encoded (if requested).
PdfConsignmentOptionalPDF consignment, Base64 encoded (if requested).

PUT — additional properties

PropertyRequiredDescription
IdOptionalTransVirtual Id. Either Id or UniqueId required for a PUT.
NewUniqueIdOptionalOverride the existing UniqueId. Max 200.

DELETE — request properties

PropertyRequiredDescription
IdOptionalTransVirtual Id. Required if UniqueId not provided.
UniqueIdOptionalYour unique key. Required if Id not provided.

Error codes

CodeDescription
1001Invalid TransVirtual number supplied
1002Unknown validation error
1003Consignment already exists
1004Unknown error
1005Sender suburb does not exist
1006Receiver suburb does not exist
1007No line items provided
1008Consignment number missing
1009Date field missing
1010Sender name missing
1011Receiver name missing
1018API consignment creation disabled
1024Consignment is cancelled
1028Customer has disabled API consignment creation

POST only. Adds an additional service to an existing consignment. Must be enabled in API system settings. Each service can only be added once per consignment.

Request properties

PropertyRequiredDescription
ConsignmentNumberOptionalRequired if Id or UniqueId not provided.
IdOptionalRequired if UniqueId or ConsignmentNumber not provided.
UniqueIdOptionalRequired if Id or ConsignmentNumber not provided.
AdditionalServiceNameOptionalName of the additional service.
UserNotesOptionalOptional driver / user notes.
AdditionalServiceChargeRateOverrideOptionalOptional charge override.
AdditionalServiceQtyOverrideOptionalOptional quantity (defaults to 1).
AdditionalServicePickupRelatedOptionalRelates to pickup activity (default false).
AdditionalServiceApprovalRequiredOptionalRequires admin approval (default false).
AdditionalServiceCreatedByOptionalOptionalName of the creator.

Error codes

CodeDescription
1501Unknown error
1502Missing consignment link
1503More than 1 consignment
1504Additional service not found
1505Missing service name
1506Service already exists

POST only. Updates a single field on an existing consignment. Must be enabled in API system settings.

Request properties

PropertyRequiredDescription
ConsignmentNumberOptionalConsignment number. Required if Id, Barcode or UniqueId not provided.
BarcodeOptionalItem barcode. Required if Id, UniqueId or ConsignmentNumber not provided.
IdOptionalTransVirtual Id. Required if UniqueId, Barcode or ConsignmentNumber not provided.
UniqueIdOptionalYour unique key. Required if Id, Barcode or ConsignmentNumber not provided.
FieldOptionalThe field name to update.
ValueOptionalThe new value for the field.

DateTime formatting

TypeFormat
Localyyyy-MM-dd HH:mm  e.g. 2016-05-10 10:30
UTC / ISO-8601yyyy-MM-ddTHH:mm±HH:mm  e.g. 2016-05-10T10:30+10:00

Error codes

CodeDescription
1401Missing field to be updated
1402Unknown error
1403Missing update value
1404Missing valid consignment link number
1405More than 1 consignment discovered

PUT only. Upload general consignment images. The consignment must already exist.

Request properties

PropertyRequiredDescription
ConsignmentNumberOptionalRequired if UniqueId or Id not provided.
IdOptionalRequired if ConsignmentNumber or UniqueId not provided.
UniqueIdOptionalRequired if ConsignmentNumber or Id not provided.
Base64ImageRequiredBase64 encoded image.
ImageTypeOptionalPod, DamagePhoto, ConsignmentPhoto, LeftAsInstructedPhoto, PaperPodPhoto.
DateTimeOptionalImage datetime. Format yyyy-MM-dd HH:mm or ISO-8601.
ImageByOptionalUser that created the image.
UniqueIdImageOptionalYour unique ID for this image.
PickupRelatedOptionalImage relates to the pickup component.

Error codes

CodeDescription
2150Consignment missing
2151Image missing
2152Failed Base64 image conversion

POST only. Inserts additional item rows against an existing consignment on an open customer manifest.

Request properties

PropertyRequiredDescription
NumberOptionalConsignment number. Max 100.
UniqueIdOptionalYour unique key. Max 200.
IdConsignmentOptionalTransVirtual consignment Id.
CustomerNameRequiredCustomer name. Max 200.
CustomerCodeRequiredCustomer account code. Max 20.
ReturnAllPdfLabelsOptional'y' to include all labels in the response.
ReturnNewPdfLabelsOptional'y' to include new labels only in the response.
ReturnPdfConsignmentOptional'y' to include the consignment PDF in the response.

Error codes

CodeDescription
1401Missing item data
1402Unknown error
1403Missing consignment link
1404More than 1 consignment
1405Customer manifest already closed

PUT only. Upload POD images or signatures. The consignment must already exist.

Request properties

PropertyRequiredDescription
ConsignmentNumberOptionalRequired if UniqueId or Id not provided.
IdOptionalRequired if ConsignmentNumber or UniqueId not provided.
UniqueIdOptionalRequired if ConsignmentNumber or Id not provided.
PodTypeOptionalComplete, Rejected, LeftAsInstructed, Short.
Base64PodImageOptionalBase64 encoded full POD image.
Base64SignatureImageOptionalBase64 encoded signature image.
DateTimeOptionalPOD datetime. Format yyyy-MM-dd HH:mm or ISO-8601.
ReceivedByOptionalPerson who signed.
DriverNameOptionalDriver name.
DriverNotesOptionalDriver notes.
RejectedNotesOptionalNotes for rejected consignments.
PodQtySignedForOptionalQuantity signed for.
UniqueIdPodOptionalYour unique ID for this POD.
PickupRelatedOptionalPOD relates to the pickup component.

Error codes

CodeDescription
2100Consignment missing
2101Image missing
2102Failed Base64 POD image conversion
2103Failed Base64 signature conversion
2104POD type missing

POST only. Returns PDF labels and/or the consignment document.

Request properties

PropertyRequiredDescription
ConsignmentNumberOptionalRequired if Barcode not provided.
BarcodeOptionalItem barcode. Required if ConsignmentNumber not provided.
IncludeLabelsPdfOptionalIf true, include the labels PDF in the response.
IncludeConsignmentPdfOptionalIf true, include the consignment PDF in the response.

Error codes

CodeDescription
1301Does not exist
1302No values provided

POST only. Returns static consignment data (sender, receiver, items). Does not return live status information.

Request properties

PropertyRequiredDescription
ConsignmentNumberOptionalRequired if Barcode not provided.
BarcodeOptionalItem barcode. Required if ConsignmentNumber not provided.
IncludeLabelsPdfOptionalIf true, include the labels PDF in the response.
IncludeConsignmentPdfOptionalIf true, include the consignment PDF in the response.

Key response properties

PropertyRequiredDescription
NumberOptionalConsignment / tracking number.
CustomerNameOptionalCustomer name.
SenderNameOptionalSender name.
SenderAddressOptionalSender address line 1.
SenderSuburbOptionalSender suburb.
SenderPostcodeOptionalSender postcode.
SenderStateOptionalSender state.
ReceiverNameOptionalReceiver name.
ReceiverAddressOptionalReceiver address line 1.
ReceiverSuburbOptionalReceiver suburb.
ReceiverPostcodeOptionalReceiver postcode.
ReceiverStateOptionalReceiver state.
SpecialInstructionsOptionalCurrent delivery instructions. Max 500.
ConsignmentPickupSpecialInstructionsOptionalCurrent pickup instructions. Max 500.
SenderReferenceOptionalSender reference.
ReceiverReferenceOptionalReceiver reference.
ConsignmentOtherReferencesOptionalOther references separated by |.
ConsignmentBookingReferenceOptionalDelivery booking reference.
ServiceTypeOptionalService level.
LabelsPdfOptionalBase64 labels PDF (if requested).
ConsignmentPdfOptionalBase64 consignment PDF (if requested).

Error codes

CodeDescription
1301Does not exist
1302No values provided

POST (query status) and PUT (update status).

POST — query status request

PropertyRequiredDescription
NumberRequiredConsignment number.
IdOptionalTransVirtual Id.
UniqueIdOptionalYour unique key.

POST — response properties

PropertyRequiredDescription
IdOptionalTransVirtual Id.
UniqueIdOptionalYour unique key.
ConsignmentNumberOptionalConsignment number.
StatusOptionalCurrent status.
StatusDateTimeOptionalStatus datetime (UTC). Format yyyy-MM-dd HH:mm.
GeoLatitudeOptionalLast known latitude.
GeoLongitudeOptionalLast known longitude.

PUT — update status request

PropertyRequiredDescription
ConsignmentNumberOptionalRequired if UniqueId or Id not provided.
UniqueIdOptionalRequired if ConsignmentNumber or Id not provided.
IdOptionalRequired if ConsignmentNumber or UniqueId not provided.
DateTimeRequiredStatus change datetime. Format yyyy-MM-dd HH:mm or ISO-8601.
StatusRequiredStatus value: InTransit, InDepot, OnDelivery, Delivered.
CommentOptionalDriver notes / comments.
CreatedByOptionalDriver / staff member name.
PickupRelatedOptionalSet if the status relates to the pickup component.

Error codes

CodeDescription
2050Missing status
2051Missing consignment link
2052More than 1 result
2053Does not exist
03

Pricing & reference

POST only. Returns one or more price estimates for a given route. This is an estimate only, not a quote.

Request properties

PropertyRequiredDescription
SenderSuburbRequiredSuburb sending from.
SenderStateRequiredState sending from.
SenderPostcodeRequiredPostcode sending from.
ReceiverSuburbRequiredSuburb sending to.
ReceiverStateRequiredState sending to.
ReceiverPostcodeRequiredPostcode sending to.
CustomerNameRequiredCustomer name (if CustomerCode not provided). Max 200.
CustomerCodeRequiredCustomer code (if CustomerName not provided). Max 20.
ServiceTypeOptionalService level (may be required). Contact XFM for valid values.
DangerousGoodsOptionalSet to 'Y' if dangerous goods.
DimensionsUOMOptionalmm, cm, m, inc, ft, yd. Max 3.
WeightUOMOptionalkgs, oz, lb, ton, tonne. Max 5.
SenderIsResidentialOptional'Y' if residential. Max 1.
ReceiverIsResidentialOptional'Y' if residential. Max 1.
AdditionalServiceListOptionalAdditional services, separated with |.
Estimate only. Prices returned are indicative, not a binding quote. Present them to end-users as estimates.

Error codes

CodeDescription
1001Invalid sender suburb
1002Invalid receiver suburb
1003Invalid customer account
1006Invalid weight (must be > 0)
1007Invalid dimensions (must be > 0)
1011No price found — contact office

POST only. Inserts a new suburb. Recommended to use only when a Consignment POST/PUT returns error 1005 or 1006 (suburb does not exist).

Request properties

PropertyRequiredDescription
SuburbRequiredSuburb name.
PostcodeRequiredCorresponding postcode.
StateOptionalState / province (highly recommended).
CountryRequiredFull country name.

Error codes

CodeDescription
1101Suburb already exists
1102Unknown error
1103Suburb field missing
1104Postcode field missing
1105Country field missing
1106Invalid country name
04

Getting help

This guide covers a curated subset of the platform. If your integration needs something you can't find here, get in touch before improvising — we're happy to help you get it right.

Talk to us before going live. Share your integration plan and a couple of test consignment numbers with your XFM contact and we'll confirm everything is routing correctly. Always quote the TransactionID from any failed response.