Available29 endpoints$0.05 per successful call
AES Filing API
Validate, prepare, and submit EEI filings to CBP's Automated Export System.
Base URL · https://api.compliancegrid.ai/v1/aes
Check EEI filing · no signuplive data
Try or .
What it checks
The AES Filing API validates Electronic Export Information (EEI) against FTR 15 CFR Part 30 with 20+ cross-field rules (OFAC embargoes, Schedule B, ECCN, license types, DDTC/ITAR, filing deadlines), stores filings through their lifecycle, and prepares them for AESDirect. You complete the AESDirect WebLink step with your own sign-in, and the ITN is recorded when it comes back, or arrives by webhook. It can also write a filing in CBP's AESTIR 80-character record format for AESDirect's EDI file upload.
- Full EEI schema validation per FTR 30.6 (USPPI, consignee, commodities, transport)
- 20+ cross-field rules: embargo check, license/ECCN consistency, VIN for vehicles
- OFAC embargo screening for Cuba, Iran, North Korea, Syria, Crimea
- Database-persisted filing lifecycle: DRAFT → VALIDATED → SUBMITTED → ACCEPTED/REJECTED
- AESDirect WebLink integration — browser-redirect form generation for CBP submission
- Success/fail callback handlers to capture ITN and AES response codes
- Filing CRUD: create, get by ID/ref, list with filters, cancel
- WebLink inquiry support for accepted filings with ITN
- Filing deadline calculation by transport mode (vessel/air/truck/rail)
- $2,500 per Schedule B threshold — automatic filing requirement determination
- Canada exemption detection (FTR 30.36)
- AESTIR file output: CBP's 80-character record format, for AESDirect EDI file upload or a certified connection
- 10 reference endpoints for code tables (transport modes, EICs, license types, ports)
Endpoints
| Method | Path | What it does | |
|---|---|---|---|
| POST | /v1/aes/validate | Validate Electronic Export Information data against FTR 30.6 rules. | Docs |
| POST | /v1/aes/prepare | Validates the filing and returns it as a flat JSON mapping (field names of our own, not CBP's record layout) with a summary and the filing deadline. For CBP's AESTIR record format use POST /v1/aes/aestir. | Docs |
| GET | /v1/aes/filing-required | Quick check if EEI filing is required based on destination country, value, and license type. | Docs |
| POST | /v1/aes/filing | Create a draft EEI filing. | Docs |
| POST | /v1/aes/filing/{id}/submit | Prepares a validated filing for AESDirect and returns a WebLink session: a browser-redirect form and action URL. The filer must open it in a browser to complete submission with CBP; the filing is not transmitted to CBP by the API. The ITN is returned through the WebLink callback. With mode "managed", the managed filing fee ($35 for up to 5 lines plus $10 per extra line, $75 for a filing with a BIS licence, licence exception or ECCN other than EAR99) is held from prepaid credit when the filing is queued, kept when AES accepts it and returned if AES rejects it or the customer cancels before the team starts. 402 if the credit cannot cover it. The API call itself is billed as usual. | Docs |
| GET | /v1/aes/filing/{id} | Retrieve a filing record by its database ID. | Docs |
| GET | /v1/aes/filings | List all filings with optional filters. | Docs |
| POST | /v1/aes/filing/{id}/cancel | Cancel a draft or validated filing. | Docs |
| GET | /v1/aes/weblink-info | Returns the current AES WebLink environment configuration. | Docs |
| GET | /v1/aes/reference/transport-modes | List all AES transport mode codes with filing deadlines. | Docs |
| GET | /v1/aes/reference/license-types | License and license-exemption type codes from CBP's AESTIR Appendix F (15 Dec 2025): how each code is reported (license number, keyword such as NLR, CFR citation or case id), whether an ECCN is mandatory, and whether a license value is required. | Docs |
| GET | /v1/aes/reference/export-info-codes | List all Export Information Codes for EEI filings. | Docs |
| GET | /v1/aes/reference/exemption-codes | List EEI filing exemption codes (FTR 30.36-30.40). | Docs |
| GET | /v1/aes/reference/embargoed-countries | List countries under comprehensive OFAC sanctions. | Docs |
| GET | /v1/aes/reference/ports | List Schedule D port codes for major U.S. export ports. | Docs |
| GET | /v1/aes/reference/in-bond-codes | In-bond codes (36, 37, 67, 68, 70). Static reference data. | Docs |
| GET | /v1/aes/reference/consignee-types | Ultimate consignee types (D, G, R, O). Static reference data. | Docs |
| GET | /v1/aes/reference/filing-types | Filing types (predeparture, postdeparture). Static reference data. | Docs |
| GET | /v1/aes/reference/df-indicators | Domestic or foreign origin indicators (D, F). Static reference data. | Docs |
| GET | /v1/aes/audit-log | Who did what to this account's AES filings and settings, newest first: filing created, submitted, cancelled, ITN set manually, AES settings changed or credentials removed. Records what changed, never a secret. | Docs |
| GET | /v1/aes/authorizations | Your account's authorizations with their status: pending_review, active, expired, not_yet_effective or revoked. | Docs |
| POST | /v1/aes/authorizations | Records the written authorization or power of attorney by which an exporter (USPPI) lets ComplianceGrid file EEI as its authorized agent (15 CFR 30.3). It starts as pending_review; our team checks the signed document and activates it. Managed filings for that exporter's EIN need an active, in-date authorization. Dates are YYYY-MM-DD. | Docs |
| GET | /v1/aes/authorizations/{id} | One authorization of your account. | Docs |
| POST | /v1/aes/authorizations/{id}/revoke | Ends the authorization. The record stays on file for filings already made under it. Optional JSON body: { "reason": "..." }. | Docs |
| POST | /v1/aes/aestir | Returns the filing as CBP's AESTIR commodity format: 80-character fixed records (A, B, SC1, SC2, SC3, N01-N03, CL1, CL2, Y, Z), back to back with no line breaks, as AESDirect's EDI file upload takes. Self-filed: the filer is the exporter itself, so the filer ID is the exporter's EIN. Long text is cut to the field length and listed in warnings. Not produced yet, and refused with 422 and the reasons: DDTC/ITAR lines, used vehicles, PGA data, and replace, change and cancel. X12 601 is a different format and is not produced. CBP's own test process (AESDirect Bulk Upload Test Process) is the check that AES accepts a file. | Docs |
| GET | /v1/aes/filing/{id}/aestir | The same output as POST /v1/aes/aestir for a filing of your account, including the shipment reference AES will echo in its responses. | Docs |
| GET | /v1/aes/capabilities | Returns { managedFiling: boolean }: whether we file as your authorized agent yet. | Docs |
| POST | /v1/aes/authorizations/{id}/documents | Send the file as the request body with its Content-Type (application/pdf, image/png or image/jpeg), up to 8 MB, five per authorization; add ?filename=. The contents must match the type. We keep it for five years from the export and never delete it. Returns its SHA-256. | Docs |
| GET | /v1/aes/authorizations/{id}/documents/{docId} | Your own stored document, as it was uploaded. | Docs |
Request and response
const API = "https://api.compliancegrid.ai";
const headers = { "x-api-key": process.env.CG_API_KEY!, "Content-Type": "application/json" };
const get = (path: string) => fetch(API + path, { headers }).then((r) => r.json());
const post = (path: string, body: unknown) => fetch(API + path, { method: "POST", headers, body: JSON.stringify(body) }).then((r) => r.json());
// Validate an EEI filing (the full schema is in the OpenAPI spec)
const result = await post("/v1/aes/validate", {
usppi: {
companyName: "Acme Electronics Inc.",
ein: "12-3456789",
address: { line1: "100 Export Blvd", city: "Los Angeles", state: "CA", zip: "90210" },
contactName: "John Smith",
phone: "310-555-0100",
},
ultimateConsignee: {
companyName: "Berlin Tech GmbH",
address: { line1: "Friedrichstr. 100", city: "Berlin", country: "DE" },
type: "R",
},
portOfExport: "2704",
portOfUnlading: "4101",
countryOfUltimateDestination: "DE",
modeOfTransport: "40",
carrierIdentification: "LUFT",
dateOfExport: "2026-11-15",
relatedPartyTransaction: false,
routedExportTransaction: false,
hazardousMaterials: false,
filingType: "predeparture",
commodities: [{
scheduleBNumber: "8471300100",
description: "Laptop computers",
quantity1: 10,
unitOfMeasure1: "NO",
shippingWeightKg: 25,
value: 12000,
exportInformationCode: "OS",
licenseType: "C33",
originState: "CA",
dfIndicator: "D",
}],
});
// A bad field is a 400 whose error.details names it; otherwise read valid and issues
if (result.success === false) console.error(result.error.message);
else console.log(result.data.valid, result.data.issues);Example response
{
"success": true,
"data": {
"id": "eei_val_364c33ec5d324b1f",
"valid": true,
"filingRequired": true,
"filingRequiredReason": "One or more commodities exceed the $2,500 per Schedule B threshold (15 CFR 30.2(a)(1)(iv))",
"totalErrors": 0,
"totalWarnings": 1,
"totalInfo": 1,
"issues": [
{
"field": "commodities[0].licenseValue",
"severity": "WARNING",
"code": "LICENSE_VALUE_RECOMMENDED",
"message": "License value should be provided when a license number is specified.",
"regulation": "15 CFR 30.6(b)(23)"
},
{
"field": "commodities[0].value",
"severity": "INFO",
"code": "EEI_FILING_REQUIRED",
"message": "Commodity value ($75,000) exceeds the $2,500 threshold per Schedule B number. EEI filing is mandatory.",
"regulation": "15 CFR 30.2(a)(1)(iv)"
}
],
"validatedAt": "2026-02-19T15:21:14.377Z"
}
}Good to know
- Results are information for your review, not legal advice or a compliance determination. Your reviewer makes the final call.
- Every response carries its source and the list version, so the result can go in your audit file.
- The sandbox returns mock data and production returns live data. Build in the sandbox and switch your key to go live.
Pricing
$0.05per successful call
Only successful calls are billed. Volume discounts start at 10,001 calls a month, and the sandbox is free.See pricing and estimate your bill →