ediverse Explore the platform

Spotlight PEPPOL BIS Billing 3.0 The EU e-invoicing mandate is here — France Sept 2026, Belgium Jan 2026, Germany 2025.

BGM

Beginning of Message. The segment that opens every EDIFACT message: type, number, function, response type expected.

Definition

The BGM segment is designed, per the official D.96A function statement, "to indicate the type and function of a message and to transmit the identifying number". Its structure has four elements:

  1. 010 — C002 (Document/Message Name): coded document name (element 1001), via UNCL 1001 — for instance 220 for a purchase order, 351 for a despatch advice, 380 for a commercial invoice.
  2. 020 — 1004 (Document/Message Number): the document reference number, up to 35 characters. This is the "human" identifier of the order, despatch note or invoice.
  3. 030 — 1225 (Message Function, Coded): message function (UNCL 1225) — 9 Original, 1 Cancellation, 5 Replace, etc.
  4. 040 — 4343 (Response Type, Coded): response type expected (UNCL 4343) — AC Acknowledge, AB Message acknowledgement, etc.

Origin

BGM is one of the oldest service segments in the EDIFACT directory, present since version 1 published in 1987. It always occupies the second position in a message, immediately after the message header (UNB at interchange level, UNH at message level). Directory D.96A, archived on ediverse.io, is dated 27 November 1995. The segment is defined in the TRSD table: trsdbgm.htm.

Example in context

First line of an ORDERS message — purchase order PO-2026-00042:

The 220 code in C002/1001 says "order" per UNCL 1001, PO-2026-00042 is the PO number as generated by the buyer's ERP, and the trailing 9 states that this message is the original — not a cancellation, not a replacement.

  • Segment — the general concept of which BGM is an instance.
  • NAD — another service segment present in every message.
  • UNB — the interchange header, one level above BGM.
  • Qualifier — the concept behind every code BGM carries (1001, 1225, 4343).

Last updated: May 13, 2026