Lea el contrato de la API
El contrato de abajo cubre los patrones de solicitud, las estructuras de respuesta, la semántica de errores y los límites de tasa. Veinte minutos de lectura ahorran días de depuración.
Referencia de la API
Integre la clasificación HTS y el cálculo de aranceles directamente en sus sistemas. Envíe una descripción de producto y un país de origen, y reciba el código HTS y el desglose completo de la pila arancelaria en una sola llamada REST.
Rendimiento
¿Cientos de SKUs? ¿Miles? Ginger los clasifica todos en minutos.
Clasifique un solo producto con una llamada a la API.
Tiempos de respuesta medidos en el tráfico de producción. Los percentiles más bajos describen la experiencia típica; los más altos, el peor caso extremo.
Promedio
36 s
Tiempo de respuesta medio en todas las solicitudes de producción.
Mediana (p50)
30 s
La mitad de todas las solicitudes se completan dentro de este tiempo.
p95
79 s
El 95 % de las solicitudes se completan dentro de este tiempo, el peor caso típico.
p99
108 s
El 99 % de las solicitudes se completan dentro de este tiempo, incluso bajo carga.
Clasifique hasta 200 productos en una sola llamada a la API.
Diseñada para catálogos a escala. Una sola solicitud procesa todo el lote en paralelo y termina en minutos.
Elementos por llamada
200
Máximo de productos por llamada a la API por lotes.
Tiempo de finalización
3-5 min
Tiempo típico para procesar un lote completo de principio a fin.
Capacidad diaria
200K+
Volumen de clasificación diario de nivel de producción. Los niveles empresariales personalizados escalan hasta 100K clasificaciones por hora.
Los productos del Chapter 91, como los relojes de pulsera, se gravan por componente, no como una sola unidad. La API los divide automáticamente en sus partes constituyentes y devuelve un arreglo de componentes, cada parte con su propio código HTS y cálculo de derechos. La mayoría de las API de clasificación simplemente omiten esto, pero el cumplimiento comercial real significa que cada producto reciba el tratamiento arancelario correcto, sin excepciones.
La OpenAPI de GingerControl es una interfaz REST para la clasificación HTS automatizada y el cálculo de aranceles. Envíe una descripción de producto y un país de origen; una sola llamada devuelve el código HTS y un desglose completo de derechos.
Los resultados de clasificación son salida de investigación para su equipo: en nuestra prueba comparativa interna con más de 1,000 productos, el motor alcanzó una precisión del 99.86 %, y cada resultado está diseñado para ser revisado por un agente de aduanas con licencia antes de la presentación.
Endpoint de un solo producto
Un producto por solicitud, con el detalle arancelario completo.
Endpoint por lotes
Hasta 200 productos por solicitud.
Soporte de código dividido
Aranceles a nivel de componente para productos de código dividido.
Pila arancelaria completa
Tasas General (MFN) y Especial, Section 301, 232, 122, y todas las entradas aplicables de Chapter 99.
El contrato de abajo cubre los patrones de solicitud, las estructuras de respuesta, la semántica de errores y los límites de tasa. Veinte minutos de lectura ahorran días de depuración.
Contáctenos y le entregaremos una clave de prueba a través de un canal fuera de línea, como el correo electrónico.
Advertencia
Las claves de prueba llevan una cuota reducida y expiran en 7-30 días. Son solo para desarrollo y depuración, nunca para producción.
La mayoría de los equipos completan la integración básica rápidamente y luego dedican el tiempo restante a conectar los datos devueltos con sus propios sistemas.
Solicite una clave de producción cuando esté listo para el lanzamiento. La dimensionamos a sus patrones de llamada, lista de IP permitidas y QPS máximo.
Advertencia
Mantenga su clave de API de producción segura. En la etapa actual, la clave de API es la única base para la facturación.
Method: POST
Path: /openapi/v1/tariff
Base URL: https://api.gingercontrol.com
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | Must be application/json |
X-Api-Key | Yes | Caller credential issued offline by GingerControl. Used for authentication, rate limiting, and quota control. |
X-Request-Id | No | Request trace identifier for troubleshooting and log tracing. Server generates one if omitted. |
| Header | Description | Purpose |
|---|---|---|
Content-Type | Always application/json | Indicates the response body format |
X-Request-Id | Echoes the caller-provided value, or a server-generated value | Recommended for logging and troubleshooting |
Retry-After | Returned only with 429 Too Many Requests | Tells the caller how many seconds to wait before retrying |
| Field | Type | Required | Description |
|---|---|---|---|
description | string | Yes | Product description. Must not be empty; max 10,000 characters. |
country_of_origin | string | Yes | ISO 3166-1 alpha-2 country code. EU (European Union) and UK (United Kingdom) are also accepted; GB is accepted and processed as UK. |
extra | object | No | Additional input. The current version only consumes steel_pour_country and aluminum_pour_country; all other fields are ignored. |
extra.steel_pour_country | string | No | Steel pour country. Same rules as country_of_origin. |
extra.aluminum_pour_country | string | No | Aluminum pour country. Same rules as country_of_origin. |
Request Example
{
"description": "Cotton knit short sleeve T-shirt",
"country_of_origin": "DE",
"extra": {
"steel_pour_country": "IT",
"aluminum_pour_country": "FR"
}
}Response Example
{
"hts_code": "6109.10.0012",
"tariffs": {
"general_rate": "16.5%",
"special_rate": "Free",
"Section 301": [],
"Section 232 - Metals": [],
"Section 122": [
{
"code": "9903.03.01",
"rate": "10%"
}
]
}
}| Field | Type | Meaning | Notes |
|---|---|---|---|
hts_code | string | The HTS code determined for the product | Normally a 10-digit code; a split-code product may return an 8-digit parent code such as 9101.11.40 |
tariffs | object | null | The set of tariff-related data for the product | May be null for split-code products |
tariffs.general_rate | string | null | General rate | This may also be understood as MFN |
tariffs.special_rate | string | null | Special rate | The raw text is lightly normalized, for example by removing a trailing parenthetical note |
tariffs.<module_key> | array | List of Chapter 99 entries for the module | Each element is {code, rate} |
tariffs.<module_key>[].code | string | Chapter 99 code | For example, 9903.85.08 |
tariffs.<module_key>[].rate | string | Rate | Percentage string such as 25% |
components | array | Component list for a split-code product | Omitted for ordinary products |
components[].hts_code | string | Component HTS code | Always 10 digits |
components[].tariffs | object | null | Tariff data for the component |
| Field | Type | Meaning | Notes |
|---|---|---|---|
detail | object | Error object | |
detail.code | string | Error code | Intended for programmatic handling |
detail.message | string | Error message | Intended for logging and troubleshooting |
Error Response Example
{
"detail": {
"code": "invalid_request",
"message": "Invalid request body."
}
}| HTTP Status | Code | Description |
|---|---|---|
401 | missing_api_key | X-Api-Key was not provided |
401 | invalid_api_key | API key validation failed |
403 | api_key_revoked | The API key has been revoked |
403 | client_disabled | The caller account has been disabled |
422 | invalid_request | Request body is malformed or fields do not satisfy the contract |
429 | request_rate_limited | Request-level protection was triggered |
429 | item_rate_limited | Item-level quota protection was triggered |
500 | classification_failed | HTS identification failed |
500 | calculator_failed | Tariff calculation failed |
500 | internal_error | An unclassified internal error occurred |
Replace YOUR_API_KEY with the key issued to you, then run:
curl -X POST 'https://api.gingercontrol.com/openapi/v1/tariff' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'X-Request-Id: manual-single-001' \
-d '{
"description": "Cotton knit short sleeve T-shirt",
"country_of_origin": "DE",
"extra": {
"steel_pour_country": "IT",
"aluminum_pour_country": "FR"
}
}'Method: POST
Path: /openapi/v1/tariff/batch
Base URL: https://api.gingercontrol.com
Request and response headers are identical to the Single-Product Endpoint: Content-Type, X-Api-Key, and optional X-Request-Id on the request; X-Request-Id and Retry-After (on 429) on the response.
| Field | Type | Required | Description |
|---|---|---|---|
items | array | Yes | List of products. Up to 200 items per request. |
items[].item_id | string | Yes | Caller-defined unique identifier for result reconciliation. Must be unique within the request. |
items[].description | string | Yes | Product description. Must not be empty; max 10,000 characters. |
items[].country_of_origin | string | Yes | Same rules as the single-product country_of_origin. |
items[].extra | object | No | Same rules as the single-product extra object. |
Request Example
{
"items": [
{
"item_id": "SKU-DE-001",
"description": "Cotton knit short sleeve T-shirt",
"country_of_origin": "DE",
"extra": {
"steel_pour_country": "IT"
}
},
{
"item_id": "SKU-FR-002",
"description": "Cotton crew neck T-shirt",
"country_of_origin": "FR",
"extra": {}
}
]
}Response Example
{
"items": [
{
"item_id": "SKU-DE-001",
"status": "ok",
"hts_code": "6109.10.0012",
"tariffs": {
"general_rate": "16.5%",
"special_rate": "Free",
"Section 301": [],
"Section 232 - Metals": [],
"Section 122": [
{ "code": "9903.03.01", "rate": "10%" }
]
}
},
{
"item_id": "SKU-FR-002",
"status": "ok",
"hts_code": "6109.10.0004",
"tariffs": {
"general_rate": "16.5%",
"special_rate": "Free",
"Section 301": [],
"Section 232 - Metals": [],
"Section 122": [
{ "code": "9903.03.01", "rate": "10%" }
]
}
}
],
"summary": {
"total": 2,
"succeeded": 2,
"failed": 0
}
}| Field | Type | Meaning | Notes |
|---|---|---|---|
items | array | List of batch processing results | The response order matches the request order |
items[].item_id | string | Caller-provided unique identifier | Used for result reconciliation |
items[].status | string | Processing status | Either ok or failed |
items[].hts_code | string | HTS code for a successful item | Normally a 10-digit code; a split-code product may return an 8-digit parent code; present only when status = ok |
items[].tariffs | object | null | Tariff data for a successful item | May be null for split-code products; present only when status = ok |
items[].tariffs.general_rate | string | null | General rate | This may also be understood as MFN |
items[].tariffs.special_rate | string | null | Special rate | Lightly normalized before being returned |
items[].tariffs.<module_key> | array | Module entries | Each element is {code, rate} |
items[].tariffs.<module_key>[].code | string | Chapter 99 code | |
items[].tariffs.<module_key>[].rate | string | Rate | |
items[].components | array | Component list for a split-code product | Omitted for ordinary products; present only when status = ok |
items[].components[].hts_code | string | Component HTS code | Always 10 digits |
items[].components[].tariffs | object | null | Tariff data for the component | |
items[].code | string | Failure code for a failed item | Present only when status = failed |
summary | object | Summary information for the batch request | |
summary.total | integer | Total number of items in this request | |
summary.succeeded | integer | Number of successful items | |
summary.failed | integer | Number of failed items |
| Field | Type | Meaning | Notes |
|---|---|---|---|
detail | object | Error object | |
detail.code | string | Error code | Intended for programmatic handling |
detail.message | string | Error message | Intended for logging and troubleshooting |
Error Response Example
{
"detail": {
"code": "item_rate_limited",
"message": "Item quota exceeded."
}
}Batch-Level Error Codes
| HTTP Status | Code | Description |
|---|---|---|
401 | missing_api_key | X-Api-Key was not provided in the request headers |
401 | invalid_api_key | API key validation failed |
403 | api_key_revoked | The API key has been revoked |
403 | client_disabled | The caller account has been disabled |
422 | invalid_request | The top-level structure is invalid, item_id values are duplicated, fields are missing, field types are incorrect, or field values do not satisfy the contract |
429 | request_rate_limited | Request-level protection was triggered |
429 | item_rate_limited | Item-level quota protection was triggered |
500 | internal_error | An unclassified batch-level internal error occurred |
Item-Level Failure Codes
| Code | Description |
|---|---|
classification_failed | HTS identification failed for that item |
calculator_failed | Tariff calculation failed for that item |
internal_error | An unclassified internal error occurred for that item |
Replace YOUR_API_KEY with the key issued to you, then run:
curl -X POST 'https://api.gingercontrol.com/openapi/v1/tariff/batch' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'X-Request-Id: manual-batch-001' \
-d '{
"items": [
{
"item_id": "SKU-DE-001",
"description": "Cotton knit short sleeve T-shirt",
"country_of_origin": "DE",
"extra": { "steel_pour_country": "IT" }
},
{
"item_id": "SKU-FR-002",
"description": "Cotton crew neck T-shirt",
"country_of_origin": "FR",
"extra": {}
}
]
}'429 Too Many Requests.Validate request bodies
If you receive 422, the request body structure, field types, or field values usually do not match the contract. Check the request body first.
Handle rate limits gracefully
If you receive 429, implement retry behavior using the Retry-After response header.
Log request IDs
Keep request logs and record the X-Request-Id for each call. This significantly reduces troubleshooting time.
Configure timeouts and retries
Configure reasonable timeouts, retries, and failure alerts so that network fluctuations can be handled robustly.
Do not embed your API key in frontend code, browser code, or any environment exposed to end users.
Do not use production API keys in test, development, or temporary debugging environments.
Store your API key in a secure configuration system, such as a secret manager or tightly controlled environment variables.
If an API key is lost, suspected to be leaked, or needs to be rotated, please contact us as soon as possible.
For integration support, testing, production rollout, or ongoing operations, please contact us:
Email: chen@gingercontrol.com
We use cookies to understand how visitors interact with our site. No personal data is shared with advertisers.