Calculate Fee

API Calculate Fee


This API can help Shop/Merchant get the shipping fee and provide to buyer before create shipping order by

input some information such as Weight,Height,length,width ,to_district_ID, to_ward_code, Service_ID.

Caution : The API Order Info need to infusion token in ShopId header

curl --location --request POST '' \
--header 'Content-Type: application/json' \
--header 'Token: 637170d5-942b-11ea-9821-0281a26fb5d4' \
--header 'ShopId: 885' \
--header 'Content-Type: text/plain' \
--data-raw '{
"coupon": null


Field Type Description
token String

Must be sent with all client requests. This Token helps server to validate request source. Provided by GHN.

shop_id Int

Manage information for shop/seller

service_id Int

Choose which Sevice ID suitable with your shipping plan (Express, Standard or Saving). Each Service ID has different fee and leadtime. Use API Get service (if not input service_type_id)

service_type_id Int

Input value : 1 or  2 ( 1: Express or 2: Standard, if not input service_id)

insurance_value Int

Use to declare parcel value. GHN will base on this value for compensation if any unexpected things happen (lost, broken...).

Maximum 10.000.000

Default value: 0

coupon String

Coupon Code for discount.

from_district_id Int

District ID pick up parcels.Use API Get District

to_ward_code String

Ward Code pick up parcels.Use API Get Ward

to_district_id Int

District ID drop off parcels.Use API Get District

weight Int

Weight (gram)

length Int

Length (cm)

width Int

width (cm)

height Int

height (cm)

    "code": 200,
    "message": "Success",
    "code": 400,
    "message": "code=400, message=Syntax error: offset=30, error=invalid character '}' after array element, internal=invalid character '}' after array element",
    "data": null
    "code_message": "USER_ERR_COMMON"