XQustoms API
National HS classification, Y-code requirements, CBAM flags and import-cost estimates for ERP, commerce and logistics integrations.
All requests go to https://xqustoms.com/api/v1, served by XQustoms itself and forwarded unchanged to the tariff engine. A request without key returns 401 API_KEY_REQUIRED as JSON.
Authentication & access
Documentation does not require an account. API requests require an active integration key, issued through the approved XQlobal onboarding and XQustoms API administration process. Registration alone does not grant API access.
x-api-key: YOUR_INTEGRATION_KEY
Content-Type: application/json
Accept: application/jsonKeep keys in your server’s secret store or environment. Never place them in a browser storefront, mobile bundle, public repository, URL query string or analytics event. Keys are checked against a SHA-256 hash; a deactivated key is rejected.
Use separate keys for separate integrations where provisioned. There is no separate sandbox endpoint; unbilled test keys (prefix xqt_test_) run against the same engine, see Scopes, test keys & limits. No automatic key rotation, webhook signing flow or OAuth-based tariff API access is currently exposed. Portal session tokens are not a substitute for x-api-key.
HTTPS only. The branded gateway must forward the API key and JSON body unchanged, restrict paths to the documented endpoints, avoid redirects to another origin, and never log key values. Browser CORS does not make a secret safe to publish.
Scopes, test keys & limits
Every key carries scopes. A call needs the scope of its route; otherwise the answer is 403 INSUFFICIENT_SCOPE with required_scope. Keys issued before the scope rollout keep full access to every route, and their legacy permissions map onto the new scopes, so existing integrations need no change.
| Scope | Routes | Legacy permission |
|---|---|---|
| tariff:classify | search · validate-code · classify-interactive · product-lookup | tariff:read |
| tariff:lookup | lookup · measures · hs-lookup | tariff:read |
| tariff:calculate | calculate · bulk-calculate · evaluate-shipment · bulk-verify-shipment | tariff:calculate |
| tariff:feedback | classification-feedback (the key must also be allowed to send feedback, else 403 FEEDBACK_NOT_ALLOWED) | tariff:read |
| tariff:ask | Reserved; no public route requires it yet | — |
| none | GET quota | any active key |
API v2: analyze needs tariff:lookup, plus tariff:calculate when customs_value is sent and tariff:classify when only a description is sent; validate and batch follow validate-code and bulk-calculate.
Test keys. Keys starting with xqt_test_ use the same engine and the same data but are never billed and consume no quota. Their answers carry meta.test_mode: true (where a meta object exists), meta.quota_remaining: null and the header x-xqustoms-test: true. Results are real tariff data, not mock data; test keys are rate limited and by default cannot send classification feedback.
Rate limit. Only keys with a configured per-minute limit are limited. Above it the answer is 429 RATE_LIMITED with retry_after_seconds and a Retry-After header (seconds); both API versions pass it through. Rejected 429 calls consume no quota.
Usage attribution. Two optional request headers are stored with each usage entry and never change the result: X-Integration (calling integration or channel) and X-End-Customer-Ref (your own reference for the end customer). Max 128 characters each; do not send personal data.
X-Integration: shop-connector
X-End-Customer-Ref: account-4711ERP & e-commerce integration
- Collect a stable
ref(SKU/ERP item ID), product type, material, use and known national code. Exclude customer personal data. - Group items by
jurisdiction, country, trade direction and partner. Split product batches into at most 50 items. Submit product-lookup from your server. - Read each result by
ref. Checkstatusandconfidence; send review/no-match items to a customs specialist instead of silently assigning a code. - Store national stored/declared codes separately, including jurisdiction and direction. Check classification status before declaration: a German 10-digit TARIC output can still be missing the required national 11th digit.
- Read document groups as alternatives, not a flat list of certificates that all apply.
mandatorycan block without proof;optional_reliefunlocks a preference/suspension. Select the document only when its condition is proven. - Route CBAM/PGA flags and
to_verifyrules to compliance review. Preserve source, legal basis and text status in your ERP. - For money amounts call calculate, or evaluate-shipment for one declaration. Do not use lookup’s MFN rate as the full landed cost.
for (const result of data.results ?? []) {
if (result.status !== 'OK' || !['given', 'high'].includes(result.confidence)) {
queueExpertReview(result.ref, result);
continue;
}
const lookup = result.lookup;
const needsReview = lookup.classification.status !== 'ok'
|| (lookup.compliance_flags ?? []).some(f => f.verification_status !== 'verified')
|| lookup.document_requirements?.status === 'NOT_LOADED';
saveTariffSuggestion(result.ref, { lookup, needsReview });
}
// queueExpertReview / saveTariffSuggestion are your ERP adapter functions.
// This example does not declare or submit goods.There is no public asynchronous Excel-job API, webhook subscription or cross-country mapping endpoint in this reference. Catalogue uploads are currently an authenticated portal workflow. Do not reuse national digits across countries just because HS6 matches.
Data provenance & compliance
German text states
- official
- Official text for that line (loaded Destatis/CN source). This label does not certify EZT national completeness.
- official_cn8_parent
- Only the official 8-digit parent text; the subdivision’s own German TARIC text is missing.
- machine_translation
- Unverified machine translation, not official wording.
- missing
- No German text loaded; English may be shown instead.
Rules and requirements
verification_status: to_verify means the stored rule has not been checked against the official source. Return and display that warning in downstream applications.
CBAM results are scope/obligation flags, not a carbon-emissions determination, filing or certificate valuation. Agency flags are screening hints, not US import clearance. Empty arrays do not prove that no other regulation applies.
Preserve source_url, legal_basis, rate_source, german_text.source and all missing/verification markers. Missing taxes stay null, never 0. An English fallback description is not a verified German customs description.
EU/UK measures come from official commodity feeds; German CN texts from loaded Destatis lists; US exports use Schedule B separately from HTSUS. Official EZT subdivision wording and Germany’s national 11th digit are not fully available. No new official verification is claimed by this documentation.
Errors, partial results & retries
| HTTP | Code | Action |
|---|---|---|
| 400 | BODY_INVALID / VALIDATION_FAILED | Fix JSON or indicated fields; do not retry unchanged. |
| 400 | OPTION_INVALID / ITEM_AND_CONTEXT_REQUIRED | Use returned classification options or provide start context. |
| 401 | API_KEY_REQUIRED | Send x-api-key. |
| 403 | API_KEY_INVALID / QUOTA_ERROR | Check key activation and access; do not loop. |
| 403 | INSUFFICIENT_SCOPE / FEEDBACK_NOT_ALLOWED | Restricted keys only. The key lacks required_scope or may not send feedback; request the scope, do not retry. |
| 429 | RATE_LIMITED | Only keys with a per-minute limit. Wait Retry-After seconds (also retry_after_seconds), then retry. |
| 402 | QUOTA_EXHAUSTED | Included units exhausted and overage unavailable; review allocation. |
| 404 | NOT_FOUND / CODE_NOT_FOUND / SESSION_NOT_FOUND | Check method/path, national code or session/key pair. |
| 409 | SESSION_RESOLVED | Read resolved_code; start a new session only if required. |
| 422 | CODE_NOT_DECLARABLE | Select a real declarable child from candidates. |
| 500 | SEARCH_FAILED / FEEDBACK_FAILED / processing error | Record a redacted error; retry cautiously with bounded backoff. |
{
"error": "VALIDATION_FAILED",
"fields": {
"jurisdiction": [
"Invalid enum value"
]
}
}A batch can return HTTP 200 with failed items. Inspect results[].status, items[].issues, missing, calculation.complete and nullable shipment totals. A network timeout does not prove the server did not consume quota.
No idempotency key or deduplication guarantee is implemented. Automatic retries may consume additional units. Use bounded exponential backoff only for transient failures, deduplicate in your own job queue, and check usage before a charged retry. Keys with a configured per-minute limit get 429 RATE_LIMITED with a Retry-After header; keys without a limit never see it.
Validate Content-Type before parsing: HTTP 200 with HTML indicates a routing failure, not API success. Do not forward secrets through unverified redirects.
Quotas & billing
Quota is consumed atomically before processing billable calls. Included allocation and extra-query price are key-specific. No fixed tariff price is promised in these docs. A configured positive overage price can permit billed calls after included quota is exhausted; otherwise requests are blocked with 402.
| Request | Units |
|---|---|
| product-lookup | One per item, max 50 |
| bulk-calculate / evaluate-shipment | One per item, max 100 |
| bulk-verify-shipment | One per item, max 200 |
| search / lookup / measures / calculate / validate-code | One per request |
| hs-lookup | One after declarable-code validation |
| classify-interactive | One per new session; continuation choices free |
| quota / classification-feedback | No units consumed |
For product batches all input items are charged, including NO_MATCH. Processing failures after quota consumption are not guaranteed to be automatically refunded. meta.quota_remaining is the included balance, not a reservation. GET /quota returns extra usage and the configured unit price.
Versions, coverage & operational boundaries
Reference updated 16 November 2026. The branded /api/v1 path exposes the existing Tariff API, including V2 intelligence features; it does not introduce a different calculation engine. OpenAPI defines the observed request contract; response objects are extensible because no rigid versioned response schema is enforced today.
Public integration links: https://xqustoms.com/developer, OpenAPI, Postman. No provider-specific integration URL is advertised.
Health: GET https://xqustoms.com/api/v2/tariff/health needs no key and no quota; 200 ok, 503 degraded. Every answer carries x-request-id; 502/504 are retryable.
API v2: POST https://xqustoms.com/api/v2/tariff/analyze returns classification, duties, documents and – when customs_value is sent – landed cost in one envelope (status OK, INCOMPLETE, CLARIFICATION_REQUIRED, NO_CANDIDATES or ERROR; missing values stay null and are listed in missing). Each evaluated analyze answer also carries decision_id (unique per evaluation), input_hash (sha256 of the normalized inputs; same inputs, same hash), evaluated_at and the echoed Idempotency-Key header; replays are not deduplicated server-side yet. One analyze call consumes exactly one quota unit. Without hs_code, a description returns candidate codes. search, calculate, validate, batch and lookup are v2 aliases of the v1 routes with v1 billing; GET sources is free. OpenAPI v2.
SDKs: dependency-free clients for v2 – TypeScript (new XQustoms(key).analyze({ hs_code: '6203423100', origin_country: 'TR', destination_country: 'DE', customs_value: 1000 })) and Python (XQustoms(key).analyze(hs_code="6203423100", destination_country="DE")). Non-2xx responses raise XQustomsError with status and JSON body.
Tariff change events: product tariff passports saved in XQustoms are re-checked nightly against the official line. A change in official text or MFN rate, or a removed code, emits xqustoms.tariff.changed to XQlobal (payload: passport_id, sku, jurisdiction, code, changes[text_changed|rate_changed|code_removed], before, after). There is no public subscription endpoint for third parties yet.
National search/lookup covers EU, UK, US, TR and Canada (CBSA T2026-2, import MFN). Canadian export, preferential eligibility, SIMA/surtaxes, GST exceptions and product documents are not fully loaded. Legacy validation/classification routes retain shared-tree limitations described per endpoint. There is no official availability SLA, full-text EZT completion guarantee, webhook delivery contract, historical as-of request parameter or public changelog endpoint. Estimates do not replace binding customs decisions.
The /api/v1 path is answered by the XQustoms application on its own domain; method, body, x-api-key, status code and JSON body are passed through unchanged.
/product-lookupProduct lookup
One request from an e-commerce platform or ERP: classify products and retrieve their tariff context.
Quota: 1 unit per input item (1–50). The batch is charged before matching; NO_MATCH items are also charged.
Request body
| Field | Type | Description & constraints |
|---|---|---|
jurisdictionrequired | string | National tariff jurisdiction. EU country is selected separately.Values: EU, UK, US, TR, CA |
country | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
directionrequired | string | Values: import, export |
partner_country | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
languages | array | Default: ["en"] · 1–3 items |
candidates | integer | Returned suggestions per item.Default: 3 · Min: 1 · Max: 10 |
itemsrequired | array | 1–50 items |
items[].ref | string | ERP/SKU correlation reference; returned unchanged.Length: 0–64 |
items[].query | string | Product type + material + characteristics, in any supported search language.Length: 2–200 |
items[].code | string | Exact national code; if supplied, query classification is skipped.Length: 0–14 |
items[].qualifiers | object | |
items[].qualifiers.trade_name | string | Commercial product name.Length: 0–120 |
items[].qualifiers.brand | string | Length: 0–80 |
items[].qualifiers.model | string | Length: 0–80 |
items[].qualifiers.material | string | Composition; include percentages where known.Length: 0–160 |
items[].qualifiers.use | string | Intended use.Length: 0–160 |
Request example
# Planned branded gateway; activate routing before production use.
curl --request POST 'https://xqustoms.com/api/v1/product-lookup' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"jurisdiction": "EU",
"country": "DE",
"direction": "import",
"partner_country": "CN",
"languages": [
"de",
"en"
],
"candidates": 3,
"items": [
{
"ref": "SKU-COTTON-01",
"query": "pamuklu erkek tişört",
"qualifiers": {
"material": "100% Baumwolle",
"use": "Bekleidung"
}
},
{
"ref": "SKU-STEEL-02",
"code": "7208390090"
}
]
}'Response fields
- results[].ref · string | null
- Correlation reference from the request.
- results[].status · string
- OK, NO_MATCH or a per-item HS-Lookup error. HTTP 200 alone does not mean every item succeeded.
- results[].confidence · string
- given: caller supplied code; high: product noun matched and another HS6 is at least 0.5 score behind; review: human review needed; none: no classification. Not a legal guarantee.
- results[].candidates · array
- code, description, text_de, de_status, score, head_match, material_match.
- results[].lookup · object
- Full HS-Lookup result; see the next endpoint. Errors include their candidates instead.
- meta · object
- quota_remaining and units.
- n · a
- t
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"jurisdiction": "EU",
"direction": "import",
"results": [
{
"ref": "SKU-COTTON-01",
"query": "pamuklu erkek tişört",
"status": "OK",
"confidence": "review",
"candidates": [],
"lookup": {
"classification": {
"stored_code": "6109100010"
},
"document_requirements": [],
"compliance_flags": []
}
}
],
"meta": {
"quota_remaining": 99,
"units": 1
}
}- query OR code is required on every item. If both exist, code takes precedence.
- A top candidate is a suggestion, not a binding classification. Review TARIC subdivisions even when confidence is high.
- One request returns codes, document/Y-code conditions, CBAM/PGA flags, VAT and descriptions, not a full landed-cost calculation. Call calculate separately for tax amounts.
- Canada: CBSA T2026-2 import nomenclature and MFN only. Preferential treatment texts are stored but not automatically applied. Statistics Canada 2026 export candidates are available. CAD MFN + 5% standard GST requires exact code and canada_review confirmations; product-specific permits, SIMA/surtaxes/excise, exemptions and export charges require separate review. No EU Y-codes apply.
- national_datasets = [{dataset_key, title, country, kind, rows:[{row_key, data, verification_status}]}]: admin-managed national lists of the line's country (e.g. TR İGV, US Section 301 lists) matched on the code or a parent code; base nomenclature/rate sets are excluded. Empty array when no list applies.
/hs-lookupHS-Lookup
Retrieve a complete record for one exact national tariff code, including declaration format, documents, VAT and compliance flags.
Quota: 1 unit after the code is found and declarable.
Request body
| Field | Type | Description & constraints |
|---|---|---|
jurisdictionrequired | string | National tariff jurisdiction. EU country is selected separately.Values: EU, UK, US, TR, CA |
country | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
coderequired | string | Keep codes as strings to preserve leading zeros. HS-Lookup requires an exact declarable national line; punctuation is stripped.Length: 6–12 |
directionrequired | string | Values: import, export |
partner_country | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
languages | array | Default: ["en"] · 1–3 items |
qualifiers | object | |
qualifiers.trade_name | string | Commercial product name.Length: 0–120 |
qualifiers.brand | string | Length: 0–80 |
qualifiers.model | string | Length: 0–80 |
qualifiers.material | string | Composition; include percentages where known.Length: 0–160 |
qualifiers.use | string | Intended use.Length: 0–160 |
claims | array | US import only, with partner_country as origin: claimed Section 301 exemptions (see calculate). |
loaded_on | string | Optional date the goods were loaded onto the vessel at the port of loading. Used for in-transit rules (US 9903.05.85: loaded before 2026-07-24 and entered before 2026-07-28 → no Section 301 country duty). If the entry date is inside a transit window and loaded_on is missing, missing contains CHARGE_IN_TRANSIT_UNKNOWN:<charge_code>. |
entry_date | string | Planned entry date for in-transit windows; default today. |
Request example
# Planned branded gateway; activate routing before production use.
curl --request POST 'https://xqustoms.com/api/v1/hs-lookup' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"jurisdiction": "EU",
"country": "DE",
"code": "6109100010",
"direction": "import",
"partner_country": "CN",
"languages": [
"de",
"en",
"tr"
],
"qualifiers": {
"trade_name": "T-Shirt",
"material": "100% Baumwolle"
}
}'Response fields
- classification · object
- stored_code, declared_code (can be null), digits, system, status, note, description, description_path, description_de, unit; Schedule B selection for US exports.
- duty · object
- third_country (number or null) and original duty text; not an origin-adjusted full calculation.
- vat · object
- Import VAT rate/rule; export returns EXPORT_EXEMPT, US returns NO_FEDERAL_VAT with rate null. State/local taxes are not modelled.
- document_requirements · array | object
- Requirement groups with kind and options; each option has code and available translated title. NOT_LOADED means not available, not no requirements.
- compliance_flags · array
- Matching CBAM or US agency flags with requirement, legal_basis, source_url and verification_status. Empty is not a complete compliance clearance.
- customs_description · object
- One entry per requested language: text, warnings and source/verification metadata.
- german_text · object | null
- text, status, source. Parent-level official text is not an official TARIC subdivision text.
- meta.quota_remaining · number | null
- Remaining included quota.
- us_duty_layers / origin_notes · object | null / array
- US only: MFN + origin-based additional duty layers with Chapter 99 headings, claimable exemptions and waived layers; departure ≠ origin note.
- n · a
- t
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"jurisdiction": "EU",
"country": "DE",
"direction": "import",
"classification": {
"stored_code": "6109100010",
"declared_code": "6109100010",
"digits": 11,
"status": "national_digit_missing"
},
"duty": {
"third_country": null,
"text": null
},
"document_requirements": [],
"compliance_flags": [],
"german_text": null,
"meta": {
"quota_remaining": 99
}
}- country defaults: EU → DE, UK → GB, US → US, TR → TR, CA → CA. Send a country that belongs to the chosen jurisdiction; the current endpoint does not reject inconsistent combinations.
- partner_country is the trading partner used for document applicability; preserve origin context in import flows.
- 404 CODE_NOT_FOUND and 422 CODE_NOT_DECLARABLE may return alternative candidates.
- Germany’s national 11th digit and missing official EZT subdivision texts must be reviewed; never append a digit on your own.
- TR/US document coverage is not a complete national certificate catalogue. CBAM flags identify potential obligations; no emissions reporting or certificate-cost calculation is included.
- Canada: CBSA T2026-2 import nomenclature and MFN only. Preferential treatment texts are stored but not automatically applied. Statistics Canada 2026 export candidates are available. CAD MFN + 5% standard GST requires exact code and canada_review confirmations; product-specific permits, SIMA/surtaxes/excise, exemptions and export charges require separate review. No EU Y-codes apply.
- US origin-based additional duties: for jurisdiction US, direction import and partner_country (origin), us_duty_layers = {hts_code, origin_country, base, mfn_rate, layers[{code,name,rate,ch99,top_up,condition?,possible_exemptions?[{heading,ref,text,claim}],verification_status,legal_basis}], waived[{code,because_of,via?}], additional_rate, total_rate, missing}. Rates are percentage points on customs value (transaction value, no international freight). Section 301 country rates (HTSUS 9903.05.20–9903.05.84, e.g. Türkiye 12.5% under 9903.05.79), Section 232 and their non-stacking rules come from the same engine as calculate. ch99 lists the Chapter 99 heading(s) to declare in addition to the HTSUS line. Top-up rules (EU, JP, CH: total duty = rate) add only the gap above MFN. All country rows are to_verify.
- national_datasets = [{dataset_key, title, country, kind, rows:[{row_key, data, verification_status}]}]: admin-managed national lists of the line's country (e.g. TR İGV, US Section 301 lists) matched on the code or a parent code; base nomenclature/rate sets are excluded. Empty array when no list applies.
/searchMultilingual search
Search official national lines by code or product description. Ranking weights product type above material and attributes.
Quota: 1 unit per request.
Request body
| Field | Type | Description & constraints |
|---|---|---|
queryrequired | string | Length: 2–200 |
jurisdiction | string | National tariff jurisdiction. EU country is selected separately.Values: EU, UK, US, TR, CA |
limit | integer | Default: 20 · Min: 1 · Max: 50 |
min_digits | integer | Legacy search only (when jurisdiction is omitted).Default: 2 · Min: 2 · Max: 12 |
expand | boolean | Use cached multilingual query expansion; false skips expansion.Default: true |
destination_country | string | Destination ISO country: DE resolves to EU TARIC, US to HTSUS. Unsupported countries return 422; conflicting jurisdiction returns 400.Length: 2–2 |
declarable_only | boolean | Return only national declarable candidates; confirmation is still required.Default: false |
query_language | string | Optional. Language of text_in_query_language and ancestry texts. Omitted: detected from the query (single words may be misdetected). Does not change codes or ranking country.Values: tr, en, de |
Request example
# Planned branded gateway; activate routing before production use.
curl --request POST 'https://xqustoms.com/api/v1/search' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"destination_country": "DE",
"query": "pamuklu tişört",
"declarable_only": true,
"limit": 5
}'Response fields
- results · array
- Ranked national lines with code, description, language texts/status, score and matching signals; legacy result shape differs without jurisdiction.
- expansion · object | null
- Query rewrites used for national search; not generated HS codes.
- meta · object
- quota_remaining; language/source notes.
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"query": "baumwolle tshirt",
"jurisdiction": "EU",
"expansion": null,
"results": [],
"meta": {
"quota_remaining": 99
}
}- Include destination_country or jurisdiction for national multilingual search. Destination country resolves the national nomenclature; input language never selects the country.
- DE/EN/TR search terms are expanded into tariff terminology. Cached queries are faster; new expansions can be slower. No response-time SLA is promised.
- Material-only searches such as pamuk or Baumwolle are ambiguous: add the product type, e.g. cotton T-shirt. Scores are ranking values, not probabilities.
- Use declarable_only:true to omit branches. Candidates are not binding classifications; confirm before lookup/analyze.
/lookupTariff lookup
Resolve destination duties, VAT, measures, preference candidates and source metadata.
Quota: 1 unit per request.
Request body
| Field | Type | Description & constraints |
|---|---|---|
hs_coderequired | string | Code with 4–12 digits after punctuation is stripped. This route may resolve a longer code through a rated prefix. |
destination_countryrequired | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
origin_country | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
claims | array | Caller-declared evidence, never verified automatically. eu_tr_customs_union: 0% EU duty only for TR origin, EU destination, chapters 25–97 outside ECSC coal/steel, otherwise claims_rejected [{claim,reason}]. US Section 301 (HTSUS ch.99 U.S. note 52) exemptions waive the country duty only when claimed AND the HTSUS line is on the official list: us_301_listed_article (described articles, 9903.05.87 and 9903.06.01/.03/.05/.08/.11/.13/.15/.17/.19/.21), us_civil_aircraft (9903.05.88), us_pharmaceutical_use (9903.05.89), us_cafta_dr (9903.06.06/.09). A waived layer appears in us_duty_layers.waived / calculation.waived_charges with because_of = heading and via = claim. |
departure_country | string | Optional ISO country the goods are shipped from. Duties always follow origin_country; when it differs, origin_notes returns ORIGIN_DEPARTURE_DIFFER (US: transshipment does not remove origin-based additional duties).Length: 2–2 |
loaded_on | string | Optional date the goods were loaded onto the vessel at the port of loading. Used for in-transit rules (US 9903.05.85: loaded before 2026-07-24 and entered before 2026-07-28 → no Section 301 country duty). If the entry date is inside a transit window and loaded_on is missing, missing contains CHARGE_IN_TRANSIT_UNKNOWN:<charge_code>. |
Request example
# Planned branded gateway; activate routing before production use.
curl --request POST 'https://xqustoms.com/api/v1/lookup' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"hs_code": "6109100010",
"destination_country": "DE",
"origin_country": "CN",
"departure_country": "DE"
}'Response fields
- national_line · object | null
- Destination national line, description, path, declarability and source.
- duty_rate / vat · number | null / object | null
- Missing values remain null; never treat null as zero.
- measures / required_documents · array
- Applicable measures, conditions and document codes.
- preferences / supply_chain · array
- Preference candidates and operational checks; conditions require evidence.
- rate_source / missing · object | null / array
- Rate provenance and unavailable calculation inputs/data.
- meta · object
- quota_remaining, billed_as_extra, disclaimer.
- us_duty_layers / origin_notes · object | null / array
- US only: MFN + origin-based additional duty layers with Chapter 99 headings, claimable exemptions and waived layers; departure ≠ origin note.
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"hs_code": "6109100010",
"jurisdiction": "EU",
"duty_rate": null,
"vat": null,
"measures": [],
"required_documents": [],
"missing": [
"DUTY_RATE_MISSING",
"VAT_RATE_MISSING"
],
"meta": {
"quota_remaining": 99,
"billed_as_extra": false,
"disclaimer": "Estimate; binding assessment by customs authority."
}
}- Resolution can use the longest matching prefix. Inspect national_line and rate_source; a prefix match is not proof of a declarable code.
- No monetary calculation; use calculate for costs.
- Canada: CBSA T2026-2 import nomenclature and MFN only. Preferential treatment texts are stored but not automatically applied. Statistics Canada 2026 export candidates are available. CAD MFN + 5% standard GST requires exact code and canada_review confirmations; product-specific permits, SIMA/surtaxes/excise, exemptions and export charges require separate review. No EU Y-codes apply.
- US origin-based additional duties: when destination is US and origin_country is set, us_duty_layers = {hts_code, origin_country, base, mfn_rate, layers[{code,name,rate,ch99,top_up,condition?,possible_exemptions?[{heading,ref,text,claim}],verification_status,legal_basis}], waived[{code,because_of,via?}], additional_rate, total_rate, missing}. Rates are percentage points on customs value (transaction value, no international freight). Section 301 country rates (HTSUS 9903.05.20–9903.05.84, e.g. Türkiye 12.5% under 9903.05.79), Section 232 and their non-stacking rules come from the same engine as calculate. ch99 lists the Chapter 99 heading(s) to declare in addition to the HTSUS line. Top-up rules (EU, JP, CH: total duty = rate) add only the gap above MFN. All country rows are to_verify.
/measuresMeasures & documents
Return the same resolved tariff context as lookup, including measures, conditions and required documents.
Quota: 1 unit per request.
Request body
| Field | Type | Description & constraints |
|---|---|---|
hs_coderequired | string | Code with 4–12 digits after punctuation is stripped. This route may resolve a longer code through a rated prefix. |
destination_countryrequired | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
origin_country | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
claims | array | Caller-declared evidence, never verified automatically. eu_tr_customs_union: 0% EU duty only for TR origin, EU destination, chapters 25–97 outside ECSC coal/steel, otherwise claims_rejected [{claim,reason}]. US Section 301 (HTSUS ch.99 U.S. note 52) exemptions waive the country duty only when claimed AND the HTSUS line is on the official list: us_301_listed_article (described articles, 9903.05.87 and 9903.06.01/.03/.05/.08/.11/.13/.15/.17/.19/.21), us_civil_aircraft (9903.05.88), us_pharmaceutical_use (9903.05.89), us_cafta_dr (9903.06.06/.09). A waived layer appears in us_duty_layers.waived / calculation.waived_charges with because_of = heading and via = claim. |
departure_country | string | Optional ISO country the goods are shipped from. Duties always follow origin_country; when it differs, origin_notes returns ORIGIN_DEPARTURE_DIFFER (US: transshipment does not remove origin-based additional duties).Length: 2–2 |
loaded_on | string | Optional date the goods were loaded onto the vessel at the port of loading. Used for in-transit rules (US 9903.05.85: loaded before 2026-07-24 and entered before 2026-07-28 → no Section 301 country duty). If the entry date is inside a transit window and loaded_on is missing, missing contains CHARGE_IN_TRANSIT_UNKNOWN:<charge_code>. |
Request example
# Planned branded gateway; activate routing before production use.
curl --request POST 'https://xqustoms.com/api/v1/measures' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"hs_code": "6109100010",
"destination_country": "DE",
"origin_country": "CN"
}'Response fields
- national_line · object | null
- Destination national line, description, path, declarability and source.
- duty_rate / vat · number | null / object | null
- Missing values remain null; never treat null as zero.
- measures / required_documents · array
- Applicable measures, conditions and document codes.
- preferences / supply_chain · array
- Preference candidates and operational checks; conditions require evidence.
- rate_source / missing · object | null / array
- Rate provenance and unavailable calculation inputs/data.
- meta · object
- quota_remaining, billed_as_extra, disclaimer.
- us_duty_layers / origin_notes · object | null / array
- US only: MFN + origin-based additional duty layers with Chapter 99 headings, claimable exemptions and waived layers; departure ≠ origin note.
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"hs_code": "6109100010",
"jurisdiction": "EU",
"duty_rate": null,
"vat": null,
"measures": [],
"required_documents": [],
"missing": [
"DUTY_RATE_MISSING",
"VAT_RATE_MISSING"
],
"meta": {
"quota_remaining": 99,
"billed_as_extra": false,
"disclaimer": "Estimate; binding assessment by customs authority."
}
}- Currently returns the same response shape as lookup, not a measures-only array.
- Document and preference conditions depend on origin and available measures.
- US origin-based additional duties: when destination is US and origin_country is set, us_duty_layers = {hts_code, origin_country, base, mfn_rate, layers[{code,name,rate,ch99,top_up,condition?,possible_exemptions?[{heading,ref,text,claim}],verification_status,legal_basis}], waived[{code,because_of,via?}], additional_rate, total_rate, missing}. Rates are percentage points on customs value (transaction value, no international freight). Section 301 country rates (HTSUS 9903.05.20–9903.05.84, e.g. Türkiye 12.5% under 9903.05.79), Section 232 and their non-stacking rules come from the same engine as calculate. ch99 lists the Chapter 99 heading(s) to declare in addition to the HTSUS line. Top-up rules (EU, JP, CH: total duty = rate) add only the gap above MFN. All country rows are to_verify.
/calculateLanded-cost calculation
Calculate duty, VAT and supported national import charges with source-based rules.
Quota: 1 unit per request.
Request body
| Field | Type | Description & constraints |
|---|---|---|
hs_coderequired | string | Code with 4–12 digits after punctuation is stripped. This route may resolve a longer code through a rated prefix. |
destination_countryrequired | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
origin_country | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
customs_valuerequired | number | Transaction/customs value in the given currency. Freight and insurance are supplied separately; do not include them twice.Min: 0 |
freight | number | International freight. US calculations exclude this from the customs duty base.Min: 0 |
insurance | number | International insurance. US calculations exclude this from the customs duty base.Min: 0 |
net_mass_kg | number | Net mass for supported per-kg specific duty expressions. |
currency | string | Three-character currency code. No general automatic FX conversion.Default: "EUR" · Length: 3–3 |
payment_terms | string | Payment terms used to evaluate conditional charges, e.g. KKDF.Length: 0–40 |
transport_mode | string | Values: sea, air, road, rail, post |
vehicle | object | |
vehicle.propulsionrequired when parent supplied | string | Values: ice, hybrid, phev, ev |
vehicle.cc | number | Engine displacement in cm³. |
vehicle.kw | number | Motor power in kW. |
claims | array | Caller-declared evidence, never verified automatically. eu_tr_customs_union: 0% EU duty only for TR origin, EU destination, chapters 25–97 outside ECSC coal/steel, otherwise claims_rejected [{claim,reason}]. US Section 301 (HTSUS ch.99 U.S. note 52) exemptions waive the country duty only when claimed AND the HTSUS line is on the official list: us_301_listed_article (described articles, 9903.05.87 and 9903.06.01/.03/.05/.08/.11/.13/.15/.17/.19/.21), us_civil_aircraft (9903.05.88), us_pharmaceutical_use (9903.05.89), us_cafta_dr (9903.06.06/.09). A waived layer appears in us_duty_layers.waived / calculation.waived_charges with because_of = heading and via = claim. |
canada_review | object | Canada only: caller review, not engine-verified eligibility. CAD customs_value is adjusted CBSA value for duty. |
canada_review.valuation_confirmedrequired when parent supplied | boolean | |
canada_review.standard_gst_no_additional_charges_confirmedrequired when parent supplied | boolean | |
clearance_country | string | EU member state of release; import VAT rate and country come from here (default: destination_country).Length: 2–2 |
customs_procedure | string | 4000 release for free circulation; 4200 VAT-exempt import with onward intra-EU supply (Art. 143(1)(d) Directive 2006/112/EC). Only valid when clearance_country differs from destination_country.Values: 4000, 4200 |
declaration_date | string | Rates, measures and VAT valid on this date (default: today). |
inland_freight | number | Transport inside the EU to the first destination; enters the import VAT base only, never the customs value.Min: 0 |
departure_country | string | Optional ISO country the goods are shipped from. Duties always follow origin_country; when it differs, origin_notes returns ORIGIN_DEPARTURE_DIFFER (US: transshipment does not remove origin-based additional duties).Length: 2–2 |
loaded_on | string | Optional date the goods were loaded onto the vessel at the port of loading. Used for in-transit rules (US 9903.05.85: loaded before 2026-07-24 and entered before 2026-07-28 → no Section 301 country duty). If the entry date is inside a transit window and loaded_on is missing, missing contains CHARGE_IN_TRANSIT_UNKNOWN:<charge_code>. |
Request example
# Planned branded gateway; activate routing before production use.
curl --request POST 'https://xqustoms.com/api/v1/calculate' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"hs_code": "6109100010",
"destination_country": "DE",
"origin_country": "CN",
"customs_value": 200,
"freight": 15,
"insurance": 2,
"net_mass_kg": 1.5,
"currency": "EUR",
"transport_mode": "road"
}'Response fields
- national_line · object | null
- Destination national line, description, path, declarability and source.
- duty_rate / vat · number | null / object | null
- Missing values remain null; never treat null as zero.
- measures / required_documents · array
- Applicable measures, conditions and document codes.
- preferences / supply_chain · array
- Preference candidates and operational checks; conditions require evidence.
- rate_source / missing · object | null / array
- Rate provenance and unavailable calculation inputs/data.
- meta · object
- quota_remaining, billed_as_extra, disclaimer.
- calculation · object
- cif_value, duty, extra_duty, vat_base, vat, total_taxes, complete; specific_duty when supported.
- calculation.charges · array (optional)
- Country charge lines, conditional requirements, possible exemptions; charges_total and waived_charges when present.
- de_minimis · object | null
- Threshold applicability, currency, waivers, legal basis and verification.
- us_duty_layers / origin_notes · object | null / array
- US only: MFN + origin-based additional duty layers with Chapter 99 headings, claimable exemptions and waived layers; departure ≠ origin note.
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"hs_code": "6109100010",
"jurisdiction": "EU",
"duty_rate": null,
"vat": null,
"measures": [],
"required_documents": [],
"missing": [
"DUTY_RATE_MISSING",
"VAT_RATE_MISSING"
],
"meta": {
"quota_remaining": 99,
"billed_as_extra": false,
"disclaimer": "Estimate; binding assessment by customs authority."
},
"currency": "EUR",
"calculation": {
"cif_value": 217,
"duty": null,
"vat": null,
"total_taxes": null,
"complete": false
}
}- EU/UK/TR: CIF uses value + freight + insurance. US duty base excludes international freight/insurance.
- Specific duties are only computed for supported per-kg expressions with net_mass_kg and matching currency; otherwise SPECIFIC_DUTY_NOT_CALCULATED remains visible.
- US Section 301/232 and TR İGV/EMY/ÖTV are conditional. claims (us_auto_part, eu_tr_customs_union, us_301_listed_article, us_civil_aircraft, us_pharmaceutical_use, us_cafta_dr) are caller evidence/context, not automatically verified eligibility.
- currency is a label/input; no general currency conversion occurs. TR TRY-dependent charges use available TCMB data and report missing FX.
- complete and missing must both be checked; estimates are not customs rulings.
- Canada: CBSA T2026-2 import nomenclature and MFN only. Preferential treatment texts are stored but not automatically applied. Statistics Canada 2026 export candidates are available. CAD MFN + 5% standard GST requires exact code and canada_review confirmations; product-specific permits, SIMA/surtaxes/excise, exemptions and export charges require separate review. No EU Y-codes apply.
- US origin-based additional duties: when destination is US and origin_country is set, us_duty_layers = {hts_code, origin_country, base, mfn_rate, layers[{code,name,rate,ch99,top_up,condition?,possible_exemptions?[{heading,ref,text,claim}],verification_status,legal_basis}], waived[{code,because_of,via?}], additional_rate, total_rate, missing}. Rates are percentage points on customs value (transaction value, no international freight). Section 301 country rates (HTSUS 9903.05.20–9903.05.84, e.g. Türkiye 12.5% under 9903.05.79), Section 232 and their non-stacking rules come from the same engine as calculate. ch99 lists the Chapter 99 heading(s) to declare in addition to the HTSUS line. Top-up rules (EU, JP, CH: total duty = rate) add only the gap above MFN. All country rows are to_verify.
- calculation.charges[] carry ch99_headings (Chapter 99 heading parsed from the legal basis); waived_charges lists non-stacking or claimed exemptions.
/bulk-calculateBulk calculations
Calculate separate item costs in one request.
Quota: 1 unit per input item (1–100).
Request body
| Field | Type | Description & constraints |
|---|---|---|
itemsrequired | array | 1–100 items |
items[].hs_coderequired when parent supplied | string | Code with 4–12 digits after punctuation is stripped. This route may resolve a longer code through a rated prefix. |
items[].destination_countryrequired when parent supplied | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
items[].origin_country | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
items[].customs_valuerequired when parent supplied | number | Transaction/customs value in the given currency. Freight and insurance are supplied separately; do not include them twice.Min: 0 |
items[].freight | number | International freight. US calculations exclude this from the customs duty base.Min: 0 |
items[].insurance | number | International insurance. US calculations exclude this from the customs duty base.Min: 0 |
items[].net_mass_kg | number | Net mass for supported per-kg specific duty expressions. |
items[].currency | string | Three-character currency code. No general automatic FX conversion.Default: "EUR" · Length: 3–3 |
items[].payment_terms | string | Payment terms used to evaluate conditional charges, e.g. KKDF.Length: 0–40 |
items[].transport_mode | string | Values: sea, air, road, rail, post |
items[].vehicle | object | |
items[].vehicle.propulsionrequired when parent supplied | string | Values: ice, hybrid, phev, ev |
items[].vehicle.cc | number | Engine displacement in cm³. |
items[].vehicle.kw | number | Motor power in kW. |
items[].claims | array | Caller-declared evidence, never verified automatically. eu_tr_customs_union: 0% EU duty only for TR origin, EU destination, chapters 25–97 outside ECSC coal/steel, otherwise claims_rejected [{claim,reason}]. US Section 301 (HTSUS ch.99 U.S. note 52) exemptions waive the country duty only when claimed AND the HTSUS line is on the official list: us_301_listed_article (described articles, 9903.05.87 and 9903.06.01/.03/.05/.08/.11/.13/.15/.17/.19/.21), us_civil_aircraft (9903.05.88), us_pharmaceutical_use (9903.05.89), us_cafta_dr (9903.06.06/.09). A waived layer appears in us_duty_layers.waived / calculation.waived_charges with because_of = heading and via = claim. |
items[].canada_review | object | Canada only: caller review, not engine-verified eligibility. CAD customs_value is adjusted CBSA value for duty. |
items[].canada_review.valuation_confirmedrequired when parent supplied | boolean | |
items[].canada_review.standard_gst_no_additional_charges_confirmedrequired when parent supplied | boolean | |
items[].clearance_country | string | EU member state of release; import VAT rate and country come from here (default: destination_country).Length: 2–2 |
items[].customs_procedure | string | 4000 release for free circulation; 4200 VAT-exempt import with onward intra-EU supply (Art. 143(1)(d) Directive 2006/112/EC). Only valid when clearance_country differs from destination_country.Values: 4000, 4200 |
items[].declaration_date | string | Rates, measures and VAT valid on this date (default: today). |
items[].inland_freight | number | Transport inside the EU to the first destination; enters the import VAT base only, never the customs value.Min: 0 |
items[].departure_country | string | Optional ISO country the goods are shipped from. Duties always follow origin_country; when it differs, origin_notes returns ORIGIN_DEPARTURE_DIFFER (US: transshipment does not remove origin-based additional duties).Length: 2–2 |
items[].loaded_on | string | Optional date the goods were loaded onto the vessel at the port of loading. Used for in-transit rules (US 9903.05.85: loaded before 2026-07-24 and entered before 2026-07-28 → no Section 301 country duty). If the entry date is inside a transit window and loaded_on is missing, missing contains CHARGE_IN_TRANSIT_UNKNOWN:<charge_code>. |
Request example
# Planned branded gateway; activate routing before production use.
curl --request POST 'https://xqustoms.com/api/v1/bulk-calculate' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"items": [
{
"hs_code": "6109100010",
"destination_country": "DE",
"origin_country": "CN",
"customs_value": 200,
"freight": 15,
"insurance": 2,
"net_mass_kg": 1.5,
"currency": "EUR",
"transport_mode": "road"
}
]
}'Response fields
- results · array
- One calculation response per input item in input order; per-item errors may occur.
- meta · object
- Batch quota and extra-billing metadata.
- us_duty_layers / origin_notes · object | null / array
- US only: MFN + origin-based additional duty layers with Chapter 99 headings, claimable exemptions and waived layers; departure ≠ origin note.
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"results": [
{
"hs_code": "6109100010",
"jurisdiction": "EU",
"duty_rate": null,
"vat": null,
"measures": [],
"required_documents": [],
"missing": [
"DUTY_RATE_MISSING",
"VAT_RATE_MISSING"
],
"meta": {
"quota_remaining": 99,
"billed_as_extra": false,
"disclaimer": "Estimate; binding assessment by customs authority."
},
"currency": "EUR",
"calculation": {
"cif_value": 217,
"duty": null,
"vat": null,
"total_taxes": null,
"complete": false
}
}
],
"meta": {
"quota_remaining": 99,
"billed_as_extra": false
}
}- Items may have different origin, destination and currency. Do not sum different currencies.
- Each item is treated as its own consignment for de minimis/fixed charges. Use evaluate-shipment for one shared declaration.
- US origin-based additional duties: when destination is US and origin_country is set, us_duty_layers = {hts_code, origin_country, base, mfn_rate, layers[{code,name,rate,ch99,top_up,condition?,possible_exemptions?[{heading,ref,text,claim}],verification_status,legal_basis}], waived[{code,because_of,via?}], additional_rate, total_rate, missing}. Rates are percentage points on customs value (transaction value, no international freight). Section 301 country rates (HTSUS 9903.05.20–9903.05.84, e.g. Türkiye 12.5% under 9903.05.79), Section 232 and their non-stacking rules come from the same engine as calculate. ch99 lists the Chapter 99 heading(s) to declare in addition to the HTSUS line. Top-up rules (EU, JP, CH: total duty = rate) add only the gap above MFN. All country rows are to_verify.
- calculation.charges[] carry ch99_headings (Chapter 99 heading parsed from the legal basis); waived_charges lists non-stacking or claimed exemptions.
/evaluate-shipmentShipment evaluation
One shared shipment context with per-item calculations, required documents and totals.
Quota: 1 unit per input item (1–100).
Request body
| Field | Type | Description & constraints |
|---|---|---|
origin_countryrequired | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
destination_countryrequired | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
incoterm | string | Informational only; does not infer costs or change the duty base.Length: 0–3 |
currency | string | Three-character currency code. No general automatic FX conversion.Default: "EUR" · Length: 3–3 |
payment_terms | string | Payment terms used to evaluate conditional charges, e.g. KKDF.Length: 0–40 |
transport_mode | string | Values: sea, air, road, rail, post |
itemsrequired | array | 1–100 items |
items[].hs_coderequired when parent supplied | string | Code with 4–12 digits after punctuation is stripped. This route may resolve a longer code through a rated prefix. |
items[].customs_valuerequired when parent supplied | number | Transaction/customs value in the given currency. Freight and insurance are supplied separately; do not include them twice.Min: 0 |
items[].freight | number | International freight. US calculations exclude this from the customs duty base.Min: 0 |
items[].insurance | number | International insurance. US calculations exclude this from the customs duty base.Min: 0 |
items[].net_mass_kg | number | Net mass for supported per-kg specific duty expressions. |
items[].vehicle | object | |
items[].vehicle.propulsionrequired when parent supplied | string | Values: ice, hybrid, phev, ev |
items[].vehicle.cc | number | Engine displacement in cm³. |
items[].vehicle.kw | number | Motor power in kW. |
items[].claims | array | Caller-declared evidence, never verified automatically. eu_tr_customs_union: 0% EU duty only for TR origin, EU destination, chapters 25–97 outside ECSC coal/steel, otherwise claims_rejected [{claim,reason}]. US Section 301 (HTSUS ch.99 U.S. note 52) exemptions waive the country duty only when claimed AND the HTSUS line is on the official list: us_301_listed_article (described articles, 9903.05.87 and 9903.06.01/.03/.05/.08/.11/.13/.15/.17/.19/.21), us_civil_aircraft (9903.05.88), us_pharmaceutical_use (9903.05.89), us_cafta_dr (9903.06.06/.09). A waived layer appears in us_duty_layers.waived / calculation.waived_charges with because_of = heading and via = claim. |
items[].canada_review | object | Canada only: caller review, not engine-verified eligibility. CAD customs_value is adjusted CBSA value for duty. |
items[].canada_review.valuation_confirmedrequired when parent supplied | boolean | |
items[].canada_review.standard_gst_no_additional_charges_confirmedrequired when parent supplied | boolean | |
items[].clearance_country | string | EU member state of release; import VAT rate and country come from here (default: destination_country).Length: 2–2 |
items[].customs_procedure | string | 4000 release for free circulation; 4200 VAT-exempt import with onward intra-EU supply (Art. 143(1)(d) Directive 2006/112/EC). Only valid when clearance_country differs from destination_country.Values: 4000, 4200 |
items[].declaration_date | string | Rates, measures and VAT valid on this date (default: today). |
items[].inland_freight | number | Transport inside the EU to the first destination; enters the import VAT base only, never the customs value.Min: 0 |
departure_country | string | Optional ISO country the goods are shipped from. Duties always follow origin_country; when it differs, origin_notes returns ORIGIN_DEPARTURE_DIFFER (US: transshipment does not remove origin-based additional duties).Length: 2–2 |
loaded_on | string | Optional date the goods were loaded onto the vessel at the port of loading. Used for in-transit rules (US 9903.05.85: loaded before 2026-07-24 and entered before 2026-07-28 → no Section 301 country duty). If the entry date is inside a transit window and loaded_on is missing, missing contains CHARGE_IN_TRANSIT_UNKNOWN:<charge_code>. |
Request example
# Planned branded gateway; activate routing before production use.
curl --request POST 'https://xqustoms.com/api/v1/evaluate-shipment' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"origin_country": "CN",
"destination_country": "DE",
"currency": "EUR",
"incoterm": "DAP",
"transport_mode": "sea",
"items": [
{
"hs_code": "6109100010",
"customs_value": 200,
"freight": 15,
"insurance": 2
}
]
}'Response fields
- items · array
- Per-item calculation and checks.
- totals · object | null
- duty, vat, charges, total_taxes. Null if any item reports missing data/error; do not manufacture a total.
- required_documents · array
- Deduplicated shipment document codes.
- blocked · boolean
- At least one loaded supply-chain check blocks the shipment.
- meta · object
- Quota and billing metadata.
- us_duty_layers / origin_notes · object | null / array
- US only: MFN + origin-based additional duty layers with Chapter 99 headings, claimable exemptions and waived layers; departure ≠ origin note.
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"origin_country": "CN",
"destination_country": "DE",
"currency": "EUR",
"totals": null,
"required_documents": [],
"blocked": false,
"items": [
{
"hs_code": "6109100010",
"jurisdiction": "EU",
"duty_rate": null,
"vat": null,
"measures": [],
"required_documents": [],
"missing": [
"DUTY_RATE_MISSING",
"VAT_RATE_MISSING"
],
"meta": {
"quota_remaining": 99,
"billed_as_extra": false,
"disclaimer": "Estimate; binding assessment by customs authority."
},
"currency": "EUR",
"calculation": {
"cif_value": 217,
"duty": null,
"vat": null,
"total_taxes": null,
"complete": false
}
}
],
"meta": {
"quota_remaining": 99
}
}- Fixed per-declaration charges apply once, on the first item. De minimis evaluates the whole consignment.
- blocked=false does not replace a complete legal or compliance review.
- No customs submission, MRN generation or automatic ATLAS declaration is performed by this endpoint.
- US origin-based additional duties: when destination is US and origin_country is set, us_duty_layers = {hts_code, origin_country, base, mfn_rate, layers[{code,name,rate,ch99,top_up,condition?,possible_exemptions?[{heading,ref,text,claim}],verification_status,legal_basis}], waived[{code,because_of,via?}], additional_rate, total_rate, missing}. Rates are percentage points on customs value (transaction value, no international freight). Section 301 country rates (HTSUS 9903.05.20–9903.05.84, e.g. Türkiye 12.5% under 9903.05.79), Section 232 and their non-stacking rules come from the same engine as calculate. ch99 lists the Chapter 99 heading(s) to declare in addition to the HTSUS line. Top-up rules (EU, JP, CH: total duty = rate) add only the gap above MFN. All country rows are to_verify.
- calculation.charges[] carry ch99_headings (Chapter 99 heading parsed from the legal basis); waived_charges lists non-stacking or claimed exemptions.
/validate-codeCode validation
Validate code digits and supplied value/weight against an available country/regime rule.
Quota: 1 unit per request.
Request body
| Field | Type | Description & constraints |
|---|---|---|
hs_coderequired | string | |
countryrequired | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
regimerequired | string | Length: 2–30 |
value_eur | number | Min: 0 |
gross_kg | number | Min: 0 |
Request example
# Planned branded gateway; activate routing before production use.
curl --request POST 'https://xqustoms.com/api/v1/validate-code' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"hs_code": "6203423100",
"country": "DE",
"regime": "import"
}'Response fields
- valid / issues · boolean / array
- Rule result and block/warning issue codes.
- rule · object | null
- Country/regime rule and verification metadata.
- code_exists · string
- FOUND, NOT_FOUND or NOMENCLATURE_NOT_LOADED.
- required_checks · array
- Additional checks required by the loaded rule.
- meta · object
- Remaining quota.
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"code_exists": "FOUND",
"required_checks": [],
"meta": {
"quota_remaining": 99
}
}- This legacy validation route checks the shared tree, not the complete national-line engine. TR existence currently reports NOMENCLATURE_NOT_LOADED even when the national TR catalogue is loaded.
- Use hs-lookup for national declarability; do not interpret this endpoint as a cross-country code mapping.
/bulk-verify-shipmentBulk shipment validation
Apply one country/regime rule to a shipment and all its codes, including shipment value/weight limits.
Quota: 1 unit per input item (1–200).
Request body
| Field | Type | Description & constraints |
|---|---|---|
contextrequired | object | |
context.trade_directionrequired when parent supplied | string | Values: import, export, transit |
context.customs_regimerequired when parent supplied | string | Rule key, e.g. import or etgb; availability depends on loaded country rules.Length: 2–30 |
context.origin_countryrequired when parent supplied | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
context.destination_countryrequired when parent supplied | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
context.gross_mass_kg | number | Shipment gross mass, not per-item mass.Min: 0 |
itemsrequired | array | 1–200 items |
items[].ref | string | Length: 0–64 |
items[].hs_coderequired when parent supplied | string | Length: 4–14 |
items[].description | string | Length: 0–500 |
items[].quantity | number | |
items[].unit_price | number | Min: 0 |
items[].currency | string | Length: 3–3 |
Request example
# Planned branded gateway; activate routing before production use.
curl --request POST 'https://xqustoms.com/api/v1/bulk-verify-shipment' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"context": {
"trade_direction": "export",
"customs_regime": "etgb",
"origin_country": "TR",
"destination_country": "DE",
"gross_mass_kg": 3.8
},
"items": [
{
"ref": "ERP-1",
"hs_code": "420310000000",
"quantity": 2,
"unit_price": 120,
"currency": "EUR"
}
]
}'Response fields
- valid · boolean
- All items and shipment rules passed blocking checks.
- rule_country / rule_verification · string | null
- Rule selected by direction and verification state.
- shipment_issues · array
- Shipment-level value/weight issues.
- items · array
- ref, input_code, declared_code, code_exists, valid and issues.
- value_eur_total · number | null
- Summed quantity × unit_price only if all supplied currencies are EUR.
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"rule_country": "TR",
"regime": "etgb",
"valid": false,
"shipment_issues": [],
"items": [],
"value_eur_total": 240,
"meta": {
"quota_remaining": 99
}
}- Exports validate origin rules; imports validate destination rules. TR code existence uses the legacy limitation documented under validate-code.
- Omitted unit prices contribute zero; omitted quantity defaults to 1. Supply complete values before using a threshold check.
- Missing rules block validation; to_verify rules are explicitly unverified.
/classify-interactiveInteractive classification
Explainable descent through the official shared HS/EU tree with follow-up questions.
Quota: 1 unit when a session starts. Follow-up choices in that session are not charged.
Request body
| Field | Type | Description & constraints |
|---|---|---|
session_id | string | Use the returned session ID for follow-up questions. |
selected_code | string | A child option returned by the preceding question. |
context | object | |
context.trade_directionrequired when parent supplied | string | Values: import, export, transit |
context.customs_regimerequired when parent supplied | string | Rule key, e.g. import or etgb; availability depends on loaded country rules.Length: 2–30 |
context.origin_countryrequired when parent supplied | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
context.destination_countryrequired when parent supplied | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
context.gross_mass_kg | number | Shipment gross mass, not per-item mass.Min: 0 |
item | object | |
item.descriptionrequired when parent supplied | string | Length: 2–300 |
item.quantity | number | |
item.unit_price | number | Min: 0 |
item.currency | string | Default: "EUR" · Length: 3–3 |
item.origin_country | string | ISO 3166-1 alpha-2 country code; normalized to uppercase.Length: 2–2 |
item.net_mass_kg | number |
Request example
# Planned branded gateway; activate routing before production use.
curl --request POST 'https://xqustoms.com/api/v1/classify-interactive' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"item": {
"description": "cotton trousers",
"quantity": 1,
"unit_price": 200,
"currency": "EUR"
},
"context": {
"trade_direction": "import",
"customs_regime": "import",
"origin_country": "TR",
"destination_country": "DE"
}
}'Response fields
- status · string
- CLARIFICATION_REQUIRED, RESOLVED or NO_CANDIDATES.
- session_id / path · string / array
- Session bound to the API key and selected official tree path.
- question · object
- Text and options; follow-up body: session_id + selected_code.
- hs_code / regime_check · object
- Resolved declared/stored code, descriptions and rule issues.
- landed_cost_preview · object
- EUR-only MFN preview, without preferences or freight/insurance; use calculate for full cost.
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"status": "CLARIFICATION_REQUIRED",
"session_id": "11111111-1111-4111-8111-111111111111",
"question": {
"code": "HEADING",
"text": "Which heading describes the goods?",
"options": []
},
"meta": {
"quota_remaining": 99
}
}- Sessions cannot be continued with another API key. Resolved sessions return 409 SESSION_RESOLVED.
- This route is the shared HS/EU classifier, not a full national US/TR/UK classifier. Use product-lookup for national suggestions.
- Learned shortcuts require at least 5 confirmations and 95% agreement; legal classification is never guaranteed.
/classification-feedbackClassification feedback
Record a confirmation or rejection for the learning graph.
Quota: No quota unit is consumed by the current implementation.
Request body
| Field | Type | Description & constraints |
|---|---|---|
descriptionrequired | string | Length: 2–300 |
hs_coderequired | string | |
confirmedrequired | boolean | |
context_key | string | Length: 0–60 |
Request example
# Planned branded gateway; activate routing before production use.
curl --request POST 'https://xqustoms.com/api/v1/classification-feedback' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"description": "cotton t-shirt",
"hs_code": "6109100010",
"confirmed": true,
"context_key": "erp-product-review"
}'Response fields
- recorded · boolean
- true when stored successfully.
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"recorded": true
}- Only submit feedback after expert review; this endpoint does not verify the correctness of the supplied code.
- Do not send buyer identities or other unnecessary personal information in description/context_key.
/quotaQuota & usage
Read the API key’s included quota, usage and extra-query settings.
Quota: No quota unit is consumed.
Request example
# Planned branded gateway; activate routing before production use.
curl --request GET 'https://xqustoms.com/api/v1/quota' \
--header "x-api-key: $XQUSTOMS_API_KEY" \
--header 'Content-Type: application/json'Response fields
- client_system · string | null
- Assigned integration system.
- monthly_quota / used / remaining · integer
- Included quota, included usage and non-negative included balance.
- extra_queries_used · integer
- Usage beyond the included quota.
- extra_query_price · number
- Configured unit price; no universal price is promised.
Illustrative response structure
Abbreviated example, not a live assessment. Empty arrays and null values are placeholders, not evidence of exemption or missing production data.
{
"client_system": "third_party",
"monthly_quota": 100,
"used": 1,
"remaining": 99,
"extra_queries_used": 0,
"extra_query_price": 0
}- Authentication is still required. A zero remaining balance can allow extra billed requests if enabled for the key.
- Use quota monitoring; it does not reserve units for the next request.
