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 Parameter | Type | Description |
---|---|---|
ShippingMethod | integer | 1 for DHL 2 for ARAMEX |
Items | Array[ShippingItem], optional | Check the model details after this table |
CityName | string | |
PostalCode | string, optional | |
CountryCode | string |
ShippingItem Model
Input Parameter | Type | Description |
---|---|---|
ProductName | string | |
Description | string | |
Weight | number | 100 >= Weight > 0 Weight in kg |
Width | number | 200 >= Width > 0 Width in cm |
Height | number | 160 >= Height > 0 Height in cm |
Depth | number | 200 >= Depth > 0 Depth in cm |
Quantity | integer | |
UnitPrice | number |
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 Field | Type | Description |
---|---|---|
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
}
}
Updated 10 months ago