Skip to main content
1

Get an API key

Create one in Settings → API Keys (see Authentication).
2

Know your customer's internal id

Use the customer’s business internal id (e.g. ACME), not a UUID.
3

Send a quote request

Post an origin, destination, items, and the customer id(s).

Request a quote

curl https://api.dyspach.com/v1/org/quote/getQuote \
  -H "x-api-key: $DYSPACH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "general": { "customerIds": ["ACME"] },
    "origin": { "postalCode": "2000", "countryCode": "AU" },
    "destination": { "postalCode": "3000", "countryCode": "AU" },
    "items": [
      { "type": "Carton/Box", "quantity": 2, "length": 0.3, "width": 0.3, "height": 0.3, "weight": 10 }
    ]
  }'

Response

Origin, destination and goods are shared; each customer gets a results entry with its priced quotes (one per eligible service — two shown here).
{
  "origin": { "postalCode": "2000", "suburb": "BARANGAROO", "city": "Sydney", "state": "NSW", "stateName": "New South Wales", "countryCode": "AU" },
  "destination": { "postalCode": "3000", "suburb": "MELBOURNE", "city": "Melbourne", "state": "VIC", "stateName": "Victoria", "countryCode": "AU" },
  "goods": [
    { "type": "Carton/Box", "quantity": 2, "length": 30, "width": 30, "height": 30, "weight": 10, "chargeableWeight": 20 }
  ],
  "results": [
    {
      "customerId": "ACME",
      "quoteId": "K541037RNBUQ",
      "noQuoteMessage": "",
      "quotes": [
        {
          "rateId": "7cd6c7cf-84af-419d-b34d-6d270cc809ee",
          "serviceName": "Falcon Freight",
          "serviceId": "FALCON",
          "rateCardName": "Falcon Standard",
          "rateCardId": "FALCON_STD",
          "isSpotRate": false,
          "spotRateMessage": "",
          "amount": 10,
          "totalAmount": 19.8,
          "gstAmount": 1.8,
          "deliveryTime": "1 - 5 business day(s)",
          "minTransitTime": 1,
          "maxTransitTime": 5,
          "transitTimeUnit": "D",
          "surcharges": [
            { "name": "Remote Location", "description": "Remote Location", "key": "Remote Location", "amount": 8 }
          ]
        },
        {
          "rateId": "ba9bc08c-0238-4c88-aff5-b4f26aaab790",
          "serviceName": "Zephyr Couriers",
          "serviceId": "ZEPHYR",
          "rateCardName": "Zephyr Express",
          "rateCardId": "ZEPHYR_EXP",
          "isSpotRate": false,
          "spotRateMessage": "",
          "amount": 9,
          "totalAmount": 11.09,
          "gstAmount": 1.01,
          "deliveryTime": "0 - 0 business day(s)",
          "minTransitTime": 0,
          "maxTransitTime": 0,
          "transitTimeUnit": "D",
          "surcharges": [
            { "name": "Fuel Surcharge", "description": "Fuel Surcharge", "key": "FUEL", "amount": 1.08 }
          ]
        }
      ]
    }
  ]
}
amount is the freight sell price; totalAmount is the total including surcharges and GST. Every money field is a number.

Quote for multiple customers

Pass more than one id — you get a results entry per customer:
{ "general": { "customerIds": ["ACME", "GLOBEX"] }, "origin": { "...": "..." } }

Narrow the results

Add a filters block to restrict which services or rate cards are priced:
{
  "general": { "customerIds": ["ACME"] },
  "origin": { "postalCode": "2000", "countryCode": "AU" },
  "destination": { "postalCode": "3000", "countryCode": "AU" },
  "items": [{ "type": "Carton/Box", "quantity": 2, "length": 0.3, "width": 0.3, "height": 0.3, "weight": 10 }],
  "filters": { "serviceIds": ["ZEPHYR", "FALCON"] }
}
See Filters for every dimension.

Fetch a quote later

Use the quoteId from any result:
curl https://api.dyspach.com/v1/org/quote/getQuote/K541037RNBUQ \
  -H "x-api-key: $DYSPACH_API_KEY"