# Rate Calculator

## Rate Calculator

<mark style="color:green;">`POST`</mark> [https://{domain}/shipping/api/v1/calculate/rate](https://blackberrys.myeshopbox.com/shipping/api/v1/calculate/rate)

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name                   | Mandatory                                                               | Type    | Description                                                                                    |
| ---------------------- | ----------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------- |
| journeyType            | yes                                                                     | string  | Specifies the type of journey, can be either 'forward' or 'reverse'.                           |
| pickupPincode          | yes                                                                     | number  | The postal code of the pickup location.                                                        |
| dropPincode            | yes                                                                     | string  | The postal code of the drop-off location.                                                      |
| orderWeight            | yes                                                                     | number  | The weight of the order in the specified unit (in grams).                                      |
| length                 | yes                                                                     | number  | The length of the package in the specified unit (in cm).                                       |
| width                  | yes                                                                     | number  | The width of the package in the specified unit (in cm).                                        |
| height                 | yes                                                                     | number  | The height of the package in the specified unit (in cm).                                       |
| paymentMethod          | yes                                                                     | string  | The payment method, can be either 'Cash on delivery' or 'Prepaid'.                             |
| codAmountToBeCollected | <p>yes<br>(applicable only when paymentMethod is 'Cash on delivery'</p> | number  | The amount to be collected in case of Cash on Delivery (COD) orders.                           |
| doorstepQc             | <p>No<br>(applicable only when journeyType is 'reverse')</p>            | boolean | Indicates whether a doorstep quality check is required. Set to 'true' for returns if required. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "zone": "Local",
  "essentialPlan": {
    "eshopboxPrime": {
      "shippingBaseFreight": 96,
      "expressSurcharge": 0,
      "COD collection fees": 0,
      "reverseShippingFees": 0,
      "fuelSurcharge": 0,
      "Doorstep QC fees": 0,
      "gst": 17.28,
      "totalShippingCharges": 113.28,
      "estimatedDeliveryDays": 1,
      "chargeableWeight": "1000.0",
      "isServiceable": 1
    },
    "eshopboxExpress": {
      "shippingBaseFreight": 0,
      "expressSurcharge": 85,
      "COD collection fees": 0,
      "reverseShippingFees": 0,
      "fuelSurcharge": 0,
      "Doorstep QC fees": 0,
      "gst": 15.3,
      "totalShippingCharges": 100.3,
      "estimatedDeliveryDays": 2,
      "chargeableWeight": "1000.0",
      "isServiceable": 1
    },
    "eshopboxStandard": {
      "shippingBaseFreight": 66,
      "expressSurcharge": 0,
      "COD collection fees": 0,
      "reverseShippingFees": 0,
      "fuelSurcharge": 0,
      "Doorstep QC fees": 0,
      "gst": 11.88,
      "totalShippingCharges": 77.88,
      "estimatedDeliveryDays": 3,
      "chargeableWeight": "1000.0",
      "isServiceable": 1
    }
  }
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "error": {
        "errors": [
            {
                "message": "Order weight cannot be blank"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

```

curl --location 'https://{domain}/shipping/api/v1/calculate/rate' \
--header 'Authorization: Bearer <>' \
--header 'Content-Type: application/json' \
--data '{
    "journeyType": "forward",
    "pickupPincode": "560034",
    "dropPincode": "560034",
    "orderWeight": "5",
    "length": "12",
    "width": "12",
    "height": "33",
    "paymentMethod": "Cash on delivery",
    "codAmountToBeCollected": 100.0,
    "doorstepQc": false
}'
```
