Estimate a Rate

warning

Only an Estimate!

Estimating a rate will not yield an exact rate quote, to retrieve an actual rate quote that you can use with a Shipment, you should Get Shipping Rates.

Remember, estimates don't include things like insurance_amount and may not include other_amount (such as fuel surcharges, customs charges, or other carrier-imposed fees).

Estimating rates is important for many API consumers who want to offset their shipping cost to their customer. ShipEngine can provide a good estimate by using:

  • Postal Code To
  • Postal Code From
  • Weight
  • Dimensions (optional)

You can then pass the cost estimate onto your customer, to be added to their cart at checkout.

Example

POST /v1/rates/estimate

curl -iX POST https://api.shipengine.com/v1/rates/estimate \
-H 'API-Key: __YOUR_API_KEY_HERE__' \
-H 'Content-Type: application/json' \
-d '
{
  "carrier_ids": [
    "se-123890"
  ],
  "from_country_code": "US",
  "from_postal_code": "78756",
  "to_country_code": "US",
  "to_postal_code": "95128",
  "to_city_locality": "San Jose",
  "to_state_province": "CA",
  "weight": {
    "value": 1.0,
    "unit": "ounce"
  },
  "dimensions": {
    "unit": "inch",
    "length": 5.0,
    "width": 5.0,
    "height": 5.0
  },
  "confirmation": "none",
  "address_residential_indicator": "no"
}'
  • curl

Since these are long responses, we've truncated it to only show one rate estimate.

[
  {
    "rate_type": "check",
    "carrier_id": "se-123890",
    "shipping_amount": {
      "currency": "usd",
      "amount": 0.46
    },
    "insurance_amount": {
      "currency": "usd",
      "amount": 0.0
    },
    "confirmation_amount": {
      "currency": "usd",
      "amount": 0.0
    },
    "other_amount": {
      "currency": "usd",
      "amount": 0.0
    },
    "zone": 6,
    "package_type": "letter",
    "delivery_days": 3,
    "guaranteed_service": false,
    "estimated_delivery_date": "2019-07-25T05:00:00.000Z",
    "carrier_delivery_days": "3",
    "ship_date": "2019-07-25T05:00:00.000ZPlus3$",
    "negotiated_rate": false,
    "service_type": "USPS First Class Mail",
    "service_code": "usps_first_class_mail",
    "trackable": true,
    "validation_status": "unknown",
    "warning_messages": [],
    "error_messages": [],
    "carrier_code": "stamps_com",
    "carrier_nickname": "Free",
    "carrier_friendly_name": "Stamps.com"
  }
]