Skip to content

Rates

Shipping rates

Quote what a shipment costs before your customer buys. The numbers come from the same calculator the Wasil app uses, so a quote here and a quote in the app are the same.

GET /v1/cities rates module

The Iraqi cities Wasil delivers to, with the home-delivery fee of each. You need a city's id to ask for a quote.

Answer
{
  "data": [
    { "id": 1, "name": "Erbil", "region": "Erbil", "delivery_fee": 3000, "currency": "IQD" },
    { "id": 7, "name": "Baghdad", "region": "Baghdad", "delivery_fee": 5000, "currency": "IQD" }
  ]
}
POST /v1/rates/quote rates module
FieldTypeMeaning
origintext, requiredOrigin code from GET /v1/hubs, for example ger or usa.
weight_kgnumber, requiredThe weight in kilograms. Always kilograms, for every origin.
length_cm, width_cm, height_cmnumberThe size in centimetres. Send all three or none. Needed for sea origins; for the others they let the quote account for bulky parcels.
city_idnumber, requiredDestination city, from GET /v1/cities.
deliverytrue / falseAdd delivery to the customer's door. Default false (pickup at the Wasil office).
dangeroustrue / falseDangerous goods (batteries, perfume, …), which have their own prices. Default false.
Request
curl -X POST https://api.wasil-iq.com/v1/rates/quote \
  -H "Authorization: Bearer $WASIL_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "origin": "ger",
    "weight_kg": 2.3,
    "length_cm": 30,
    "width_cm": 20,
    "height_cm": 15,
    "city_id": 1,
    "delivery": true
  }'
Answer
{
  "data": {
    "origin": { "code": "ger", "name": "Germany" },
    "city": { "id": 1, "name": "Erbil" },
    "currency": "IQD",
    "delivery": true,
    "dangerous": false,
    "delivery_fee": 3000,
    "size_affects_price": false,
    "sized": true,
    "shipping_method": "land",
    "transit_days": { "from": 20, "to": 25 },
    "quotes": [
      { "membership": "standard", "available": true, "price": 37500, "total": 40500, "chargeable_weight": 2.5, "weight_unit": "KG", "basis": "actual" },
      { "membership": "plus",     "available": true, "price": 32500, "total": 35500, "chargeable_weight": 2.5, "weight_unit": "KG", "basis": "actual" },
      { "membership": "business", "available": true, "price": 30000, "total": 33000, "chargeable_weight": 2.5, "weight_unit": "KG", "basis": "actual" }
    ]
  }
}

Reading the answer

  • There is one quote per Wasil membership (standard, plus, business). Show the one your customer has; if you do not know it, show standard.
  • price is the shipping price; total adds delivery_fee when you asked for delivery. Both are whole amounts in currency.
  • available: false (with price and total null) means there is no price for that weight on that origin and membership. Do not show a price.
  • chargeable_weight is the weight the price is based on, after rounding and, for bulky parcels, after the size is taken into account. basis says which: actual, volumetric or oversize.
  • weight_unit is the unit that origin is priced in: KG, LB for the USA, CBM (cubic metres) for sea freight. You always send kilograms and centimetres; the API converts.
  • transit_days is the usual number of days from the origin warehouse to Iraq.

Weight-only quotes

Some origins (the USA, sea freight, and air from China and India) charge a bulky parcel by its size rather than its weight. The answer tells you whether that applies and whether you gave the size:

  • size_affects_price: true when this origin's price can depend on the size.
  • sized: true when you sent the three dimensions.

When size_affects_price is true and sized is false, the quote assumes a compact parcel and the real price can be higher. Show it as a "from" price, or ask for the size and quote again. Sea origins cannot be quoted without the size at all.

A quote is an estimate for the weight and size you send. The charge is made on what the warehouse measures when the package arrives.

Related: origins.