Get Rate

Get Rate

The Wallet endpoint allows you to get the Wallet balance details of your Gratero account.

Parameters

ParamsTypeMandatoryDescription
shipment_typestringYesShipment type 'forward' or 'reverse'
payment_modestringYesPayment method of shipment (cod or prepaid).
pickupintegerYesPincode of warehouse address. Must be 6 digits
deliveryintegerYesPincode of customer address. Must be 6 digits
lengthintegerYesLength of shipment in cms. Must be more than 1
breadthintegerYesBreadth of shipment in cms. Must be more than 1
heightintegerYesHeight of shipment in cms. Must be more than 1
actual_weightintegerYesWeight of shipment in kgs
amountintegerYesTotal amount of order

Example

Request

JSON
{
  "shipment_type": "forward",
  "payment_mode": "prepaid",
  "pickup": 226001,
  "delivery": 226011,
  "length": 14,
  "breadth": 11,
  "height": 17,
  "actual_weight": 0.56,
  "amount": 200,
}

Response

JSON
{
  "success": true,
  "logistics": [
      {
        "id": 1,
        "type": "surface",
        "name": "Delhivery",
        "chargeable_weight": "1 KG",
        "freight_charges": 99.32,
        "cod_charges": 0,
        "total_charges": 99.32,
        "zone": "A",
        "edd": "1 - 3",
      },
      {
        "id": 2,
        "type": "surface",
        "name": "Xpressbees",
        "chargeable_weight": "1 KG",
        "freight_charges": 99.32,
        "cod_charges": 0,
        "total_charges": 99.32,
        "zone": "A",
        "edd": "1 - 3",
      },
    ],
    "total_logistics": 2,
}

Code

import { Instance } from "gratero";
 
const gratero = new Instance({
  api_key: "YOUR_API_KEY",
  secret_key: "YOUR_SECRET_KEY",
  environment: 'test'
});
 
gratero.calculateRate({
  order_type: "forward",
})
   .then(data => console.log(data))
   .catch(error => console.log(error))