Tariff Classificaiton
You can use our product tariff classification using our API.
curl -X 'POST' \
  'https://dev.api.digicust.com/generic/api/<YOUR CUSTOMER ID>/<YOUR PROJECT ID>/tariff-classification/classify_cn' \
  -H 'accept: application/json' \
  -H 'accept-language: en-US,en;q=0.9' \
  -H 'Authorization: Bearer <YOUR ACCESS TOKEN>' \
  -H 'content-type: application/json' \
  -d '{
        "description": "Schokolade",
        "remark": "Manufacturer, Designation",
        "barCode": "EAN code"
      }'var xhr = new XMLHttpRequest();
xhr.open('POST', 'https://dev.api.digicust.com/generic/api/<YOUR CUSTOMER ID>/<YOUR PROJECT ID>/tariff-classification/classify_cn', true);
xhr.setRequestHeader('Accept', 'application/json');
xhr.setRequestHeader('Accept-Language', 'en-US,en;q=0.9');
xhr.setRequestHeader('Authorization', 'Bearer <YOUR ACCESS TOKEN>');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function () {
  if (xhr.readyState === XMLHttpRequest.DONE) {
    if (xhr.status === 200) {
      console.log('Response:', xhr.responseText);
    } else {
      console.error('Error:', xhr.statusText);
    }
  }
};
var data = JSON.stringify({
  description: "Schokolade",
  remark: "Manufacturer, Designation",
  barCode: "EAN code"
});
xhr.send(data);
const axios = require('axios');
const config = {
  method: 'post',
  url: 'https://dev.api.digicust.com/generic/api/<YOUR CUSTOMER ID>/<YOUR PROJECT ID>/tariff-classification/classify_cn',
  headers: { 
    'Accept': 'application/json', 
    'Accept-Language': 'en-US,en;q=0.9', 
    'Authorization': 'Bearer <YOUR ACCESS TOKEN>', 
    'Content-Type': 'application/json'
  },
  data: {
    description: "Schokolade",
    remark: "Manufacturer, Designation",
    barCode: "EAN code"
  }
};
axios(config)
  .then(function (response) {
    console.log('Response:', response.data);
  })
  .catch(function (error) {
    console.error('Error:', error.response ? error.response.data : error.message);
  });
Imports System.Net.Http
Imports System.Text
Imports System.Threading.Tasks
Module Program
    Sub Main()
        ' Call the asynchronous method
        Task.Run(Function() PostRequest()).Wait()
    End Sub
    ' Asynchronous function to send the HTTP POST request
    Async Function PostRequest() As Task
        Dim client As New HttpClient()
        ' Set the request URL
        Dim url As String = "https://dev.api.digicust.com/generic/api/<YOUR CUSTOMER ID>/<YOUR PROJECT ID>/tariff-classification/classify_cn"
        ' Set the headers
        client.DefaultRequestHeaders.Add("Accept", "application/json")
        client.DefaultRequestHeaders.Add("Accept-Language", "en-US,en;q=0.9")
        client.DefaultRequestHeaders.Add("Authorization", "Bearer <YOUR ACCESS TOKEN>")
        ' Prepare the request body data
        Dim jsonData As String = "{
            ""description"": ""Schokolade"",
            ""remark"": ""Manufacturer, Designation"",
            ""barCode"": ""EAN code""
        }"
        Dim content As New StringContent(jsonData, Encoding.UTF8, "application/json")
        ' Send the POST request
        Try
            Dim response As HttpResponseMessage = Await client.PostAsync(url, content)
            If response.IsSuccessStatusCode Then
                ' Read the response content
                Dim responseBody As String = Await response.Content.ReadAsStringAsync()
                Console.WriteLine("Response: " & responseBody)
            Else
                Console.WriteLine("Error: " & response.StatusCode.ToString())
            End If
        Catch ex As Exception
            Console.WriteLine("Exception: " & ex.Message)
        End Try
    End Function
End Module
import requests
import json
# Define the URL
url = 'https://dev.api.digicust.com/generic/api/<YOUR CUSTOMER ID>/<YOUR PROJECT ID>/tariff-classification/classify_cn'
# Define the headers
headers = {
    'Accept': 'application/json',
    'Accept-Language': 'en-US,en;q=0.9',
    'Authorization': 'Bearer <YOUR ACCESS TOKEN>',
    'Content-Type': 'application/json'
}
# Define the payload
data = {
    "description": "Schokolade",
    "remark": "Manufacturer, Designation",
    "barCode": "EAN code"
}
# Send the POST request
response = requests.post(url, headers=headers, data=json.dumps(data))
# Check the response
if response.status_code == 200:
    print('Response:', response.json())
else:
    print('Error:', response.status_code, response.text)
Make sure to replace the placeholders.
Sometimes the service runs into status 500 errors. Often, retry of these errors helps. We work on making our tariff classification API more and more stable.
Use remark for any additional information, such as:
- Material information 
- Info if standalone item or part of a machine 
- Intended use or industry 
- Whether the product can be of general use 
We recommend the total description to not be longer than 30 and 50 words.
Last updated
Was this helpful?
