Skip to main content

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

ParamsRequiredData TypeDescription
invoice_valueNoStringInvoice value. Default 0
pickup_pincodeYesStringPickup pincode of shipment
weightYesIntegerWeight of shipment in grams
dimensionsYesObjectDimensions of courier
dimensions.lengthYesIntegerLength in cm
dimensions.breadthYesIntegerBreadth in cm
dimensions.heightYesIntegerHeight in cm
pincodeYesStringDestination pincode of shipment
cityNoStringDestination City of Shipper
stateNoStringDestination State of Shipper
pickup_dateNoStringPickup date of shipment. Default TODAY
paymentYesStringPREPAID / COD
shipment_typeNoStringsurface / 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

ParamsData TypeDescription
ratesObjectObject containing the rates of all serviceable couriers
rates[i].carrierStringCarrier company name
rates[i].pincodeBooleanPincode serviceability of carrier
rates[i].indexIntegerIndex number
rates[i].zoneStringZone type of shipment
rates[i].priceFloatTotal price of shipment
rates[i].eddStringExpected delivery date. dd-MM-yyyy
rates[i].carrier_nameStringCarrier name
rates[i].freight_chargeFloatFreight charges of shipment
rates[i].cod_chargesFloatCOD charges of shipment
rates[i].modeInteger
  • 0: surface
  • 1: express/air
custom_courier_ratesObjectObject 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": []
}