Home / Guides / CAPE file format
The CAPE CSV file: the exact format, and the mistakes that get it rejected
The file CBP asks for is about as simple as a file can be. It is also where roughly three declarations in ten have failed. Here is exactly what goes in it, and what goes wrong.
The format
- A CSV file (comma-separated values), with a name ending in
.csv. - First row: the words
Entry Number. Do not change or delete it. - Every row after that: one entry number, in the first column, and nothing else.
- Each entry number is 11 letters and digits: a 3-character filer code, 7 digits and a check digit.
- No entry number twice.
- No more than 9,999 entries and no more than 1 MB. If you have more, upload several files.
A complete, valid file looks like this:
Entry Number ABC12345676 ABC12345759 0S244712085 XY900821139
CBP gives you a template in the CAPE tab of the ACE portal (the upload window has a link called CAPE Upload Template). You type or paste your entry numbers under the header, then use File, Save As, and choose CSV (Comma delimited) (*.csv).
Where it goes wrong
1. The file is still a workbook
Saving the template without choosing the CSV type leaves you with an Excel workbook. Renaming it to end in .csv does not convert it. CBP answers "Not a CSV file".
2. Excel dropped the leading zeros
If a filer code begins with a zero, or is all digits, Excel treats the entry number as a number and removes the zeros in front. An 11-character entry number becomes 9 or 10 characters, and CBP answers "Failed initial validation" with "Not 11 characters long". Format the column as Text before you paste.
3. Excel turned a number into 1.23457E+10
Long all-digit entry numbers can be shown, and then saved, in scientific notation. The original digits are gone, and the file has to be rebuilt from the report.
4. The same entry number is in the file more than once
This happens nearly every time a list is copied out of a line-level report, because the report repeats the entry number on every tariff line. CBP answers "Duplicate Entry".
5. The header row is missing or different
Sorting the column can move the header into the middle of the data, and pasting over cell A1 replaces it. CBP answers "CSV content is empty or missing the header".
6. There are other columns in the file
Deleting the contents of a column is not the same as deleting the column. Leftovers from the report make the file bigger and can trip CBP's safety scan.
7. An entry number that does not exist
A mistyped digit gives a well-formed number that CBP cannot find. The file comes back "Rejected by batch validation". The last digit of every entry number is a check digit calculated from the other ten, so most typing mistakes can be caught before you upload.
8. An entry under a different importer number
Your ACE account can only declare entries made under its own importer of record number. One entry from an affiliate, or one where the broker was the importer of record, and the file comes back with "Account Mismatch".
About dashes. Entry numbers are usually printed with dashes, like ABC-1234567-8. CBP's guide says dashes are stripped when you upload, and its error table says the number must be "11 characters without dashes". A file with no dashes satisfies both, so that is what Preflight writes.
What happens after you upload
- File format check. Is it a CSV, with the header, under the limits? If not, you see the specific reason.
- Entry number check. 11 characters, no duplicates, filer code matches (broker accounts). If not: "Failed initial validation".
- Batch validation. Does each entry exist, under your importer number? If not: "Rejected by batch validation".
- Accepted. The file gets a claim number. Up to this point, one bad row stops the whole file.
- Claim validation. Each entry is checked by itself. Entries that fail are dropped and the rest go ahead. The claim shows as Accepted, Accepted with Error(s), or Rejected.
For a file that failed at steps 1 to 3, CBP's guide says to correct it and upload the entire file again. For entries that failed at step 5, upload only the corrected entries.
Check a file against all of this
Preflight runs these checks on your own computer in about a minute. It is free, and nothing you drop on the page is uploaded.