# EDI 304 Shipping Instructions: Ocean SI Guide

> EDI 304 explained: ocean shipping instructions for the bill of lading, the B2, N1, R4, N7, M7, L0 and L3 segments, a live sample, and the 300 to 315 flow.

<QuickAnswer>
The EDI 304 Shipping Instructions is the X12 transaction a shipper, importer, forwarder or NVOCC sends an ocean carrier with the details for the bill of lading. It carries the booking number, freight payment terms, shipper, consignee and notify parties, the route, each container and seal, the cargo description, weights and volumes, and the shipment totals.
</QuickAnswer>

**The EDI 304 is what the carrier prints on your bill of lading.** Once the containers are loaded and on their way to the terminal, the carrier needs to know exactly who the shipper and consignee are, who to notify, which containers and seals belong to the booking, and how to describe the cargo. The 304 sends all of that before the documentation cutoff. The carrier answers with a [310](/guides/edi/310-freight-receipt-and-invoice-ocean) showing the bill of lading data and the charges.

This guide covers what the 304 carries, where it sits in the ocean flow, every segment you will map, a live sample for two loaded 40-foot high cubes on freight collect terms, how it differs from the 310 and the motor-carrier 211, and the errors that turn into bill of lading amendments.

<EDIGuideCTA
  transactionType="304"
  headline="Shipping instructions start with the purchase order"
  body="The consignee, cargo and PO numbers on a 304 come from orders. OrderSync reads inbound purchase orders in any format, from EDI 850s to PDFs, emails and spreadsheets, matches customers, items and units to your catalog, and sends clean data to your ERP."
/>

## What Is an EDI 304?

**An EDI 304 is the Shipping Instructions transaction set defined by [ASC X12](https://x12.org/products/transaction-sets), used to give an ocean carrier the information it needs to issue a bill of lading for a shipment.** The standard allows far more than most carriers use: letters of credit, insurance, export and import licences, certifications and clauses, hazardous material detail and item-level physical details all have segments. The 304 travels in functional group `SO` (the `GS01` value).

Authoritative references for 304 work:

- The [X12 transaction set catalog](https://x12.org/products/transaction-sets) defines the 304 structure, segment order and loops
- [Stedi's X12 004010 reference for the 304](https://www.stedi.com/edi/x12-004010/304) lists the segments, elements and code values for release 004010
- The [BIC container prefix register](https://www.bic-code.org/) governs the four-letter owner codes used in ISO 6346 container numbers, which the 304 carries in `N7`
- For cargo bound for the United States, [CBP's Importer Security Filing FAQ](https://www.cbp.gov/sites/default/files/assets/documents/2023-May/ISF%20FAQ%202.0%20%28508%29.pdf) explains the Importer Security Filing: most of its data elements are due no later than 24 hours before the cargo is laden aboard the vessel, and it needs the bill of lading number to match the carrier's manifest
- Each ocean carrier publishes its own 304 implementation guide, which sets the segments it reads, the documentation cutoff and how amendments are handled

**Who sends it?** The booking party: an exporter, an importer on a buyer-controlled move, or a forwarder or NVOCC.

**Who receives it?** The ocean carrier, directly or through a portal or network.

**When is it sent?** After the containers are loaded and sealed, before the carrier's documentation cutoff for the sailing. Corrections and amendments go as further 304s.

**Why does it matter?** The bill of lading controls release of the cargo at destination, and its data feeds the carrier's customs manifest. A misspelled consignee, a wrong container number or a missing seal on the 304 becomes a wrong B/L, and a B/L amendment after the fact costs time and can carry a charge under the carrier's tariff.

## The Ocean Document Flow: 300 to 322

| Set | X12 name | Usually sent by | What it does |
|---|---|---|---|
| **[300](/guides/edi/300-reservation-booking-request-ocean)** | Reservation (Booking Request) (Ocean) | Booking party | Asks for space |
| **[301](/guides/edi/301-confirmation-ocean)** | Confirmation (Ocean) | Ocean carrier | Returns the booking number and empty release |
| **304** | Shipping Instructions | Booking party | Gives the bill of lading details |
| **[310](/guides/edi/310-freight-receipt-and-invoice-ocean)** | Freight Receipt and Invoice (Ocean) | Ocean carrier | Returns the bill of lading data and charges |
| **[315](/guides/edi/315-status-details-ocean)** | Status Details (Ocean) | Ocean carrier | Container events to the shipper or consignee |
| **[322](/guides/edi/322-terminal-operations-intermodal-ramp-activity)** | Terminal Operations and Intermodal Ramp Activity | Terminal or rail ramp | Terminal events to the carrier or railroad |

The 304 is the only document in the chain where the shipper side states the bill of lading content. Everything the carrier sends after it, the 310 in particular, should agree with it. Treat the 304 as the record you will check the 310 against.

## Interactive Example: 304 for Two Loaded 40-Foot High Cubes, Freight Collect

The importer sends shipping instructions for booking `BK7730412` two weeks after it was confirmed. `B2` names the carrier (SCAC `BLUQ`), repeats the importer's shipment reference, sets kilograms as the weight unit and states freight collect. `B2A` marks the 304 as an original. `N9` carries the booking and purchase order numbers, and `V1` the vessel and voyage. Three `N1` loops give the shipper, consignee and notify party with full addresses, exactly as they should print on the B/L. The `R4` loops give the route. Inside the `LX` loop, each container has an `N7` with its check digit and type and an `M7` with its seal, then `L0` and `L5` describe the cargo. `L3` closes with total weight, volume and pieces. All names, numbers and codes are fictional, and the same containers, seals and parties appear in the [310 sample](/guides/edi/310-freight-receipt-and-invoice-ocean) the carrier sends back.

Use the **Plain English** tab for a readable summary, or click any segment to break it down element by element.

<EDISample id="304-ocean-shipping-instructions" />

## 304 Structure at a Glance

The table follows X12 release 004010. The 304 is one of the longest transportation sets in the standard; this table lists the parts most carriers read.

| Area | Segment | Name | Usage in the standard | Notes |
|---|---|---|---|---|
| Heading | **ST** | Transaction Set Header | Mandatory | `ST01` = `304` |
| Heading | **B2** | Beginning Segment for Shipment Information Transaction | Mandatory | Carrier, shipment ID, weight unit, payment terms |
| Heading | **B2A** | Set Purpose | Optional | Original, change, replace or cancellation |
| Heading | **N9** | Reference Identification | Optional, up to 100 | Booking, PO and other references |
| Heading | **V1** | Vessel Identification | Optional, up to 2 | Vessel and voyage |
| Heading | **M0 / M1 / M2** | Letter of Credit, Insurance, Sales/Delivery Terms | Optional | Used for documentary credit and insured shipments |
| Heading loop | **N1 / N2 / N3 / N4 / G61** | Name and address | Mandatory, up to 100 | Shipper, consignee, notify parties and others |
| Heading loop | **R4 / DTM** | Port or Terminal, Date/Time | Mandatory, up to 20 | Receipt, loading, discharge, delivery |
| Heading | **K1** | Remarks | Optional, up to 12 | Free-text remarks |
| Heading | **L11** | Business Instructions and Reference Number | Optional, up to 99 | Further references and instructions |
| Heading loop | **C8** | Certifications and Clauses | Optional, up to 20 | Clauses to print on the B/L |
| Detail loop | **LX** | Assigned Number | Repeats up to 999 | One loop per group of containers and cargo |
| Detail loop | **N7 / M7 / W09** | Equipment Details, Seals, Temperature | Repeats up to 999 per LX | One `N7` per container |
| Detail loop | **L0 / L5** | Quantity and Weight, Description | Repeats up to 120 per LX | The cargo, with marks and commodity codes |
| Detail loop | **H1 / LH1** | Hazardous Material | Optional | Dangerous goods detail |
| Summary loop | **L3** | Total Weight and Charges | Mandatory | Shipment totals |
| Summary | **SE** | Transaction Set Trailer | Mandatory | Segment count and control number |

## Key Segments Explained

### B2: Beginning Segment for Shipment Information Transaction

```
B2**BLUQ**CHI2610160412*K*CC~
```

| Element | Name | Example | What it means |
|---|---|---|---|
| **B202** | Standard Carrier Alpha Code | `BLUQ` | The carrier that will issue the bill of lading |
| **B204** | Shipment Identification Number | `CHI2610160412` | The shipper's reference for the shipment |
| **B205** | Weight Unit Code | `K` | `K` kilograms, `L` pounds |
| **B206** | Shipment Method of Payment | `CC` | The only mandatory element: `CC` collect, `PP` prepaid, and other codes in the X12 list |
| **B211** | Transportation Terms Code | | Trade terms, when sent; `B206` then says which party pays under them |

Carriers differ on where they want the booking number. Some read it from `B204`, others from `N9*BN`, and some ask for both. The guide decides, and getting it wrong means the 304 does not attach to the booking.

### B2A: Set Purpose

```
B2A*00~
```

`B2A01` is the purpose: `00` original, `04` change, `05` replace and `01` cancellation are the common values. Many carriers treat any 304 after the first as a replacement of the whole set of instructions, not a change to one field, so send the complete 304 each time unless the guide says otherwise.

### N9: Reference Identification

```
N9*BN*BK7730412~
N9*PO*4500918832~
```

| Qualifier | Meaning | Why you need it |
|---|---|---|
| `BN` | Booking number | Ties the instructions to the booking from the 301 |
| `PO` | Purchase order number | Carries your orders onto the bill of lading record |
| `BM` | Bill of lading number | Sent when the carrier has already assigned a B/L number, or on an amendment |
| `SI` | Shipper's identifying number for shipment | The shipper's own reference |

Purchase order numbers you put on the 304 are the ones most likely to come back on the 310 and the 315. Send every PO in the containers.

### N1 Loop: Bill of Lading Parties

```
N1*SH*LINHAI WOODCRAFT CO LTD~
N3*88 HARBOUR INDUSTRIAL RD~
N4*SHANGHAI**201800*CN~
N1*CN*CASCADE HOME IMPORTS LLC~
N3*2200 COMMERCE WAY~
N4*ONTARIO*CA*91761*US~
N1*N1*PACIFIC GATEWAY CUSTOMS BROKERS~
N3*400 OCEAN BLVD STE 210~
N4*LONG BEACH*CA*90802*US~
```

`N101` gives the role: `SH` shipper, `CN` consignee, `N1` notify party, `N2` second notify party, and others such as forwarder where the carrier accepts them. What you send here is what the carrier prints. On a negotiable bill of lading the consignee may be "TO ORDER" or "TO ORDER OF" a bank; that text goes in the name exactly as the letter of credit or your instructions require. Names longer than the `N102` field continue in `N2`.

### R4 Loop: Route

```
R4*R*UN*CNSHA*SHANGHAI*CN~
R4*L*UN*CNSHA*SHANGHAI*CN~
R4*D*UN*USLAX*LOS ANGELES*US~
R4*E*UN*USONT*ONTARIO*US~
```

`R401` gives the role: `R` place of receipt, `L` port of loading, `D` port of discharge, `E` place of delivery. These should match the booking. A place of delivery on the 304 that differs from the 301 is a routing change, and most carriers will want it handled as a booking amendment rather than a documentation change.

### N7 and M7: Containers and Seals

```
N7*QXZU*412873*9210*G*******CN******K*2****45G1~
M7*CN4417203~
N7*QXZU*530916*9210*G*******CN******K*5****45G1~
M7*CN4417219~
```

| Element | Name | Example | What it means |
|---|---|---|---|
| **N701** | Equipment Initial | `QXZU` | Owner prefix |
| **N702** | Equipment Number | `412873` | Serial number |
| **N703 / N704** | Weight, Weight Qualifier | `9210` / `G` | Weight of the container's contents, gross |
| **N711** | Equipment Description Code | `CN` | Container |
| **N717** | Weight Unit Code | `K` | Kilograms |
| **N718** | Equipment Number Check Digit | `2` | The ISO 6346 check digit |
| **N722** | Equipment Type | `45G1` | 40-foot high cube general-purpose |
| **M701** | Seal Number | `CN4417203` | The seal applied at loading |

In the 304 the `N7` opens its own loop inside `LX`, so each container carries its seals, temperature (`W09`) and any container-level references with it. Validate every container number with the ISO 6346 check digit before you send: `QXZU412873` with check digit `2` gives `QXZU4128732`. The seal must be the one physically on the door; a seal that does not match at the terminal or at a customs exam causes a hold.

### L0 and L5: Cargo

```
L0*1***18420*G*58.4*X*1240*CTN**K~
L5*1*WOODEN FURNITURE PARTS~
```

`L0` gives the line number, gross weight (`L004`, `L005`), volume (`L006`, `L007`), piece count and package type (`L008`, `L009`) and weight unit (`L011`). `L502` is the cargo description as it should print. `L5` can also carry a commodity code with its qualifier and marks and numbers in `L506`. Use the description and commodity codes your customs broker files with, so the B/L, the manifest and your customs filings say the same thing.

### L3: Total Weight and Charges

```
L3*18420*G*******58.4*X*1240*K~
```

| Element | Name | Example | What it means |
|---|---|---|---|
| **L301 / L302** | Weight, Weight Qualifier | `18420` / `G` | Total gross weight |
| **L309 / L310** | Volume, Volume Unit Qualifier | `58.4` / `X` | Total volume in cubic meters |
| **L311** | Lading Quantity | `1240` | Total pieces |
| **L312** | Weight Unit Code | `K` | Kilograms |

The `L3` loop is mandatory in the 304 even though a shipper rarely sends charges. Check that the container weights in `N703` add up to `L301` (9,210 + 9,210 = 18,420 here) and that the `L0` pieces add up to `L311`.

## EDI 304 vs 310, 211 and 856

| Document | Mode | Sent by | Purpose |
|---|---|---|---|
| **304 Shipping Instructions** | Ocean | Shipper, importer, forwarder or NVOCC | What the bill of lading should say |
| **[310 Freight Receipt and Invoice (Ocean)](/guides/edi/310-freight-receipt-and-invoice-ocean)** | Ocean | Ocean carrier | What the bill of lading does say, plus charges |
| **[211 Motor Carrier Bill of Lading](/guides/edi/211-motor-carrier-bill-of-lading)** | Truck | Shipper | Bill of lading details for a truck move |
| **[856 Ship Notice/ASN](/guides/edi/856-ship-notice)** | Any | Supplier | What was shipped, down to carton, sent to the buyer |

The 304 and the 211 both send bill of lading details from shipper to carrier, one for ocean and one for truck. The 304 and the 310 are a pair: one is the request, the other is the carrier's version of it. The 856 goes in a different direction altogether, from supplier to buyer, but it often describes the same cartons. When the same purchase orders appear on a 304 and an 856, their piece counts and weights should agree.

## Common 304 Errors and How to Prevent Them

| Error | What happens | Prevention |
|---|---|---|
| **Sent after the documentation cutoff** | Possible late charge under the carrier's tariff, or cargo rolled to the next sailing | Track the cutoff from the 301 and alert before it, not after |
| **304 does not attach to the booking** | Carrier does not process it, or keys it by hand | Put the booking number where the carrier's guide wants it (`B204`, `N9*BN` or both) |
| **Consignee or notify party wrong** | B/L amendment; cargo cannot be released at destination | Pull parties from the order and contract, not from free text, and check them against the 310 |
| **Container number typo** | Container not linked to the B/L, customs questions | Validate the ISO 6346 check digit and compare with the gate-in on the 315 |
| **Seal number missing or wrong** | Holds at the terminal or customs | Capture seals at loading, from the person who applied them |
| **Weights do not add up** | Manifest discrepancies; queries from the carrier | Sum `N703` and `L004` and compare with `L301` before sending |
| **Description differs from the customs filing** | Customs questions and possible exam | Use the same description and commodity codes as your customs broker |
| **Partial amendments** | Carrier replaces the full set with half the data | Send the complete 304 every time unless the guide supports field-level changes |

## 304 Implementation Checklist

Before your first live 304 to an ocean carrier:

- Get the carrier's 304 implementation guide and confirm the X12 version in `GS08` (004010 is common) and the `SO` functional group
- Confirm where the booking number goes and which `N9` qualifiers it reads
- Confirm how it handles amendments: `B2A` values, full replacement or field changes, and any cutoff for changes
- Agree which parties it accepts in `N1` and how it wants "to order" consignees
- Agree how it wants container weights, verified gross mass and tare, and whether VGM goes on the 304 or separately
- Load the commodity codes and descriptions your customs broker uses
- Check every 304 against the [310](/guides/edi/310-freight-receipt-and-invoice-ocean) that comes back, field by field
- Confirm the 997 the carrier returns for each 304
- Test an original, a replacement, a multi-container shipment, a "to order" B/L and a reefer shipment if you ship refrigerated cargo

Our [EDI document types reference](/edi-document-types) shows where ocean sets sit beside the [850 purchase order](/guides/edi/850-purchase-order) and the [810 invoice](/guides/edi/810-invoice). For background on the document the 304 produces, see our [bill of lading glossary entry](/glossary/bill-of-lading).

## Where OrderSync Fits

Most of what goes on a 304 is already in your orders: the consignee, the purchase order numbers, the items and their quantities. When those orders come in as EDI 850s, PDFs, emails and spreadsheets, they have to be captured accurately before anyone can build shipping instructions from them.

OrderSync reads inbound orders in any format, matches customers, items and units to your catalog, and outputs clean ERP data or valid X12. Paste any 304 into the [free EDI inspector](/edi-inspector) to see it parsed segment by segment with a plain-English summary and any structural errors explained, or [book a 15-minute walkthrough](/book-call) to see your own orders processed.

## Frequently Asked Questions

<div className="not-prose">

### What is an EDI 304?

The EDI 304 Shipping Instructions is the X12 transaction a shipper, importer, forwarder or NVOCC sends to an ocean carrier with the details for the bill of lading: booking number, payment terms, parties, route, containers and seals, cargo description, weights and totals.

### What is the difference between EDI 304 and EDI 310?

The 304 goes from the shipper side to the carrier and says what the bill of lading should contain. The 310 comes back from the carrier with the bill of lading data it has issued or drafted, plus the freight charges. Compare the two before the B/L is final.

### When should the EDI 304 be sent?

After the containers are loaded and sealed and before the carrier's documentation cutoff for the sailing. The carrier's guide or booking confirmation gives the cutoff. For US-bound cargo, the importer's security filing also depends on the bill of lading number, so late instructions can delay more than the B/L.

### Where do container and seal numbers go in a 304?

Each container has an N7 segment inside the LX loop, with the owner prefix in N701, the serial number in N702 and the check digit in N718. The seal numbers follow in M7, inside the same N7 loop.

### What functional group and version does the 304 use?

The 304 travels in functional group SO, the value in GS01. Many carrier guides use X12 release 004010, and the version is named in GS08.

### How do I amend shipping instructions sent on a 304?

Send another 304 for the same booking with B2A01 set to the purpose the carrier's guide asks for, usually change or replace. Many carriers replace the whole set of instructions, so send the complete data each time.

### Is the 304 the bill of lading?

No. The 304 is the shipper's instruction for the bill of lading. The carrier issues the B/L and usually sends its data back on a 310 Freight Receipt and Invoice.

</div>
