Skip to content
EDI 304 — EDI TransactionPublished Nov 7, 2026

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.

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 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.

What Is an EDI 304?

An EDI 304 is the Shipping Instructions transaction set defined by ASC X12, 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 defines the 304 structure, segment order and loops
  • Stedi's X12 004010 reference for the 304 lists the segments, elements and code values for release 004010
  • The BIC container prefix register 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 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

SetX12 nameUsually sent byWhat it does
300Reservation (Booking Request) (Ocean)Booking partyAsks for space
301Confirmation (Ocean)Ocean carrierReturns the booking number and empty release
304Shipping InstructionsBooking partyGives the bill of lading details
310Freight Receipt and Invoice (Ocean)Ocean carrierReturns the bill of lading data and charges
315Status Details (Ocean)Ocean carrierContainer events to the shipper or consignee
322Terminal Operations and Intermodal Ramp ActivityTerminal or rail rampTerminal 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 the carrier sends back.

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

Live exampleOcean CarrierEDI 304

Importer 304 Shipping Instructions (Collect, 2 x 40ft HC)

Shipping instructions for the bill of lading: B2 names the carrier, shipment ID and collect freight, B2A marks it as an original, N9 carries the booking and PO numbers, V1 the vessel, the N1 loops give shipper, consignee and notify party, R4 the routing, N7/M7 the two containers and seals, L0/L5 the cargo and L3 the totals

Document
304 Shipping Instructions
From / to
CASCADEHOMEIMP → BLUQ
Segments
32
Interchange date
Oct 30, 2026

Raw EDI (X12)

1
ISA*00* *00* *ZZ*CASCADEHOMEIMP *02*BLUQ *261030*1420*U*00401*000003041*0*P*>~
2
GS*SO*CASCADEHOMEIMP*BLUQ*20261030*1420*3041*X*004010~
3
ST*304*0001~
4
B2**BLUQ**CHI2610160412*K*CC~
5
B2A*00~
6
N9*BN*BK7730412~
7
N9*PO*4500918832~
8
V1*9700017*MERIDIAN HARBOR*LR*118E*BLUQ***L~
9
N1*SH*LINHAI WOODCRAFT CO LTD~
10
N3*88 HARBOUR INDUSTRIAL RD~
11
N4*SHANGHAI**201800*CN~
12
N1*CN*CASCADE HOME IMPORTS LLC~
13
N3*2200 COMMERCE WAY~
14
N4*ONTARIO*CA*91761*US~
15
N1*N1*PACIFIC GATEWAY CUSTOMS BROKERS~
16
N3*400 OCEAN BLVD STE 210~
17
N4*LONG BEACH*CA*90802*US~
18
R4*R*UN*CNSHA*SHANGHAI*CN~
19
R4*L*UN*CNSHA*SHANGHAI*CN~
20
R4*D*UN*USLAX*LOS ANGELES*US~
21
R4*E*UN*USONT*ONTARIO*US~
22
LX*1~
23
N7*QXZU*412873*9210*G*******CN******K*2****45G1~
24
M7*CN4417203~
25
N7*QXZU*530916*9210*G*******CN******K*5****45G1~
26
M7*CN4417219~
27
L0*1***18420*G*58.4*X*1240*CTN**K~
28
L5*1*WOODEN FURNITURE PARTS~
29
L3*18420*G*******58.4*X*1240*K~
30
SE*28*0001~
31
GE*1*3041~
32
IEA*1*000003041~

Human-Readable

Interchange

Sender ID(ZZ)CASCADEHOMEIMP
Receiver ID(02)BLUQ
Date261030
Time1420
Standards IDU
Version00401
Control Number000003041
Acknowledgment RequestedNo
UsageProduction
Included Groups (IEA01)1

Functional Group

Functional IDSOSO
SenderCASCADEHOMEIMP
ReceiverBLUQ
Date20261030
Time1420
Control Number3041
Agency CodeX
Version004010
Transactions1
Reported Transaction Count (GE01)1

Transaction 304

Shipping Instructions
Transaction Type304
Control Number0001
Segments, ST to SE28
Count in SE0128 (matches)

Segment Detail

B2Beginning Segment for Shipment Information Transaction
B202Standard Carrier Alpha CodeBLUQ
B204Shipment Identification NumberCHI2610160412
B205Weight Unit CodeK
B206Shipment Method of PaymentCC
B2ASet Purpose
B2A01Transaction Set Purpose Code00
N9Reference Identification
N901Reference Identification QualifierBN
N902Reference IdentificationBK7730412
N9Reference Identification
N901Reference Identification QualifierPO
N902Reference Identification4500918832
V1Vessel Identification
V101Vessel Code9700017
V102Vessel NameMERIDIAN HARBOR
V103Country CodeLR
V104Flight/Voyage Number118E
V105Standard Carrier Alpha CodeBLUQ
V108Vessel Code QualifierL
N1Party Identification
N101Entity CodeSH
N102NameLINHAI WOODCRAFT CO LTD
N3Party Location
N301Address88 HARBOUR INDUSTRIAL RD
N4Geographic Location
N401CitySHANGHAI
N403Postal Code201800
N404CountryCN
N1Party Identification
N101Entity CodeCN
N102NameCASCADE HOME IMPORTS LLC
N3Party Location
N301Address2200 COMMERCE WAY
N4Geographic Location
N401CityONTARIO
N402State/ProvinceCA
N403Postal Code91761
N404CountryUS
N1Party Identification
N101Entity CodeN1
N102NamePACIFIC GATEWAY CUSTOMS BROKERS
N3Party Location
N301Address400 OCEAN BLVD STE 210
N4Geographic Location
N401CityLONG BEACH
N402State/ProvinceCA
N403Postal Code90802
N404CountryUS
R4Port or Terminal
R401Port or Terminal Function CodeR
R402Location QualifierUN
R403Location IdentifierCNSHA
R404Port NameSHANGHAI
R405Country CodeCN
R4Port or Terminal
R401Port or Terminal Function CodeL
R402Location QualifierUN
R403Location IdentifierCNSHA
R404Port NameSHANGHAI
R405Country CodeCN
R4Port or Terminal
R401Port or Terminal Function CodeD
R402Location QualifierUN
R403Location IdentifierUSLAX
R404Port NameLOS ANGELES
R405Country CodeUS
R4Port or Terminal
R401Port or Terminal Function CodeE
R402Location QualifierUN
R403Location IdentifierUSONT
R404Port NameONTARIO
R405Country CodeUS
LXAssigned Number
LX01Assigned Number1
N7Equipment Details
N701Equipment InitialQXZU
N702Equipment Number412873
N703Weight9210
N704Weight QualifierG
N711Equipment Description CodeCN
N717Weight Unit CodeK
N718Equipment Number Check Digit2
N722Equipment Type45G1
M7Seal Numbers
M701Seal NumberCN4417203
N7Equipment Details
N701Equipment InitialQXZU
N702Equipment Number530916
N703Weight9210
N704Weight QualifierG
N711Equipment Description CodeCN
N717Weight Unit CodeK
N718Equipment Number Check Digit5
N722Equipment Type45G1
M7Seal Numbers
M701Seal NumberCN4417219
L0Line Item - Quantity and Weight
L001Lading Line Item Number1
L004Weight18420
L005Weight QualifierG
L006Volume58.4
L007Volume Unit QualifierX
L008Lading Quantity1240
L009Packaging Form CodeCTN
L011Weight Unit CodeK
L5Description, Marks and Numbers
L501Lading Line Item Number1
L502Lading DescriptionWOODEN FURNITURE PARTS
L3Total Weight and Charges
L301Weight18420
L302Weight QualifierG
L309Volume58.4
L310Volume Unit QualifierX
L311Lading Quantity1240
L312Weight Unit CodeK
1 functional group1 transactionControl #000003041Valid

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.

AreaSegmentNameUsage in the standardNotes
HeadingSTTransaction Set HeaderMandatoryST01 = 304
HeadingB2Beginning Segment for Shipment Information TransactionMandatoryCarrier, shipment ID, weight unit, payment terms
HeadingB2ASet PurposeOptionalOriginal, change, replace or cancellation
HeadingN9Reference IdentificationOptional, up to 100Booking, PO and other references
HeadingV1Vessel IdentificationOptional, up to 2Vessel and voyage
HeadingM0 / M1 / M2Letter of Credit, Insurance, Sales/Delivery TermsOptionalUsed for documentary credit and insured shipments
Heading loopN1 / N2 / N3 / N4 / G61Name and addressMandatory, up to 100Shipper, consignee, notify parties and others
Heading loopR4 / DTMPort or Terminal, Date/TimeMandatory, up to 20Receipt, loading, discharge, delivery
HeadingK1RemarksOptional, up to 12Free-text remarks
HeadingL11Business Instructions and Reference NumberOptional, up to 99Further references and instructions
Heading loopC8Certifications and ClausesOptional, up to 20Clauses to print on the B/L
Detail loopLXAssigned NumberRepeats up to 999One loop per group of containers and cargo
Detail loopN7 / M7 / W09Equipment Details, Seals, TemperatureRepeats up to 999 per LXOne N7 per container
Detail loopL0 / L5Quantity and Weight, DescriptionRepeats up to 120 per LXThe cargo, with marks and commodity codes
Detail loopH1 / LH1Hazardous MaterialOptionalDangerous goods detail
Summary loopL3Total Weight and ChargesMandatoryShipment totals
SummarySETransaction Set TrailerMandatorySegment count and control number

Key Segments Explained

B2: Beginning Segment for Shipment Information Transaction

B2**BLUQ**CHI2610160412*K*CC~
ElementNameExampleWhat it means
B202Standard Carrier Alpha CodeBLUQThe carrier that will issue the bill of lading
B204Shipment Identification NumberCHI2610160412The shipper's reference for the shipment
B205Weight Unit CodeKK kilograms, L pounds
B206Shipment Method of PaymentCCThe only mandatory element: CC collect, PP prepaid, and other codes in the X12 list
B211Transportation Terms CodeTrade 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~
QualifierMeaningWhy you need it
BNBooking numberTies the instructions to the booking from the 301
POPurchase order numberCarries your orders onto the bill of lading record
BMBill of lading numberSent when the carrier has already assigned a B/L number, or on an amendment
SIShipper's identifying number for shipmentThe 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~
ElementNameExampleWhat it means
N701Equipment InitialQXZUOwner prefix
N702Equipment Number412873Serial number
N703 / N704Weight, Weight Qualifier9210 / GWeight of the container's contents, gross
N711Equipment Description CodeCNContainer
N717Weight Unit CodeKKilograms
N718Equipment Number Check Digit2The ISO 6346 check digit
N722Equipment Type45G140-foot high cube general-purpose
M701Seal NumberCN4417203The 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~
ElementNameExampleWhat it means
L301 / L302Weight, Weight Qualifier18420 / GTotal gross weight
L309 / L310Volume, Volume Unit Qualifier58.4 / XTotal volume in cubic meters
L311Lading Quantity1240Total pieces
L312Weight Unit CodeKKilograms

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

DocumentModeSent byPurpose
304 Shipping InstructionsOceanShipper, importer, forwarder or NVOCCWhat the bill of lading should say
310 Freight Receipt and Invoice (Ocean)OceanOcean carrierWhat the bill of lading does say, plus charges
211 Motor Carrier Bill of LadingTruckShipperBill of lading details for a truck move
856 Ship Notice/ASNAnySupplierWhat 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

ErrorWhat happensPrevention
Sent after the documentation cutoffPossible late charge under the carrier's tariff, or cargo rolled to the next sailingTrack the cutoff from the 301 and alert before it, not after
304 does not attach to the bookingCarrier does not process it, or keys it by handPut the booking number where the carrier's guide wants it (B204, N9*BN or both)
Consignee or notify party wrongB/L amendment; cargo cannot be released at destinationPull parties from the order and contract, not from free text, and check them against the 310
Container number typoContainer not linked to the B/L, customs questionsValidate the ISO 6346 check digit and compare with the gate-in on the 315
Seal number missing or wrongHolds at the terminal or customsCapture seals at loading, from the person who applied them
Weights do not add upManifest discrepancies; queries from the carrierSum N703 and L004 and compare with L301 before sending
Description differs from the customs filingCustoms questions and possible examUse the same description and commodity codes as your customs broker
Partial amendmentsCarrier replaces the full set with half the dataSend 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 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 shows where ocean sets sit beside the 850 purchase order and the 810 invoice. For background on the document the 304 produces, see our bill of lading glossary entry.

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 to see it parsed segment by segment with a plain-English summary and any structural errors explained, or book a 15-minute walkthrough to see your own orders processed.

Frequently Asked Questions

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.

James Darby
Last updated: 11/7/2026

Related Resources