Skip to main content

Customs API: ISF filings, importers and webhooks

Getting Customs

The routes answer for an organisation that has the Customs product: chosen at sign-up, or switched on in Settings › Products (PUT /api/v1/settings/products with {"customs": true}). Without it, every /api/v1/customs/* call answers 403. See the overview.

Every route is under https://app.goroute.ai/peppol-api/api/v1/customs/ and takes the same X-API-Key header as the rest of the GoRoute API (Authentication). Permissions are per product: customs:read to read, customs:file to file, amend and delete, customs:manage for importers, the agreement, the set-up and the plan. An API key with the customs scope holds all three and nothing else; an admin key holds them too.

Routes​

RouteWhat it doesPermission
GET /customs/profile · PUTYour filer set-up: role (forwarder, broker, importer_self) and email notificationscustoms:read · customs:manage
GET /customs/importersThe importers you file forcustoms:read
POST /customs/importersCreate an importer: its organisation under yours and its customs profilecustoms:manage
GET /customs/importers/{org_id} · PATCHRead or change an importer's profilecustoms:read · customs:manage
GET /customs/agreementThe agency agreement's text, with the importer's fields blank (HTML)customs:read
GET /customs/importers/{org_id}/agreementThe agreement as this importer's signatory will sign it (HTML)customs:read
POST /customs/importers/{org_id}/agreement/signRecord the signature on the ISF filing agency agreementcustoms:manage
GET /customs/importers/{org_id}/agreement.pdfThe signed agreementcustoms:read
POST /customs/isf/validateRun every check on an ISF and file nothingcustoms:file
POST /customs/isfFile an ISF-10 or ISF-5customs:file
POST /customs/isf/{id}/replaceAmend: transmit a replacement under CBP's transaction numbercustoms:file
POST /customs/isf/{id}/deleteDelete an accepted ISF at CBPcustoms:file
GET /customs/filingsList filings, filtered by importer, status, bill and datecustoms:read
GET /customs/filings/{id}One filing, with its versions, CBP's messages and its retention datecustoms:read
GET /customs/filings/export.csvThe filings list as CSVcustoms:read
GET /customs/parties · POST · DELETE /customs/parties/{id}Your address book of parties from earlier filingscustoms:read · customs:file
GET /customs/hts?q=Search the US Harmonized Tariff Schedulecustoms:read
GET /customs/referenceSuggestion lists: common US seaport codes and ocean carrier SCACscustoms:read
GET /customs/planYour plan, the filings used this month, prices, whether a card is on filecustoms:read
POST /customs/plan/checkout-sessionA Stripe Checkout page for Pay as you go or Pro ({"plan": "payg"} or "pro")customs:manage
POST /customs/plan/card-sessionA Stripe page that saves a card and charges nothingcustoms:manage
POST /customs/plan/portal-sessionStripe's page for the card, receipts and cancellingcustoms:manage
GET /customs/dashboard?days=30The numbers the Customs home section showscustoms:read

Importers​

An importer is an organisation beneath yours. Its org_id is the id every importer route and every filing uses.

Create an importer​

curl -X POST "https://app.goroute.ai/peppol-api/api/v1/customs/importers" \
-H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{
"legal_name": "Example Imports LLC",
"country": "US",
"contact_email": "ops@example.com",
"ior_qualifier": "EI",
"ior_number": "12-345678900",
"bond_type": "8",
"bond_activity_code": "01",
"surety_code": "123",
"address": {"line1": "40 Example Street", "city": "Long Beach", "state": "CA",
"postal_code": "90802", "country": "US"}
}'

201:

{
"org_id": "3f1c2a9e-5b7d-4c21-9e0a-7a1f0c2d9b44",
"filer_org_id": "8d2e6b10-4c3a-4f5e-9a71-2b6c0d4e8f13",
"org_name": "Example Imports LLC",
"legal_name": "Example Imports LLC",
"ior_qualifier": "EI",
"ior_number_masked": "**-*****8900",
"bond_type": "8",
"bond_activity_code": "01",
"surety_code": "123",
"bond_number_masked": null,
"address": {"line1": "40 Example Street", "city": "Long Beach", "state": "CA",
"postal_code": "90802", "country": "US"},
"status": "pending",
"bond_complete": true,
"review": {"status": "not_required", "decided_at": null, "decided_by": null, "note": null},
"agreement": {"signed": false, "version": null, "signed_at": null, "signed_by_name": null,
"signed_by_title": null, "signed_by_email": null, "pdf_available": false},
"created_at": "2026-11-23T14:00:05+00:00",
"updated_at": "2026-11-23T14:00:05+00:00"
}
FieldValues
ior_qualifierEI (IRS number, NN-NNNNNNNXX: the EIN and a two-character suffix), ANI (CBP-assigned, YYDDPP-NNNNN) or 34 (SSN, NNN-NN-NNNN)
bond_type8 continuous or 9 single transaction
bond_activity_code01, 02, 03, 04 or 16; a type 9 bond uses 16
surety_code, bond_numberBoth required for a type 9 bond
org_idOptional: an existing client organisation beneath yours to give a customs profile, instead of creating a new one
nameOptional: the organisation's name, if it differs from legal_name

The importer number and bond number are encrypted at rest and only ever returned masked. status is pending until the agreement is signed and the bond is complete, then ready. PATCH takes the same fields, all optional, plus status: "suspended" to stop filing for an importer.

review.status is pending_review for your first importer during the product's first month in production: GoRoute looks at it before its first filing. Filings for it answer 422 CUSTOMS_IMPORTER_REVIEW_PENDING until it is approved.

Sign the agreement​

curl -X POST "https://app.goroute.ai/peppol-api/api/v1/customs/importers/3f1c2a9e-5b7d-4c21-9e0a-7a1f0c2d9b44/agreement/sign" \
-H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"signer_name": "Dana Example", "signer_title": "Director",
"signer_email": "dana@example.com", "accepted": true}'

The answer is the importer's profile, with:

{
"status": "ready",
"agreement": {"signed": true, "version": "v1", "signed_at": "2026-11-23T14:02:11+00:00",
"signed_by_name": "Dana Example", "signed_by_title": "Director",
"signed_by_email": "dana@example.com", "pdf_available": true}
}

signer_name, signer_email and "accepted": true are required (else 422 CUSTOMS_AGREEMENT_NOT_ACCEPTED). The signer's IP address is recorded from the request. Download the signed PDF from GET /customs/importers/{org_id}/agreement.pdf.

The ISF request​

POST /customs/isf takes GoRoute's envelope around the filing itself:

FieldRequiredWhat it is
importer_org_idyesThe importer the filing is for
lading_dateyesWhen the cargo is laden at the foreign port (ISO 8601). The deadline is 24 hours before it
filingyesThe ISF, below
late_acknowledgednotrue to file after the cut-off (see The late rule)
referencenoYour own id for the shipment, up to 120 characters
vessel_name, voyage_number, etanoShown on the filing's row
processing_portnoLeave empty for the default

Unknown fields are refused, in the envelope and in filing.

filing:

FieldWhat it is
submission_type1 ISF-10, 2 ISF-5, 3 ISF-5 changed to ISF-10, 4 ISF-10 changed to ISF-5
shipment_type01 standard (default) to 11 informal. An ISF-5 uses 01
billsAt least one {qualifier, identifier}: OB regular bill or BM house bill; the identifier is the SCAC followed by the bill number, letters and digits only
entitiesThe parties, each with a code (below)
action_reasonCT complete (default), FR flexible range, FT flexible timing, FX both
bondLeft out: taken from the importer's profile for the shipment types that need one
importer_qualifier, importer_numberLeft empty: taken from the importer's profile
referencesOptional {qualifier, value}: 6B, 6C, MB, CR, FN and others from CBP's list
containersOptional {description_code, initial, number, check_digit, size_type_code}
tariffs, frobISF-5 only: the HTSUS numbers and the foreign port of unlading and place of delivery
low_valueShipment type 11 only

Entity codes: MF manufacturer, SE seller, BY buyer, ST ship-to party, LG container stuffing location, CS consolidator, IM importer of record, CN consignee, BKP booking party. A named party carries name, address (a list of {qualifier, text} lines, 15 for a free-text line), city and country, and may carry subdivision and postal_code. IM and CN are reported by number only: send them with just their code and GoRoute fills in the importer's own number.

KindEntities it needs
ISF-10MF, SE, BY, ST, CS, LG, IM, CN. Every MF carries tariffs, each with hts (6, 8 or 10 digits) and country_of_origin. With FT or FX, CS and LG may follow in an amendment
ISF-5BKP and ST, no MF, plus tariffs (hts only) and frob on the filing

An ISF-10​

curl -X POST "https://app.goroute.ai/peppol-api/api/v1/customs/isf" \
-H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d @isf.json

isf.json:

{
"importer_org_id": "3f1c2a9e-5b7d-4c21-9e0a-7a1f0c2d9b44",
"lading_date": "2026-12-01T08:00:00Z",
"reference": "PO-77812",
"vessel_name": "EXAMPLE STAR",
"voyage_number": "248E",
"eta": "2026-12-15",
"filing": {
"submission_type": "1",
"shipment_type": "01",
"bills": [{"qualifier": "OB", "identifier": "ABCD123456789"}],
"entities": [
{"code": "MF", "name": "Example Furniture Works Ltd",
"address": [{"qualifier": "15", "text": "88 Harbour Road"}], "city": "Ningbo", "country": "CN",
"tariffs": [{"hts": "940360", "country_of_origin": "CN"}]},
{"code": "SE", "name": "Example Trading Co Ltd",
"address": [{"qualifier": "15", "text": "1 Export Avenue"}], "city": "Ningbo", "country": "CN"},
{"code": "BY", "name": "Example Imports LLC",
"address": [{"qualifier": "15", "text": "40 Example Street"}], "city": "Long Beach",
"subdivision": "CA", "postal_code": "90802", "country": "US"},
{"code": "ST", "name": "Example Warehouse",
"address": [{"qualifier": "15", "text": "12 Dock Avenue"}], "city": "Carson",
"subdivision": "CA", "postal_code": "90745", "country": "US"},
{"code": "LG", "name": "Example CFS",
"address": [{"qualifier": "15", "text": "1 Port Road"}], "city": "Ningbo", "country": "CN"},
{"code": "CS", "name": "Example CFS",
"address": [{"qualifier": "15", "text": "1 Port Road"}], "city": "Ningbo", "country": "CN"},
{"code": "IM"},
{"code": "CN"}
]
}
}

An ISF-5​

{
"importer_org_id": "3f1c2a9e-5b7d-4c21-9e0a-7a1f0c2d9b44",
"lading_date": "2026-12-01T08:00:00Z",
"filing": {
"submission_type": "2",
"shipment_type": "01",
"bills": [{"qualifier": "OB", "identifier": "ABCD987654321"}],
"entities": [
{"code": "BKP", "name": "Example Logistics Ltd",
"address": [{"qualifier": "15", "text": "5 Freight Lane"}], "city": "Shanghai", "country": "CN"},
{"code": "ST", "name": "Example Distribution SA",
"address": [{"qualifier": "15", "text": "200 Avenida Ejemplo"}], "city": "Manzanillo", "country": "MX"}
],
"tariffs": [{"hts": "940360"}],
"frob": {"foreign_port_qualifier": "UN", "foreign_port_of_unlading": "MXZLO",
"place_of_delivery_qualifier": "UN", "place_of_delivery": "MXZLO"}
}
}

foreign_port_qualifier and place_of_delivery_qualifier are UN (UN/LOCODE) or K (CBP Schedule K).

Check without filing​

POST /customs/isf/validate takes the same body and runs the same checks: the importer's readiness, CBP's rules and the 24-hour clock. It writes nothing, sends nothing to CBP and fires no webhook.

{
"test": true,
"importer_org_id": "3f1c2a9e-5b7d-4c21-9e0a-7a1f0c2d9b44",
"importer_name": "Example Imports LLC",
"valid": true,
"problems": [],
"deadline_at": "2026-11-30T08:00:00+00:00",
"late": false,
"late_acknowledgement_required": false,
"gateway": {"configured": true, "environment": "prod"},
"preview": {"record_count": 12, "records": ["…"], "environment": "prod"},
"simulated_answer": {"application_id": "SN", "disposition": "ACCEPTED",
"narrative": "ISF ACCEPTED (SIMULATED — nothing was filed)",
"transaction_number": "S2R-00000000000", "test": true}
}

preview holds the records the filing would be transmitted as. An invalid filing answers "valid": false with the problems and no simulated_answer.

The answer to a filing​

202, once CBP has the filing:

{
"filing": {
"id": "c9b7e2d4-1f3a-4b8e-a6c5-0d2e4f6a8b1c",
"importer_org_id": "3f1c2a9e-5b7d-4c21-9e0a-7a1f0c2d9b44",
"importer_name": "Example Imports LLC",
"filer_org_id": "8d2e6b10-4c3a-4f5e-9a71-2b6c0d4e8f13",
"kind": "isf10",
"reference": "PO-77812",
"bill": {"qualifier": "OB", "number": "ABCD123456789"},
"vessel_name": "EXAMPLE STAR",
"voyage_number": "248E",
"eta": "2026-12-15",
"lading_date": "2026-12-01T08:00:00+00:00",
"state": "sent",
"cbp_transaction_number": null,
"deadline_at": "2026-11-30T08:00:00+00:00",
"filed_at": "2026-11-23T14:10:02+00:00",
"late_acknowledged": false,
"late_ack_by": null,
"late_ack_at": null,
"awaiting_cbp_minutes": 0,
"cbp_answer_overdue": false,
"last_message_at": "2026-11-23T14:10:02+00:00",
"last_disposition": null,
"cbp_status": null,
"last_error": null,
"created_by": "api_key:2b7d0c1e-6a4f-4e1b-9c3d-5f8a7b6e4d21",
"created_at": "2026-11-23T14:10:01+00:00",
"updated_at": "2026-11-23T14:10:02+00:00"
},
"version": {
"id": "5a0c…",
"filing_id": "c9b7e2d4-1f3a-4b8e-a6c5-0d2e4f6a8b1c",
"action": "add",
"gateway_message_id": "414d5120…",
"request": {"reference": "PO-77812", "filing": {"…": "the filing as transmitted"}},
"batch_preview": {"records": ["…"], "record_count": 12, "environment": "prod", "action": "add"},
"sent_at": "2026-11-23T14:10:02+00:00"
},
"retention": {
"rule": "19 CFR 163.4: five years from the filing date",
"anchor": "2026-11-23T14:10:02+00:00",
"retain_until": "2031-11-24T14:10:02+00:00",
"days_left": 1827,
"deletable": false
}
}

state becomes accepted, rejected or (after a deletion) deleted when CBP's status notification arrives, usually within a minute. Read it with GET /customs/filings/{id} or take the webhook. The other states are queued (handed to the gateway) and error (the gateway could not take it; nothing reached CBP; file it again). cbp_answer_overdue turns true after ten minutes without an answer. created_by (and late_ack_by on a late filing) is the signed-in user's email, or api_key:<key id> for a filing made with an API key.

Errors​

Every customs refusal has the same body:

{
"code": "CUSTOMS_ISF_INVALID",
"message": "The ISF has 1 problem(s); nothing was filed.",
"action": "Correct the fields named in details and submit again.",
"details": [
{"field": "entities[0].tariffs[0].country_of_origin",
"message": "HTS 940360: Country of origin is required on an ISF-10", "ref": "ISF-36"}
]
}
StatusCodeWhen
422CUSTOMS_ISF_INVALIDThe ISF breaks one of CBP's rules; details names each field
422CUSTOMS_ISF_LATE_NOT_ACKNOWLEDGEDThe cut-off has passed; send again with "late_acknowledged": true to file late
422CUSTOMS_IMPORTER_AGREEMENT_UNSIGNEDThe importer has not signed the agency agreement
422CUSTOMS_IMPORTER_BOND_MISSINGThe importer's bond is incomplete
422CUSTOMS_IMPORTER_REVIEW_PENDINGYour first importer awaits GoRoute's review
422CUSTOMS_IMPORTER_INVALIDAn importer field is in the wrong format
422CUSTOMS_IMPORTER_LIMITYou have reached your limit of importer organisations (500 unless raised)
422CUSTOMS_AGREEMENT_NOT_ACCEPTEDThe signature lacks the acceptance, name or email
402CUSTOMS_FILING_LIMITThe Free plan's 3 filings this month are used; choose Pay as you go or Pro
402CUSTOMS_CARD_REQUIREDOn the Free plan, save a card (POST /customs/plan/card-session) before the first filing
409CUSTOMS_ISF_DUPLICATE_BILLThis importer already has an ISF accepted or awaiting CBP for that bill; amend it instead
409CUSTOMS_ISF_STATEThe filing's state does not allow this (for example deleting a rejected ISF)
409CUSTOMS_ISF_NO_TRANSACTION_NUMBERAn amendment or deletion needs the transaction number CBP has not yet returned
409CUSTOMS_IMPORTER_EXISTSThat organisation already has a customs profile
404CUSTOMS_IMPORTER_NOT_FOUND, CUSTOMS_FILING_NOT_FOUNDNo such importer or filing in your organisations
403CUSTOMS_IMPORTER_NOT_IN_SUBTREEThe org_id given is not an organisation beneath yours
502CUSTOMS_GATEWAY_ERRORThe CBP gateway refused or failed; nothing reached CBP; the filing is marked error and can be filed again
503CUSTOMS_GATEWAY_UNAVAILABLEFiling is not available on this environment

A missing permission answers 403 INSUFFICIENT_PERMISSION. Only a new ISF counts against the plan and needs a card; amendments and deletions never do.

Read filings​

curl "https://app.goroute.ai/peppol-api/api/v1/customs/filings?state=accepted,rejected&date_from=2026-11-01&limit=50" \
-H "X-API-Key: YOUR_API_KEY"

GET /customs/filings takes importer_org_id, state (one or more, comma-separated), bill (part of the bill number), date_from and date_to (dates the filing was created), limit (1 to 200, default 25) and offset. It answers {filings, count, total, limit, offset}, newest first. GET /customs/filings/export.csv takes the same filters and returns up to 10,000 rows.

GET /customs/filings/{id} returns the filing with four more keys:

{
"id": "c9b7e2d4-1f3a-4b8e-a6c5-0d2e4f6a8b1c",
"state": "accepted",
"cbp_transaction_number": "S2R-12345678901",
"cbp_status": "ISF ACCEPTED",
"payload": {"submission_type": "1", "…": "the filing as last transmitted"},
"versions": [
{"id": "5a0c…", "action": "add", "gateway_message_id": "414d5120…",
"request": {"…": "…"}, "batch_preview": {"…": "…"}, "sent_at": "2026-11-23T14:10:02+00:00"}
],
"messages": [
{"id": "e71b…", "filing_id": "c9b7e2d4-1f3a-4b8e-a6c5-0d2e4f6a8b1c",
"gateway_message_id": "414d5120…", "application_id": "SN",
"records": {"lines": ["…"], "record_count": 4, "environment": "prod"},
"parsed": {"entries": [{"disposition": "ACCEPTED", "narrative": "ISF ACCEPTED",
"cbp_transaction_number": "S2R-12345678901", "errors": []}]},
"parse_error": null,
"received_at": "2026-11-23T14:10:28+00:00"}
],
"retention": {"retain_until": "2031-11-24T14:10:02+00:00", "deletable": false, "…": "…"}
}

application_id is SN for a status notification and SA for a status advisory. records holds CBP's message as received, with GoRoute's transmission password removed. A rejection's parsed.entries[].errors lists each {code, text} from CBP's error list.

Amend and delete​

# Amend: send the whole filing again with what changed
curl -X POST "https://app.goroute.ai/peppol-api/api/v1/customs/isf/c9b7e2d4-1f3a-4b8e-a6c5-0d2e4f6a8b1c/replace" \
-H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d @isf-v2.json

# Delete: withdraw an accepted filing at CBP
curl -X POST "https://app.goroute.ai/peppol-api/api/v1/customs/isf/c9b7e2d4-1f3a-4b8e-a6c5-0d2e4f6a8b1c/delete" \
-H "X-API-Key: YOUR_API_KEY"

The replace body is the ISF request without importer_org_id: filing is required, and lading_date, late_acknowledged, reference, vessel_name, voyage_number, eta and processing_port are optional (the filing keeps its own values for those left out). An amendment is allowed on an accepted or rejected filing once CBP has returned its transaction number; it needs "late_acknowledged": true if sent after the cut-off. A deletion is allowed on an accepted filing only; its optional body is {"reference", "processing_port"}.

Both answer 202 with {filing, version}. The filing is sent until CBP answers; CBP's answer follows by webhook. The record of a deleted filing stays readable for five years.

Webhooks​

Seven events, delivered and signed like every other GoRoute event (Webhook Events Reference). Each goes to the importer's organisation and to the filer's.

EventSent when
customs.isf.sentA new ISF, an amendment or a deletion was handed to CBP
customs.isf.acceptedCBP's status notification accepted a filing or an amendment
customs.isf.rejectedCBP's status notification rejected it
customs.isf.deletedCBP confirmed a deletion
customs.isf.advisoryCBP sent a status advisory about the filing's bill
customs.isf.late_filedA new ISF was sent after the cut-off, with an acknowledgement
customs.isf.unansweredTen minutes have passed with no answer from CBP (sent once per filing)

Every event's data carries the filing:

{
"id": "evt_4d1e9b0a7c6f4e2a8b3d5c7e9f1a2b3c",
"event_type": "customs.isf.accepted",
"created_at": "2026-11-23T14:10:28.412310",
"data": {
"filing_id": "c9b7e2d4-1f3a-4b8e-a6c5-0d2e4f6a8b1c",
"importer_org_id": "3f1c2a9e-5b7d-4c21-9e0a-7a1f0c2d9b44",
"filer_org_id": "8d2e6b10-4c3a-4f5e-9a71-2b6c0d4e8f13",
"kind": "isf10",
"bill": {"qualifier": "OB", "number": "ABCD123456789"},
"state": "accepted",
"cbp_transaction_number": "S2R-12345678901",
"deadline_at": "2026-11-30T08:00:00+00:00",
"filed_at": "2026-11-23T14:10:02+00:00",
"disposition": "ACCEPTED",
"narrative": "ISF ACCEPTED",
"errors": [],
"received_at": "2026-11-23T14:10:28+00:00"
}
}

and, depending on the event:

EventExtra fields in data
customs.isf.sentaction (add, replace or delete), gateway_message_id
customs.isf.accepted, .rejected, .deleteddisposition, narrative, errors (each {code, text} from CBP's error list), received_at
customs.isf.advisorystatuses (each with code and text), on_file, gateway_message_id, received_at
customs.isf.late_filedlate_ack_by, late_ack_at
customs.isf.unansweredminutes_waiting

A missed webhook can always be recovered by reading the filing with GET /customs/filings/{id}.