Skip to content

How to build an MID code from a commercial invoice

8 min read

Ariel Serravalle

A first-time supplier's packet lands on your desk. The invoice is on a trading company's letterhead, the address runs across three lines with a building number, a road number and a room number, and there is a factory name buried in the packing list. Before you can key the entry summary, you need a manufacturer identification code for every line.

Building the MID itself is mechanical. The rules fit on a page. Most of the errors come from feeding those rules the wrong name or the wrong line of the address. This post covers both: the rules, then the traps.

What the MID is and where it is required

The MID is a code of up to 15 characters, with no spaces, built from a manufacturer's name and address. CBP's instructions for the entry summary (CBP Form 7501) say the manufacturer/shipper identification code is required on all entry summaries and entry/entry summaries, including informal entries (CBP, ACE Entry Summary Instructions).

The construction method is written out in the Appendix to 19 CFR Part 102, Textile and Apparel Manufacturer Identification. Despite the title, the same rules, with the same examples, are reproduced in the ACE Entry Summary Instructions linked above, which cover the code on entries of any goods. (CBP's older directive 3550-055, from 1986, has a shorter version that predates the Canadian, hyphen and city-state rules, so don't work from it.) When a rule below is unclear on your packet, go back to the appendix and its examples rather than to a generator website.

How to construct an MID, step by step

An MID has four parts, in this order. Punctuation (commas, periods, apostrophes, ampersands) is ignored throughout.

1. Country: two characters. The ISO code for the country of origin of the goods, not the country the invoice was mailed from. There is one exception: Canada. CA is not a valid MID country code. Use the province code instead, for example XA for Alberta, XC for British Columbia or XM for Manitoba (19 CFR Part 102, Appendix).

2. Name: up to six characters. Take the first three letters of each of the first two words of the manufacturer's name. If the name is one word, take its first three letters only. Two sub-rules come up constantly:

  • The English words a, an, and, of and the are ignored. The appendix's example: "The Embassy of Spain" gives EMBSPA.
  • A hyphenated name counts as one word. "Rawles-Aden Corp." gives RAWCOR, not RAWADE.

That second example also shows that "Corp." is a word like any other. A supplier called "Bergstrom" gives BER, but "Bergstrom Ltd." would give BERLTD.

3. Street address: up to four digits. Find the largest number on the street address line and take up to its first four digits. The appendix's examples:

Address lineDigits
11455 Main Street, Suite 99991145 (largest number is 11455)
232 Main Street, Suite 12341234 (a suite or P.O. box counts if it is the largest)
12-34-56 Alaska Road1234 (punctuation between numbers is dropped)
Apt. 509 2727 Cleveland St.2727 (numbers separated by a space are compared)
One Thousand Century Plazanothing (spelled-out numbers are not used)
One Thousand Century Plaza, Suite 345345

4. City: three letters. The first three letters of the city name. Numbers in the city name are ignored, and so is a leading "The": "Tokyo" gives TOK, "St. Michel" gives STM, "18-Mile High" gives MIL and "The Hague" gives HAG. For city-states, take the three letters from the country name instead: Hong Kong gives HON, Singapore SIN and Macau MAC, whatever district the address names.

Put the four parts together with no spaces, and check the result is no longer than 15 characters.

Three worked examples

These suppliers and addresses are invented for illustration. The construction follows the appendix rules above.

Example 1: a simple one. Brightway Housewares Co., Ltd., 88 Jiangnan Road, Ningbo, Zhejiang, China. Goods of Chinese origin.

PartSourceResult
CountryChinaCN
NameBrightway HousewaresBRIHOU
Address8888
CityNingboNIN

MID: CNBRIHOU88NIN. The province, postcode and "Co., Ltd." play no part.

Example 2: an address with several numbers. Golden Harvest Textile Mfg. Co., Building 3, No. 1288 Xinjinqiao Road, Room 502, Shanghai, China.

PartSourceResult
CountryChinaCN
NameGolden HarvestGOLHAR
Address3, 1288 and 502: the largest is 12881288
CityShanghaiSHA

MID: CNGOLHAR1288SHA, exactly 15 characters. The usual mistake here is taking the first number on the line (3) or the room number because it is closest to the name.

Example 3: a hyphenated name, a leading "The", and a Canadian supplier. First, The Sun-Rise Knitwear Company, Lot 15, Street 7, Tan Thuan Export Processing Zone, Ho Chi Minh City, Vietnam. "The" is ignored and "Sun-Rise" is one word, so the name gives SUNKNI. The largest number is 15; the city gives HOC. MID: VNSUNKNI15HOC.

Then Maple Ridge Woodworks Ltd., 4410 Industrial Way, Surrey, British Columbia, Canada. The country part is the province code, not CA. MID: XCMAPRID4410SUR.

The traps

Trading company or seller vs. the actual manufacturer

This is where most wrong MIDs start, and the answer depends on the goods.

Textile and apparel. The MID must be built from the name and address of the manufacturer that performs the origin-conferring process under 19 CFR 102.21 or 102.22 (19 CFR 102.23(a); CBP, MID requirements). A Hong Kong trading company that invoiced the goods is not that party, however prominent its letterhead.

Other goods. The current ACE Entry Summary Instructions say: "Except when import laws, rules, and regulations of the United States require the identification of the manufacturer, a supplier may be reported in this field. The supplier may be the invoicing party or parties whose commercial invoice is required for entry, whether or not it is presented at entry" (ACE Entry Summary Instructions). That exception does real work: textiles are one case where the manufacturer is required, and others may apply to your goods. Agree a house rule with your LCB rather than deciding it line by line.

Example (invented): the invoice comes from Pacific Star Trading Ltd., Flat 1203, 88 Nathan Road, Kowloon, Hong Kong. The packing list shows the goods, cotton knit shirts, were made by Dongguan Hengli Garment Factory, 16 Industrial Road, Dongguan, China. Built from the invoice, the MID would be HKPACSTA1203HON (Hong Kong is a city-state, so the city part is HON, not KOW for Kowloon): the wrong party, the wrong country and the wrong number. Built from the factory, as the textile rule requires, it is CNDONHEN16DON.

If the packet doesn't name the factory at all on a textile shipment, that is a question for the client before transmission, not something to fill in from the seller's details.

No street number

An address with no digits on the street line gives no digits for that part of the MID, just as the appendix's "One Thousand Century Plaza" example does. Don't borrow a postcode or phone number to fill the gap. If the address is missing entirely, the MID can't be built; send it back to the client on arrival rather than on the day of filing.

The same factory, spelled differently on every invoice

"Hengli Garment Factory", "Dongguan Hengli Garments Co." and "DG Hengli" can all be the same building. Each spelling gives a different MID. Keep one agreed name and address per supplier in the client's file and build from that, and note in the file which document it came from.

Checking your work

The ACE Portal has an MID search tool, now under the References tab of the modernized portal (CSMS #60039622). According to that notice, the search needs an exact match of the MID and the associated company name, so a near-miss spelling won't turn up. CBP also publishes a guide to querying the manufacturer file (ACE Query Manufacturer File).

Before you transmit, a quick self-check:

  1. Is the country code the country of origin (or the province code for Canada)?
  2. Is the name the right party for this commodity?
  3. Did you drop a, an, and, of, the, and treat hyphenated words as one?
  4. Is the number the largest on the street line, cut to four digits?
  5. Is the whole thing 15 characters or fewer, with no spaces?

Where the MID sits in the rest of the file

The MID is only as good as the manufacturer's name and address on the invoice. What the invoice itself must show is covered in what 19 CFR 141.86 requires on a commercial invoice. If an entry summary comes back rejected, see entry summary rejected: the two-day clock. The ISF has its own manufacturer element, filed before lading; see ISF mistakes and how to catch them.

EntryWrite is being built to handle the step before the rules: finding the manufacturer's name and address wherever it sits in the packet and showing you the source line.