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 Require Type Description
token X String

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

shop_id X Int

Manage information for shop/seller

service_id   Int

Call API SERVICE to show service.
If not input service_type_id

service_type_id   Int

Call API SERVICE to show service.

Default value:  2:E-Commerce Delivery

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 5.000.000

Default value: 0

coupon   String

Coupon Code for discount.

cod_failed_amount   Int

Value of collect money when delivery fail

from_district_id   Int

District ID pick up parcels.Use API Get District

If you not input , will get information from shopid

from_ward_code   String

Ward code pick up parcels.Use API Get Ward

If you not input , will get information from shopid

to_ward_code X String

Ward Code pick up parcels.Use API Get Ward

to_district_id X 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)

cod_value   Int

Amount cash to collect.

Maximum 5.000.000

Default value: 0

                "code": 200,
                "message": "Success",

Structure Response

Field Description

Total service


Service fee


Insurance fee


Pickup fee at Station


Coupon Code for discount


Fee of delivery parcel again


Fee of document return


Fee of check together


Fee of collection COD


Fee of pick remote areas


Fee of delivery remote areas


Fee of collection money when delivery fail

                "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"