API documentation
Base URL: https://freight.eflowsoft.com.au/api/v1. All responses are JSON. Prices are in AUD and include GST.
Authentication
Create a key on the API keys page and send it in the Authorization header. Keys are never accepted in the URL. Call the API from your server, not from a browser, so the key stays private.
curl https://freight.eflowsoft.com.au/api/v1/balance \ -H "Authorization: Bearer efk_live_your_key_here"
List services for a parcel
GET /api/v1/services returns every service available between two postcodes for a carton, cheapest first. Costs 1 credit.
| Parameter | Required | Description |
|---|---|---|
from_postcode | Yes | 4-digit origin postcode |
to_postcode | Yes | 4-digit destination postcode |
length, width, height | Yes | Centimetres, up to 105 each and 0.25 m³ in total |
weight | Yes | Kilograms, up to 22 |
curl -G https://freight.eflowsoft.com.au/api/v1/services \ -H "Authorization: Bearer $KEY" \ -d from_postcode=2000 -d to_postcode=3000 \ -d length=30 -d width=20 -d height=15 -d weight=2
{
"services": [
{ "service": "standard", "name": "Standard Parcel", "speed": "standard", "price": 16.15,
"currency": "AUD", "gst_included": true, "max_extra_cover": 5000,
"options": [ { "option": "signature", "name": "Signature on delivery", "price": 3.95 } ] },
{ "service": "express", "name": "Express Parcel", "speed": "express", "price": 21.85, ... }
],
"credits": { "charged": 1, "remaining": 4998 }
}
Get a quote for one service
GET /api/v1/quote takes the same parameters plus a service. Costs 1 credit.
| Parameter | Required | Description |
|---|---|---|
service | Yes | A service code, such as standard or express |
signature | No | 1 to add signature on delivery |
extra_cover | No | Whole dollars of cover, 1 to 5000. Adds signature on delivery automatically. |
curl -G https://freight.eflowsoft.com.au/api/v1/quote \ -H "Authorization: Bearer $KEY" \ -d service=express -d from_postcode=2000 -d to_postcode=3000 \ -d length=30 -d width=20 -d height=15 -d weight=2
{
"quote": {
"service": "express", "name": "Express Parcel", "speed": "express",
"total": 21.85, "currency": "AUD", "gst_included": true,
"delivery_estimate": "Delivered in up to 2 business days",
"breakdown": [ { "item": "Express Parcel", "cost": 21.85 } ]
},
"credits": { "charged": 1, "remaining": 4997 }
}
PHP example:
$ch = curl_init('https://freight.eflowsoft.com.au/api/v1/quote?' . http_build_query([
'service' => 'standard', 'from_postcode' => '2000', 'to_postcode' => '3000',
'length' => 30, 'width' => 20, 'height' => 15, 'weight' => 2,
]));
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('FREIGHT_API_KEY')],
CURLOPT_TIMEOUT => 15,
]);
$quote = json_decode(curl_exec($ch), true);
Check your balance
GET /api/v1/balance is free. Every billable response also carries an X-Credits-Remaining header.
{ "balance": 4997, "account_status": "active" }
Service codes
Use these in service. /services tells you which ones are available for a given parcel and route. A service without a friendly name yet appears with a svc_ prefix and can be used exactly as returned.
| Code | Name | Speed |
|---|---|---|
standard | Standard Parcel | standard |
express | Express Parcel | express |
courier | Priority Courier | priority |
standard_satchel_s | Standard Satchel - Small | standard |
standard_satchel_m | Standard Satchel - Medium | standard |
standard_satchel_l | Standard Satchel - Large | standard |
standard_satchel_xl | Standard Satchel - Extra Large | standard |
express_satchel_s | Express Satchel - Small | express |
express_satchel_m | Express Satchel - Medium | express |
express_satchel_l | Express Satchel - Large | express |
express_satchel_xl | Express Satchel - Extra Large | express |
standard_satchel_500g | Standard Satchel - 500 g | standard |
standard_satchel_3kg | Standard Satchel - 3 kg | standard |
standard_satchel_5kg | Standard Satchel - 5 kg | standard |
express_satchel_500g | Express Satchel - 500 g | express |
express_satchel_3kg | Express Satchel - 3 kg | express |
express_satchel_5kg | Express Satchel - 5 kg | express |
Errors
Errors look like {"error": {"code": "...", "message": "..."}}. Only a successful quote uses a credit.
| Status | Code | Meaning |
|---|---|---|
| 401 | invalid_api_key | Missing, unknown or revoked key |
| 402 | insufficient_credits | No credits left. Buy a bundle. |
| 403 | account_suspended | The account is suspended |
| 422 | validation_failed | A parameter is missing or out of range. fields lists which. |
| 422 | not_available | That service isn't offered for this parcel or route |
| 429 | rate_limited | More than 60 requests per minute on one key |
| 502 | upstream_unavailable | Rates are temporarily unavailable. Retry shortly. |
Billing
Each successful /services or /quote response costs 1 credit. Identical requests may be answered from a short cache; they still count as a call. Account admins get an email when 75% of the latest top-up has been used, and another if credits run out.