# ics2.check

Select an ICS2 Release 3 ENS filing and pre-check required fields, goods descriptions, HS6 and EORI format for one consignment.

- REST: `POST https://api.kanagu.dev/v1/ics2/check`
- MCP: `call_operation` with `operation: "ics2.check"` at https://api.kanagu.dev/mcp
- Price: $0.10 USD per consignment, on successful calls only.
- Auth: `Authorization: Bearer <key>` for REST and `call_operation`. Retries: reuse `Idempotency-Key` (MCP: `idempotencyKey`).

## Compliance coverage

- Domain: Trade
- Jurisdictions: EU
- Standard: DG TAXUD ICS2 Harmonised Trader Interface (CFSS), IE annex, Rules & Conditions and code lists 2.04 corrigendum (2025-04-03) — https://circabc.europa.eu/sd/a/295ac67a-5de0-4510-837d-30d8671b9bf7/ICS2-HTI-v2.04_corrigendum-EO.zip
- Standard: DG TAXUD ICS2 Common Technical System Specifications, EO Technical Service Contracts 3.2.0.0 (2025-10-30) — https://circabc.europa.eu/sd/a/5c528a3e-b9b8-4e6f-82ac-272962a92514/ICS2-3.2.0.0-CTSS-EO-Package.7z
- Standard: DG TAXUD ICS2 Harmonised Trader Interface Control Document 4.10 (2026-01-09) — https://circabc.europa.eu/sd/a/4d43c934-bccf-4b84-b8a3-1a1f78e6f437/ICS2-HTI-Interface-Control-Document-v4.10.pdf
- Standard: DG TAXUD Introduction of Stop Words/Phrases in the Common Repository 2026-08-03 implementation (2026-08-03) — https://circabc.europa.eu/sd/a/e9bb2d8d-c5a5-4997-a78b-f444fbf424ff/List-of-stop-words-03.08.2026.pdf
- Standard: DG TAXUD Whitelisting of Goods Descriptions in the Common Repository 2026-11-17 implementation (2026-11-17) — https://circabc.europa.eu/sd/a/838fab80-ff2e-40f5-8ec6-caa988f077c0/Whitelisted-ICS2-goods-descriptions-17.11.2026.pdf
- Standard: DG TAXUD Economic Operators Registration and Identification Guidance Ares(2023)7741322 (2023-08-30) — https://taxation-customs.ec.europa.eu/document/download/bbe4c653-3b6d-4bed-932c-61bb77711384_en
- Verification: Offline JSON pre-check against the pinned HTI filing scenarios, ENS XSD structure and cardinalities, annotated presence conditions, and DG TAXUD goods-description and EORI guidance.
- Last reviewed: 2026-11-26

## Request body

- `transportMode` ("sea" | "rail" | "road" | "air" | "inland_waterway", required): Mode of transport at the customs border.
- `cargoType` ("general" | "express" | "postal", required): General freight, express consignment, or postal consignment.
- `dataset` ("complete_prearrival" | "complete_prearrival_straight" | "complete_prearrival_with_house" | "complete_prearrival_express_on_general_air" | "complete_preloading" | "complete_preloading_straight" | … (18 values), required): Scope of this filing, based on who supplies the master, house and consignee data and the applicable filing phase.
- `declaration` (object, required): One ENS payload in JSON using exact ICS2 XML element names, without the IE3Fxx wrapper. Use arrays for repeatable elements, strings for leaf values, and @name for XML attributes.

## Response

- `status` ("issues_found" | "needs_review" | "no_issues_in_checked_rules", required)
- `filing` (object | null, required)
- `supportedDatasets` (array of string, required)
- `findings` (array of object, required)
- `findings[].severity` ("error" | "needs_review", required)
- `findings[].code` (string, required)
- `findings[].path` (string, required): JSON Pointer into the request.
- `findings[].rule` (string, required)
- `findings[].expected` (string, required)
- `findings[].actual` (string | null, required)
- `findings[].source` (object, required)
- `findings[].source.name` (string, required)
- `findings[].source.version` (string, required)
- `findings[].source.date` (string (date), required)
- `findings[].source.url` (string (uri), required)
- `findingCount` (integer (0 to 9007199254740991), required): Total findings. At most 250 are returned.
- `verification` (string, required)
- `standards` (array of object, required)
- `standards[].name` (string, required)
- `standards[].version` (string, required)
- `standards[].date` (string (date), required)
- `standards[].url` (string (uri), required)

## Example

```sh
curl https://api.kanagu.dev/v1/ics2/check \
  -H "Authorization: Bearer $KANAGU_KEY" \
  -H "Content-Type: application/json" \
  -d '{"transportMode":"sea","cargoType":"general","dataset":"house_with_consignee_data","declaration":{"LRN":"NVOCC-260112-001","documentIssueDate":{"DateTime":"2026-11-26T09:15:00Z"},"SpecificCircumstanceIndicator":"F15","activeBorderTransportMeans":{"ModeOfTransport":"1"},"consignmentMasterLevel":{"consignmentHouseLevel":{"goodsItem":[{"goodsItemNumber":"1","commodity":{"descriptionOfGoods":"Stainless steel kitchen sinks","commodityCode":{"harmonizedSystemSubHeadingCode":"732410"}}}]}}}}'
```

```ts
const res = await fetch("https://api.kanagu.dev/v1/ics2/check", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KANAGU_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "transportMode": "sea",
    "cargoType": "general",
    "dataset": "house_with_consignee_data",
    "declaration": {
      "LRN": "NVOCC-260112-001",
      "documentIssueDate": {
        "DateTime": "2026-11-26T09:15:00Z"
      },
      "SpecificCircumstanceIndicator": "F15",
      "activeBorderTransportMeans": {
        "ModeOfTransport": "1"
      },
      "consignmentMasterLevel": {
        "consignmentHouseLevel": {
          "goodsItem": [
            {
              "goodsItemNumber": "1",
              "commodity": {
                "descriptionOfGoods": "Stainless steel kitchen sinks",
                "commodityCode": {
                  "harmonizedSystemSubHeadingCode": "732410"
                }
              }
            }
          ]
        }
      }
    }
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();
```

## Errors

JSON `{"error":{"code","message"}}`.

- 400 `invalid_input`: The body does not match the request schema. The message names each field.
- 400 `invalid_json`: The body is missing or is not valid JSON.
- 400 `invalid_idempotency_key`: Idempotency-Key must be 1–128 visible ASCII characters.
- 401 `invalid_api_key`: The Bearer key is missing, malformed, invalid or inactive.
- 402 `free_allowance_exhausted`: This month's free usage is used up and the account has no subscription. Subscribe from the dashboard, or wait for the next UTC month; Retry-After gives the seconds left.
- 404 `not_found`: No operation at this path.
- 409 `idempotency_conflict`: The Idempotency-Key was already used with a different body.
- 413 `payload_too_large`: JSON bodies may be at most 64 KiB.
- 500 `internal_error`: The call failed on our side. It is not billed; retry with the same Idempotency-Key.

## JSON Schema

Request:
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "transportMode": {
      "type": "string",
      "enum": [
        "sea",
        "rail",
        "road",
        "air",
        "inland_waterway"
      ],
      "description": "Mode of transport at the customs border."
    },
    "cargoType": {
      "type": "string",
      "enum": [
        "general",
        "express",
        "postal"
      ],
      "description": "General freight, express consignment, or postal consignment."
    },
    "dataset": {
      "type": "string",
      "enum": [
        "complete_prearrival",
        "complete_prearrival_straight",
        "complete_prearrival_with_house",
        "complete_prearrival_express_on_general_air",
        "complete_preloading",
        "complete_preloading_straight",
        "master_only",
        "straight_without_consignee_data",
        "house_only",
        "house_without_consignee_data",
        "house_with_consignee_data",
        "consignee_data_for_house",
        "consignee_data_for_straight",
        "preloading_minimum",
        "preloading_minimum_with_master_reference",
        "preloading_master_reference_only",
        "preloading_with_house_details",
        "postal_receptacles"
      ],
      "description": "Scope of this filing, based on who supplies the master, house and consignee data and the applicable filing phase."
    },
    "declaration": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {},
      "description": "One ENS payload in JSON using exact ICS2 XML element names, without the IE3Fxx wrapper. Use arrays for repeatable elements, strings for leaf values, and @name for XML attributes."
    }
  },
  "required": [
    "transportMode",
    "cargoType",
    "dataset",
    "declaration"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "transportMode": "sea",
      "cargoType": "general",
      "dataset": "house_with_consignee_data",
      "declaration": {
        "LRN": "NVOCC-260112-001",
        "documentIssueDate": {
          "DateTime": "2026-11-26T09:15:00Z"
        },
        "SpecificCircumstanceIndicator": "F15",
        "activeBorderTransportMeans": {
          "ModeOfTransport": "1"
        },
        "consignmentMasterLevel": {
          "consignmentHouseLevel": {
            "goodsItem": [
              {
                "goodsItemNumber": "1",
                "commodity": {
                  "descriptionOfGoods": "Stainless steel kitchen sinks",
                  "commodityCode": {
                    "harmonizedSystemSubHeadingCode": "732410"
                  }
                }
              }
            ]
          }
        }
      }
    }
  ]
}
```

Response:
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "issues_found",
        "needs_review",
        "no_issues_in_checked_rules"
      ]
    },
    "filing": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "messageId": {
              "type": "string"
            },
            "namespace": {
              "type": "string"
            },
            "source": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                },
                "date": {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "name",
                "version",
                "date",
                "url"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "code",
            "messageId",
            "namespace",
            "source"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "supportedDatasets": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "error",
              "needs_review"
            ]
          },
          "code": {
            "type": "string"
          },
          "path": {
            "type": "string",
            "description": "JSON Pointer into the request."
          },
          "rule": {
            "type": "string"
          },
          "expected": {
            "type": "string"
          },
          "actual": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              },
              "date": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "name",
              "version",
              "date",
              "url"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "severity",
          "code",
          "path",
          "rule",
          "expected",
          "actual",
          "source"
        ],
        "additionalProperties": false
      }
    },
    "findingCount": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "description": "Total findings. At most 250 are returned."
    },
    "verification": {
      "type": "string"
    },
    "standards": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "name",
          "version",
          "date",
          "url"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "status",
    "filing",
    "supportedDatasets",
    "findings",
    "findingCount",
    "verification",
    "standards"
  ],
  "additionalProperties": false
}
```
