CalculateShippingCharge

Endpoint

Overview

The "CalculateShippingCharge" endpoint is a POST request. It is used to calculate the charge of the Shipping supported by the MyFatoorah Shipping Module that belongs to either DHL or ARAMEX. You should provide the CityName and CountryCode parameters which will be retrieved by the GetCities and GetCountries endpoints respectively. Detailed functionality of how to use this endpoint is explained in the Shipping section.

The endpoint on Swagger is: Shipping_CalculateShippingCharge.

Now, we are going to declare the endpoint and its models along with each accepted parameter and possible value.

📘

Request Header

Add "Authorization": "Bearer {Token}" to request header. Token of demo configuration can be found here.


Request Model

The request is a POST request with the following parameters:

Input ParameterTypeDescription
ShippingMethodinteger1 for DHL
2 for ARAMEX
ItemsArray[ShippingItem], optionalCheck the model details after this table
CityNamestring
PostalCodestring, optional
CountryCodestring

ShippingItem Model

Input ParameterTypeDescription
ProductNamestring
Descriptionstring
Weightnumber100 >= Weight > 0
Weight in kg
Widthnumber200 >= Width > 0
Width in cm
Heightnumber160 >= Height > 0
Height in cm
Depthnumber200 >= Depth > 0
Depth in cm
Quantityinteger
UnitPricenumber

Response Model

After viewing the Response Model that you will get as a result of your request, here, you will find full details about the Data Model of this API endpoint. Let's check it and its contents.

Response FieldTypeDescription
Currency string
Fees number

Sample Message

{
  "ShippingMethod": 1,
  "Items": [
    {
      "ProductName": "name",
      "Description": "name",
      "Weight": 0.5,
      "Width": 10,
      "Height": 15,
      "Depth": 19,
      "Quantity": 20,
      "UnitPrice": 5
    }
  ],
  "CityName": "DUBAI",
  "PostalCode": "12345",
  "CountryCode": "AE"
}
{
    "IsSuccess": true,
    "Message": null,
    "FieldsErrors": null,
    "Data": {
        "Currency": "KD",
        "Fees": 29.993
    }
}