Tax & Duty Quote API


  • HOST
  • STAGING https://stage.tradeglobal.com
  • PRODUCTION https://services.tradeglobal.com


The Tax & Duty Quote API is designed for those merchants who are looking to leverage TradeGlobal's technology to obtain a tax and duty quote calculation. This API enables merchants to obtain tax and duty quotes from "anywhere to anywhere" and recognizes all free trade agreements for these countries. To obtain a successful tax and duty calculation, the merchant will need to pass the following information in the POST request:


  • Product SKU
  • Product Quantity
  • Unit Price of the product
  • Country of Origin of the product
  • Assigned harmonized tariff code
  • Ship From country
  • Ship To country
  • State/Province and/or Postal Code of the destination if applicable

Note... If you are unable to pass product attributes such as country of origin or HSCode at time of quote, our system can retrieve the attribute information. However, you will need to upload the data for each product using the Product API.


The follow information below will walk you through how to integrate this API.

Available Countries

TGC is able to quote duties and taxes for 64 countries. Below is a listing of available countries.

  • Australia (AU)
  • Austria (AT)
  • Bahamas (BS)
  • Baharain (BH)
  • Belgium (BE)
  • Brazil (BR)
  • Canada (CA)
  • Chile (CL)
  • China (CN)
  • Colombia (CO)
  • Czech Republic (CZ)
  • Denmark (DK)
  • Dominica (DM)
  • Dominican Republic (DO)
  • Ecuador (EC)
  • Egypt (EG)
  • Estonia (EE)
  • Finland (FI)
  • France (FR)
  • Germany (DE)
  • Greece (GR)
  • Honduras (HN)
  • Hong Kong (HK)
  • Hungary (HU)
  • Iceland (IS)
  • India (IN)
  • Indonesia (ID)
  • Israel (IL)
  • Italy (IT)
  • Japan (JP)
  • Jordan (JO)
  • Korea, South (KR)
  • Kuwait (KW)
  • Latvia (LV)
  • Liechtenstein (LI)
  • Lithuania (LT)
  • Luxembourg (LU)
  • Malaysia (MY)
  • Malta (MT)
  • Mexico (MX)
  • Netherlands (NL)
  • New Zealand (NZ)
  • Norway (NO)
  • Norway (NO)
  • Panama (PA)
  • Philippines (PH)
  • Poland (PL)
  • Portugal (PT)
  • Saudi Arabia (SA)
  • Singapore (SG)
  • Slovakia (SK)
  • Slovenia (SI)
  • South Africa (ZA)
  • Spain (ES)
  • Sweden (SE)
  • Switzerland (CH)
  • Taiwan (TW)
  • Thailand (TH)
  • Turkey (TR)
  • United Arab Emirates (AE)
  • United Kingdom (GB)
  • Uruguay (UY)
  • Venezuela (VE)
  • Vietnam (VN)

Request (Y=Yes, N=No, C=Conditional, N/A=Not Applicable)


Authorization Required

To access this resources' endpoints you will need to provice your Access Token provided to you by TradeGlobal in the Authorization header.


Tax & Duty Quote requests are supported by the HTTP POST method. Create a POST request by adding the parameters in the HTTP request entity body using the application/json media type. The request URL must conform to the following specifications:

Node Required Description Data Type Length Values
merchantCode Y Unique identifier for merchant string 20 This is assigned when TradeGlobal provides API credentials
exchange Y Exchange Object containing currency code and exchange rate attributes Object
CurrencyCode Y Indicates the currency of prices passed in the request string 10 Use a valid three character currency code
ExchangeRate C If the currency code is set to USD the exchange rate will be set to 1. Otherwise, if left null, the exchange rate will be set to the rate stored in TradeGlobal Commerce for the given currency code. decimal(18,4)
itinerary C Object containing shipping costs. If retrieving duty and tax quotes, pass this object populating with the shipping costs. If left null, the servie will calculate a fully landed cost quote calculating shipping, duty, and tax charges. Object
totalFreight C Total shipping cost for the given package. Only required when trying to retriee duty and taxes. Values must be greater than zero. decimal (18,4)
totalInsurance N Carrier insurance charges for the given package decimal (18,4) Default value 0
serviceCode N Identifier indicating the selected shipping service. string 50
carrierCode N Identifier indicating the selected shipping carrier. string 20
cartItems Y Collection of cart items contained in the cart Array At least one cart item is required.
sku Y Product identifier string 100
quantity Y Quantity of the given SKU. Must be greater than zero integer
price Y Unit price decimal (18,4)
hsCode C Harmonized Tariff Code for the given item. Is not required if your product data is stored in TradeGlobal Commerce (TGC). If you have not loaded your product data into TGC, you must pass a valid HSCode. string 25
countryOfOrigin C Origin country where the product is from. Is not required if your product data is stored in TradeGlobal Commerce (TGC). If you have not loaded your product data into TGC, you must pass a valid 2 character country code. string 2
dimensions N Object containing product dimesions. Not required, but can provide a more accurate duty and tax quote for certain countries and hscodes. Object
length C Length of the product. Only required if dimension object is not null. decimal (18,4)
width C Width of the product. Only required if dimension object is not null. decimal (18,4)
height N Height of the product. decimal (18,4)
unitOfMeasure C Unit of Measure for the provided dimensions. string 10 Valid values: IN, CM, MM
weightInfo N Object containing product weight. Not required but can provide a more accurate tax and duty quote for certain countries and hscodes. Object
weight N Weight of the provided SKU. decimal (18,4)
unitOfMeasure N Weight unit of measure for the provided weight string 10 Valid values: LBS, KG, OZ, G
name N Product name string 150
description N Product description string 2000
imageURL N Product image url. Will be displayed in portal if using TGC to ship. string 2000
commercialInvoiceDecription C Product description used for customs clearance. Only required if using TGC to generate shipping labels. string 2000
merchantStyle N Style number given to the product if applicable string 150
material N Material that the product is composed of. string 2000
inventory N Number of items in inventory. Only required for fully landed cost quotes. int
isHazmat N Indicates whether or not the item is classified as hazardous material. Only required for fully landed cost quotes Boolean true/false
isKit N Indicates whether or not the item belongs to a bundle. Only required for fully landed cost quotes. Boolean true/false
useBagPaddedMailer N Indicates if the item is eligible to be shipped in a bag or a padded mailer. Only required for fully landed cost quotes. Boolean true/false
warehouseid N Identifier for the ship from warehouse. Only required for fully landed cost quotes. int
shipFromAddress N Object containing ship from address info. Not required if there is a warehouse assigned to the given merchantcode. If there is no warehouse assigned to the merchant, the ship from warehouse will be assigned a default address with the ship from country as US. Object
name Y Object containing ship from name. Object
firstName Y First name of the shipper string 150
middleName N Middle name of the shipper string 150
lastName Y Last name of the shipper string 150
address1 Y Ship from address line 1 string 250
address2 N Ship from address line 2 string 250
city Y Ship from city string 150
stateProvince C Ship from state/province. Required for Canada and Brazil string 50
countryCode Y Ship from country code string 10 2 character country code
postalCode Y Ship from postal code string 50
phone Y Ship from phone number string 50
email Y Ship from email address string 300
shipToAddress Y Object containing ship to address info. Object
name Y Object containing ship to name. Object
firstName Y First name of the consignee string 150
middleName N Middle name of the consignee string 150
lastName Y Last name of the consignee string 150
address1 Y Ship to address line 1 string 250
address2 N Ship to address line 2 string 250
city Y Ship to city string 150
stateProvince C Ship to state/province. Required for Canada and Brazil string 50
countryCode Y Ship to country code string 10 2 character country code
postalCode Y Ship to postal code string 50
phone Y Ship to phone number string 50
email Y Ship to email address string 300

Example Request - JSON Format - Successful request where merchant has product data stored in TGC and an assigned warehouse.
POST /6.0/Merchant/api/TaxDutyQuote
HOST: services.tradeglobal.com
Content-Type: application/json
Authorization: Basic :access_token
{
    "merchantCode" : "MAERSK_SANDBOX",
    "exchange" : {
        "CurrencyCode" : "USD"
    },
    "itinerary" : {
        "totalFreight" : 9.99,
        "totalInsurance" : 0,
        "serviceCode" : null,
        "carrierCode" : null
    },
    "cartItems" : [{
        "sku" : "123456",
        "quantity" : 1, 
        "price" : 100
    }],
    "shipToAddress" : {
        "name" : {
            "firstName" : "Bryan",
            "lastName" : "Test"
        },
        "address1" : "123 Main Street",
        "city" : "Toronto",
        "stateProvince" : "ON",
        "countryCode" : "CA",
        "postalCode" : "M5S 2A2",
        "phone" : "555555555",
        "email" : "test@tgc.com"
    }
}


Response

Example Response - JSON Format
200 OK
Content-Type: application/json
{
    "merchantCode": "MAERSK_SANDBOX",
    "shipToAddress": {
        "name": {
            "firstName": "Bryan",
            "middleName": null,
            "lastName": "Test"
        },
        "address1": "123 Main Street",
        "address2": null,
        "city": "Toronto",
        "stateProvince": "ON",
        "countryCode": "CA",
        "postalCode": "M5S 2A2",
        "phone": "555555555",
        "email": "test@tgc.com"
    },
    "currencyCode": "USD",
    "exchangeRate": 1.0,
    "quotes": [
        {
            "id": "26dcd88d-60c6-ec11-80fd-005056937110",
            "costOfGoods": 100.0,
            "quoteTotal": 122.99,
            "quoteFees": [
                {
                    "feeClassification": "SHIPPING",
                    "discounts": null,
                    "fees": [
                        {
                            "amount": 9.99,
                            "type": "Freight",
                            "feeDescription": "SHIPPING",
                            "message": null
                        },
                        {
                            "amount": 0.0,
                            "type": "Insurance",
                            "feeDescription": "SHIPPING",
                            "message": null
                        }
                    ],
                    "totalAmount": 9.99
                },
                {
                    "feeClassification": "SERVICE",
                    "discounts": null,
                    "fees": [
                        {
                            "amount": 0.0,
                            "type": "Other",
                            "feeDescription": "SERVICE",
                            "message": null
                        }
                    ],
                    "totalAmount": 0.0
                },
                {
                    "feeClassification": "IMPORT",
                    "discounts": [],
                    "fees": [
                        {
                            "amount": 0.0,
                            "type": "Duty",
                            "feeDescription": "IMPORT",
                            "message": null
                        },
                        {
                            "amount": 13.00,
                            "type": "VAT",
                            "feeDescription": "IMPORT",
                            "message": null
                        }
                    ],
                    "totalAmount": 13.00
                }
            ],
            "transportation": {
                "exportIdentificationNumber": "NA",
                "packages": [
                    {
                        "packageID": "UNKNOWN",
                        "packageCostOfGoods": 100.0,
                        "dimensions": {
                            "length": 0.0,
                            "width": 0.0,
                            "height": 0.0,
                            "unitOfMeasure": "IN"
                        },
                        "weightInfo": {
                            "weight": 0.0,
                            "unitOfMeasure": "LBS"
                        },
                        "packageItems": [
                            {
                                "sku": "123456",
                                "unitPrice": 100.0,
                                "quantity": 1,
                                "hsCode": "330499",
                                "countryOfOrigin": "CN",
                                "commercialInvoiceDescription": "carbonated drink in aluminum can",
                                "duty": 0.0,
                                "appliedTariff": null,
                                "vat": 13.00,
                                "appliedTaxes": [
                                    "HST - Federal",
                                    "HST - Provincial (PST)"
                                ],
                                "pst": 0.0
                            }
                        ],
                        "packageItinerary": [
                            {
                                "warehouseID": 0,
                                "estimatedDeliveryTime": "NA",
                                "packageFreight": 9.99,
                                "packageFuelSurcharge": 0.0,
                                "shipMethod": null,
                                "shipFromAddress": {
                                    "name": {
                                        "firstName": "Erlich",
                                        "middleName": null,
                                        "lastName": "Bachman"
                                    },
                                    "address1": "5230 Penfield Avenue",
                                    "address2": "Woodland Hills",
                                    "city": "Los Angeles",
                                    "stateProvince": "CA",
                                    "countryCode": "US",
                                    "postalCode": "91364",
                                    "phone": "555555555",
                                    "email": "test@email.com"
                                },
                                "shipToAddress": {
                                    "name": {
                                        "firstName": "Bryan",
                                        "middleName": null,
                                        "lastName": "Test"
                                    },
                                    "address1": "123 Main Street",
                                    "address2": null,
                                    "city": "Toronto",
                                    "stateProvince": "ON",
                                    "countryCode": "CA",
                                    "postalCode": "M5S 2A2",
                                    "phone": "555555555",
                                    "email": "test@tgc.com"
                                }
                            }
                        ],
                        "volume": 0.0,
                        "num": 1
                    }
                ]
            }
        }
    ]
}

Example Request - JSON Format - Successful request where merchant does not store product data in TGC, is not assigned to a warehouse, and does not pass a ship from address.
POST /6.0/Merchant/api/TaxDutyQuote
HOST: services.tradeglobal.com
Content-Type: application/json
Authorization: Basic :access_token
{
    "merchantCode" : "MAERSK_SANDBOX",
    "exchange" : {
        "CurrencyCode" : "USD"
    },
    "itinerary" : {
        "totalFreight" : 9.99,
        "totalInsurance" : 0,
        "serviceCode" : null,
        "carrierCode" : null
    },
    "cartItems" : [{
        "sku" : "1234567",
        "quantity" : 3, 
        "price" : 100,
        "hsCode" : "330410",
        "countryOfOrigin" : "CN",
        "dimensions" : {
            "length" : 3,
            "width" : 6,
            "height" : 1,
            "unitOfMeasure" : "IN"
        },
        "weightInfo" : { 
            "weight" : 0.15,
            "unitOfMeasure" : "LBS"
        }
    }],
    "shipToAddress" : {
        "name" : {
            "firstName" : "Bryan",
            "lastName" : "Test"
        },
        "address1" : "123 Main Street",
        "city" : "Toronto",
        "stateProvince" : "ON",
        "countryCode" : "CA",
        "postalCode" : "M5S 2A2",
        "phone" : "555555555",
        "email" : "test@tgc.com"
    }
}


Response

Example Response - JSON Format
200 OK
Content-Type: application/json
{
    "merchantCode": "MAERSK_SANDBOX",
    "shipToAddress": {
        "name": {
            "firstName": "Bryan",
            "middleName": null,
            "lastName": "Test"
        },
        "address1": "123 Main Street",
        "address2": null,
        "city": "Toronto",
        "stateProvince": "ON",
        "countryCode": "CA",
        "postalCode": "M5S 2A2",
        "phone": "555555555",
        "email": "test@tgc.com"
    },
    "currencyCode": "USD",
    "exchangeRate": 1.0,
    "quotes": [
        {
            "id": "d67f8097-30ca-ec11-95bc-70bc107d2669",
            "costOfGoods": 300.0,
            "quoteTotal": 371.03,
            "quoteFees": [
                {
                    "feeClassification": "SHIPPING",
                    "discounts": null,
                    "fees": [
                        {
                            "amount": 9.99,
                            "type": "Freight",
                            "feeDescription": "SHIPPING",
                            "message": null
                        },
                        {
                            "amount": 0.0,
                            "type": "Insurance",
                            "feeDescription": "SHIPPING",
                            "message": null
                        }
                    ],
                    "totalAmount": 9.99
                },
                {
                    "feeClassification": "SERVICE",
                    "discounts": null,
                    "fees": [
                        {
                            "amount": 0.0,
                            "type": "Other",
                            "feeDescription": "SERVICE",
                            "message": null
                        }
                    ],
                    "totalAmount": 0.0
                },
                {
                    "feeClassification": "IMPORT",
                    "discounts": [],
                    "fees": [
                        {
                            "amount": 19.50,
                            "type": "Duty",
                            "feeDescription": "IMPORT",
                            "message": null
                        },
                        {
                            "amount": 41.54,
                            "type": "VAT",
                            "feeDescription": "IMPORT",
                            "message": null
                        }
                    ],
                    "totalAmount": 61.04
                }
            ],
            "transportation": {
                "exportIdentificationNumber": "NA",
                "packages": [
                    {
                        "packageID": "UNKNOWN",
                        "packageCostOfGoods": 300.0,
                        "dimensions": {
                            "length": 0.0,
                            "width": 0.0,
                            "height": 0.0,
                            "unitOfMeasure": "IN"
                        },
                        "weightInfo": {
                            "weight": 0.0,
                            "unitOfMeasure": "LBS"
                        },
                        "packageItems": [
                            {
                                "sku": "1234567",
                                "unitPrice": 100.0,
                                "quantity": 3,
                                "hsCode": "330410",
                                "countryOfOrigin": "CN",
                                "commercialInvoiceDescription": null,
                                "duty": 19.50,
                                "appliedTariff": "Most Favoured Nations Rate (MFN)",
                                "vat": 41.54,
                                "appliedTaxes": [
                                    "HST - Federal",
                                    "HST - Provincial (PST)"
                                ],
                                "pst": 0.0
                            }
                        ],
                        "packageItinerary": [
                            {
                                "warehouseID": 0,
                                "estimatedDeliveryTime": "NA",
                                "packageFreight": 9.99,
                                "packageFuelSurcharge": 0.0,
                                "shipMethod": null,
                                "shipFromAddress": {
                                    "name": {
                                        "firstName": "Visible",
                                        "middleName": null,
                                        "lastName": "Supply Chain Management"
                                    },
                                    "address1": "5160 WIley Post Way",
                                    "address2": "",
                                    "city": "Salt Lake City",
                                    "stateProvince": "UT",
                                    "countryCode": "US",
                                    "postalCode": "81460",
                                    "phone": "555555555",
                                    "email": "test@email.com"
                                },
                                "shipToAddress": {
                                    "name": {
                                        "firstName": "Bryan",
                                        "middleName": null,
                                        "lastName": "Test"
                                    },
                                    "address1": "123 Main Street",
                                    "address2": null,
                                    "city": "Toronto",
                                    "stateProvince": "ON",
                                    "countryCode": "CA",
                                    "postalCode": "M5S 2A2",
                                    "phone": "555555555",
                                    "email": "test@tgc.com"
                                }
                            }
                        ],
                        "volume": 0.0,
                        "num": 1
                    }
                ]
            }
        }
    ]
}

Example Request - JSON Format - Invalid HSCode is passed returning a failed response.
POST /6.0/Merchant/api/TaxDutyQuote
HOST: services.tradeglobal.com
Content-Type: application/json
Authorization: Basic :access_token
{
    "merchantCode" : "MAERSK_SANDBOX",
    "exchange" : {
        "CurrencyCode" : "USD"
    },
    "itinerary" : {
        "totalFreight" : 9.99,
        "totalInsurance" : 0,
        "serviceCode" : null,
        "carrierCode" : null
    },
    "cartItems" : [{
        "sku" : "1234567",
        "quantity" : 3, 
        "price" : 100,
        "hsCode" : "111111",
        "countryOfOrigin" : "CN",
        "dimensions" : {
            "length" : 3,
            "width" : 6,
            "height" : 1,
            "unitOfMeasure" : "IN"
        },
        "weightInfo" : { 
            "weight" : 0.15,
            "unitOfMeasure" : "LBS"
        }
    }],
    "shipToAddress" : {
        "name" : {
            "firstName" : "Bryan",
            "lastName" : "Test"
        },
        "address1" : "123 Main Street",
        "city" : "Toronto",
        "stateProvince" : "ON",
        "countryCode" : "CA",
        "postalCode" : "M5S 2A2",
        "phone" : "555555555",
        "email" : "test@tgc.com"
    }
}
Example Response - JSON Format
400 Bad Request
Content-Type: application/json
{
	"errorCode":1007,
	"errorType":"GetTariffDatas",
	"errorMessage":"The provided HSCode (111111) is invalid."
}