Digicust
Web AppPricingBlogContact
  • 👋Welcome to Dexter
  • Guides
    • 🔎Getting started
    • ⬆️Upload Cases
    • 📚Upload Master Data
    • 📚Bulk Edit Master Data
    • 🔧Configure Execution Strategies
    • 🧳Manage Projects
  • Working with Digicust
    • 1️⃣Onboarding Checklist
    • 2️⃣Checklist Recurring Client
    • 3️⃣Checklist Walk-in Clients
  • Features
    • 🔌Integrations
      • Riege Scope
      • BEO
      • FORMAT
      • DHF Zolaris
      • AEB
      • LDV
      • DBH
      • Dakosy
      • SFTP
      • Web Hooks
      • Asycuda
    • 🔎Tariff Classification
      • Auto-fix tariff numbers
      • Automatic classifications
      • Bulk material classifications
    • 🪄AI-Generated Goods Descriptions
    • ✨Rules & Templates
    • ⬆️Upload Scenarios
    • 📃Document Splitting
    • 🛠️Data Extraction
      • Emails
      • Invoices
      • Waybills
      • Packing Lists
      • Delivery Notes
      • Export Declarations
      • Temporary Storage Documents
      • ATR Certificates
      • EUR1
      • Weighing Certificates
      • Excel Files
    • 🪄Data Enrichment & Customs Coding
      • Freight Cost Distribution
      • Preference Check
      • Procedure Detection
      • Automatically Add Negative Codings
      • Document Type Codes
      • Special Unit Measures
      • Currency Conversion
      • Address Normalization
    • 📚Master Data
      • Material Data
      • Stakeholder Data
    • ✔️Data Validation
      • Stakeholder Validation
      • Consistency Check
    • 📧Custom Events
    • Splitting Customs Cases
  • Developer API
    • Getting Started
    • Uploading a Case
    • Fetching a Case
    • Tariff Classificaiton
    • Type Definitions
    • Full Upload API Documentation
    • Full Generic API Documentation
  • Use-Cases
    • Import
      • From Invoices, Emails, Master Data
      • From Export Declarations and Above
      • From Waybills, Turkish Export Declarations and Above
      • From Temporary Storage, Transit Declarations and Above
      • From Delivery Notes, Packing Lists and Above
      • From Preference Documents (A.TR, EUR.1, etc.) and Above
      • Create A.TR from Export Declaration
    • Export
      • From Invoices, Emails, Master Data
      • From Invoices, Packing Lists, Delivery Notes
    • Transit
      • From Invoices, Emails, Export Declarations
    • Intrastat
      • From Invoices
Powered by GitBook
On this page

Was this helpful?

  1. Developer API

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:

  1. Material information

  2. Info if standalone item or part of a machine

  3. Intended use or industry

  4. Whether the product can be of general use

We recommend the total description to not be longer than 30 and 50 words.

PreviousFetching a CaseNextImport

Last updated 8 months ago

Was this helpful?