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.
/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.
{
"data": [
{ "id": 1, "name": "Erbil", "region": "Erbil", "delivery_fee": 3000, "currency": "IQD" },
{ "id": 7, "name": "Baghdad", "region": "Baghdad", "delivery_fee": 5000, "currency": "IQD" }
]
}
/v1/rates/quote
rates module
| Field | Type | Meaning |
|---|---|---|
origin | text, required | Origin code from GET /v1/hubs, for example ger or usa. |
weight_kg | number, required | The weight in kilograms. Always kilograms, for every origin. |
length_cm, width_cm, height_cm | number | The size in centimetres. Send all three or none. Needed for sea origins; for the others they let the quote account for bulky parcels. |
city_id | number, required | Destination city, from GET /v1/cities. |
delivery | true / false | Add delivery to the customer's door. Default false (pickup at the Wasil office). |
dangerous | true / false | Dangerous goods (batteries, perfume, …), which have their own prices. Default false. |
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
}'
{
"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, showstandard. priceis the shipping price;totaladdsdelivery_feewhen you asked for delivery. Both are whole amounts incurrency.available: false(withpriceandtotalnull) means there is no price for that weight on that origin and membership. Do not show a price.chargeable_weightis the weight the price is based on, after rounding and, for bulky parcels, after the size is taken into account.basissays which:actual,volumetricoroversize.weight_unitis the unit that origin is priced in:KG,LBfor the USA,CBM(cubic metres) for sea freight. You always send kilograms and centimetres; the API converts.transit_daysis 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:truewhen this origin's price can depend on the size.sized:truewhen 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.