Calculate shipping cost - Grasshopper Labs API
Shipping

Calculate cost

Get a cost and transit-time estimate without creating an order. Useful for cart and checkout previews.

POST /api/shipping/calculate/

Body parameters

origin
object Required
Origin location. Object with zip at minimum.
destination
object Required
Destination location. Object with zip at minimum.
service_level
string Required
Service level code. See Service levels.
wgthrcurbb2bexp
items
array Required
Array of items. Each must have weight and cube.
items[].weight
number Required
Item weight in pounds.
items[].cube
number Required
Item volume in cubic feet.
items[].quantity
integer Required
Quantity of this item.
curl -X POST https://{licensee-url}/api/shipping/calculate/ \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "origin": { "zip": "30303" },
    "destination": { "zip": "78701" },
    "service_level": "wg",
    "items": [
      { "weight": 150, "cube": 35, "quantity": 1 }
    ]
  }'
{
  "cost": {
    "total": 325.50,
    "currency": "USD",
    "breakdown": {
      "linehaul": 220.00,
      "service_premium": 85.00,
      "fuel_surcharge": 20.50
    }
  },
  "transit": {
    "min_days": 5,
    "max_days": 8,
    "earliest_delivery": "2026-05-19"
  }
}
Try it out
Response will appear here

Errors

Statuserror.codeCause
422zip_not_coveredDestination ZIP is not in the coverage network for this service level.
422items_requiredAt least one item with weight and cube must be provided.