Serviceability / Rate Calculator
The Serviceability and Rate Calculator API Route will check the pincode serviceability and rates for the same.
You have to pass all the required params at the minimum to check the pincode serviceability. You can add additional parameters as per your preference.
Request
POST REQUEST
https://api.openleaf.tech/api/v1/pricing/rateCalculator
| Params | Required | Data Type | Description |
|---|---|---|---|
| invoice_value | No | String | Invoice value. Default 0 |
| pickup_pincode | Yes | String | Pickup pincode of shipment |
| weight | Yes | Integer | Weight of shipment in grams |
| dimensions | Yes | Object | Dimensions of courier |
| dimensions.length | Yes | Integer | Length in cm |
| dimensions.breadth | Yes | Integer | Breadth in cm |
| dimensions.height | Yes | Integer | Height in cm |
| pincode | Yes | String | Destination pincode of shipment |
| city | No | String | Destination City of Shipper |
| state | No | String | Destination State of Shipper |
| pickup_date | No | String | Pickup date of shipment. Default TODAY |
| payment | Yes | String | PREPAID / COD |
| shipment_type | No | String | surface / express. Default surface |
Header Example
{
"Authorization": "Bearer {{your_token}}",
"Content-Type": "application/json"
}
Request Example
{
"invoice_value": "2499",
"pickup_pincode": "400052",
"weight": 200,
"dimensions": {
"length": 10,
"breadth": 10,
"height": 10
},
"pincode": 400022,
"city": "Mumbai",
"state": "Maharashtra",
"pickup_date": "2024-08-13",
"payment": "PREPAID",
"shipment_type": "surface"
}
Response
| Params | Data Type | Description |
|---|---|---|
| rates | Object | Object containing the rates of all serviceable couriers |
| rates[i].carrier | String | Carrier company name |
| rates[i].pincode | Boolean | Pincode serviceability of carrier |
| rates[i].index | Integer | Index number |
| rates[i].zone | String | Zone type of shipment |
| rates[i].price | Float | Total price of shipment |
| rates[i].edd | String | Expected delivery date. dd-MM-yyyy |
| rates[i].carrier_name | String | Carrier name |
| rates[i].freight_charge | Float | Freight charges of shipment |
| rates[i].cod_charges | Float | COD charges of shipment |
| rates[i].mode | Integer |
|
| custom_courier_rates | Object | Object containing the rates of all custom added couriers |
Serviceable Response Example
{
"rates": [
{
"index": 0,
"carrier": "delhivery",
"carrier_name": "Delhivery 2 Kg",
"cod_charges": 20
"price": 91.62,
"freight_charge": 71.62,
"mode": 0,
"zone": "intra_region",
"courier_company_id": 32,
"edd": "28-08-2024",
"pincode": true,
},
{
"index": 1,
"carrier": "amazon",
"carrier_name": "Amazon 2 Kg",
"price": 120,
"cod_charges": 15,
"freight_charge": 105,
"mode": 0,
"zone": "intra_region",
"courier_company_id": 32,
"edd": "29-08-2024",
"pincode": true
}
],
"custom_courier_rates": []
}
Non-Serviceable Response Example
{
"rates": [],
"custom_courier_rates": []
}
Error Response Example
{
"status": {
"message": "There was an error while adding the pickup location",
"status_code": 500,
"success": false
}
}
Example
Curl Command
curl --location --request POST 'https://api.openleaf.tech/api/v1/pricing/rateCalculator' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data-raw '{
"invoice_value": "2499",
"pickup_pincode": "400052",
"weight": 200,
"dimensions": {
"length": 10,
"breadth": 10,
"height": 10
},
"pincode": 400022,
"city": "Mumbai",
"state": "Maharashtra",
"pickup_date": "2024-08-13",
"payment": "PREPAID",
"shipment_type": "surface"
}'
Output:
{
"rates": [
{
"index": 0,
"carrier": "delhivery",
"carrier_name": "Delhivery 2 Kg",
"cod_charges": 20
"price": 91.62,
"freight_charge": 71.62,
"mode": 0,
"zone": "intra_region",
"courier_company_id": 32,
"edd": "28-08-2024",
"pincode": true,
},
{
"index": 1,
"carrier": "amazon",
"carrier_name": "Amazon 2 Kg",
"price": 120,
"cod_charges": 15,
"freight_charge": 105,
"mode": 0,
"zone": "intra_region",
"courier_company_id": 32,
"edd": "29-08-2024",
"pincode": true
}
],
"custom_courier_rates": []
}