Product Pricing

Below API can be natively integrated into any international product pricing service (e.g ERP or PIM) to estimate and consider the applicable customs duty and taxes per market.

Get duty & taxes estimate for a product

post
Header parameters
x-loginstringRequired

Client username (set by Glopal)

Example: usernamePattern: ^[a-z0-9\-]{3,255}$
x-aliasstringOptional

Optional system username to enable separation of authentication credentials by integrated client system. (set by Glopal)

Example: alias-usernamePattern: ^[a-z0-9\-]{3,50}$
x-signaturestringRequired

The authentication signature is created by using the concatenation of the login, the ‘@’ sign and the timestamp, transformed into a HMAC_256 signature using your secret access key.

Example: 40b976b35a08bb951439ea7bbfa0a7bd73dab7c813399a31d9d1a157bc08929bPattern: ^[0-9a-f]{64}$
x-timestampnumber · floatRequired

The authentication timestamp must be a decimal numeric representing the current POSIX time, extended to microsecond accuracy. If the requesting system does not provide high-resolution time, it is advised to use a 6-digit random number. It is important to have the requesting system synchronised with a reliable time source (f.i. a stratum 2 NTP server) to avoid request rejection.

Example: 1680010295.775523Pattern: ^[12]\d{9}\.\d{6}$
x-versionnumber · floatOptionalDefault: 0.68Pattern: (^0\.\d{2}$|^[1-9]\d*\.\d{2}$)
Body
Responses
200
OK
Responseall of
post
const timestamp = String(Date.now() / 1000).padEnd(17, '0');
const username = "username";
const signature = CryptoJS.HmacSHA256(
  `${username}@${timestamp}`, "sharedsecret"
  ).toString(CryptoJS.digest)

const response = await fetch('https://ws.xport.glopalservice.com/tcc/calculate_product', {
  method: 'POST',
  headers: {
    "Content-Type": "application/json",
    "x-login": username,
    "x-timestamp": timestamp,
    "x-signature": signature
  },
  body: JSON.stringify({
    "args":{
      "from_country_id": "US",
      "to_country_id": "CA",
      "to_state_id": "QC",
      "products": [
        {
          "hs_code": "330310",
          "unitprice": 19.99,
          "description": "Paul Mitchell Tea Tree Special (10.1 Oz) Shampoo & Conditioner Duo Set"
        }
      ]
    }
  }),
});
const data = await response.json();
{
  "error": 0,
  "result": [
    {
      "from_country_id": "FR",
      "to_country_id": "US",
      "to_state_id": "CA",
      "to_post_code": "90210",
      "currency": "USD",
      "is_tax_deminimis_applied": "0",
      "is_duty_deminimis_applied": "0",
      "duty_calculation_rule": "CIF",
      "tax_calculation_rule": "CIF",
      "products": [
        {
          "dutiable_value": 84.75,
          "duty_charge": 15.25,
          "duty_charges": [
            {
              "name": "Charge",
              "code": "charge_id",
              "rate": 9.975,
              "type": "dutiable_value",
              "value": 12.12
            }
          ],
          "duty_charge_included": 12.12,
          "duty_charge_tax": 2.23,
          "duty_deminimis": 157.58,
          "duty_rate": 8.25,
          "hs_code": "429999",
          "preference_applied": 0,
          "preference_source": "Free trade agreement",
          "prohibition_id": "W12",
          "prohibition_note": "Warning for product type importing to destination country",
          "tax_charge": 15.25,
          "tax_charges": [
            {
              "name": "Charge",
              "code": "charge_id",
              "rate": 9.975,
              "type": "dutiable_value",
              "value": 12.12
            }
          ],
          "tax_charge_included": 12.12,
          "tax_deminimis": 0,
          "tax_rate": 20.25
        }
      ]
    }
  ]
}

Last updated

#342: Xport release notes 25W03

Change request updated