Ready to Learn?Ex Libris products all provide open APIs


Invoices are sent from the vendor to Alma.
An EDI file may contain more than one invoice, with each invoice containing one or more invoice lines. The invoice structure in EDI is as follows:

see EDIfact standard for Invoices.

Invoice Information Segments

  1. UNH (header):

UNH+{sender's unique message reference number)+INVOIC:D:96A:UN:EAN008’

  • Sender's unique message reference number - By convention, incorporates a sequence number of the message within the interchange
  • INVOIC – invoice
  • D - message type version number
  • 96A - EDIFACT Directory D.96A
  • UN - agency responsible
  • EAN008 - EAN version number


  1. BGM (Beginning of Message):

BGM+380+{invoice number}+43'

  • 43 – additional transmission; an EDI copy of an invoice or credit note sent also in paper form, the latter being the authoritative document for legal and tax purposes (46 = provisional; use when the EDI invoice is in effect a priced delivery note, and payment will be made later in a consolidated paper invoice)

BGM+380:::JINV+{invoice number}+55

  • JINV – journal invoice (serial) - can be also JCRN
  • 55 – serial


  1. DTM (Date Time Message):
DTM is generally the Date and Time fields in the EDI, where the +Number specifies what kind of date it is.
The invoice must contain at least one DTM+137, which is the invoice date. 

Invoices, related to continuous POL's, should include DTM+194 and DTM+206:

  • 194 = start date for invoicing period (CCYYMMDD, CCYYMM or CCYYQ)
  • 206 = end date for invoicing period (CCYYMMDD, CCYYMM or CCYYQ)




  1. NAD (Name and Address) of the buyer and the supplier:

NAD+BY+{Buyer’s EAN code}::9’
NAD+SU+{Supplier’s EAN code}::9’


  1. Each NAD record may be followed by an RFF record (Reference):
API = additional party identification (EAN code). Use with a NAD segment coded BY in DE3035 for a coded identification, which is additional to the linked NAD segment. Typically, this may be a supplier’s own code for a library account or customer department (EAN code).


IA - internal vendor number. Use with a NAD segment coded SU in DE 3035 when a library has multiple vendor references which apply to different types of business with the same supplier.


If there is a VAT number, there will be an RFF+VA record.

RFF+VA:{VAT number}’ 

If there is a payment instruction there will be a PAT record.

PAT+1++5:3:D:{payment term}’


Invoice Lines Segments

Each invoice must contain at least one invoice line.

  1. LIN+ and the line number:

LIN+1’ – line number 1


  1. PIA (Additional Product ID): Unless the invoiced item is identified by an EAN article number in LIN segment 33, there must be one mandatory occurrence per invoice line (except sub-lines), coded 5 – or exceptionally, 5V in DE 4347 – to identify the product to which the line or sub-line refers. Additional occurrences, coded 1 or 1S in DE 4347, may be used to give additional identification codes for the invoiced item or to identify the item which was originally ordered if the invoiced item is a substitute (coded 4 in DE 4347).

PIA+5+0856674427:IB’- ISBN as the main identification of the item supplied and invoiced
PIA+5+1234-45567 IS’ - ISSN as the main identification of the item supplied and invoiced


  1. IMD (Item Description) – Optional. Up to 10 repeats of IMD segment 35 may be used to give limited bibliographic details of the item to which the order response line refers. This is mandatory if the item is not identified by a code or codes in LIN segment 33 and/or PIA segment 34. Otherwise, a description should not normally be sent in an invoice line.

IMD+L+009+:::Harris, Robert’ - author name, recommended form
IMD+F+BAU+:::Harris, Robert’ - equivalent using EDItEUR alpha codes, not recommended for new implementations


  1. QTY (Quantity) – number of copies

QTY+47:9’ – refers to 9 copies


  1. MOA (Monetary Amount) – line item amount



  1. PRI (Price) – item price



  1. RFF+LI - buyer’s order line number (PO line number). Note that the order line number can be identified by RFF+SLI, the supplier's unique order line reference, instead. In this case, RFF+LI is not sent.
  1. More fields can be added if needed by the invoice line
Discount, Tax From/To dates, issue/volume, and so forth - all can be found in EDItEUR Library EDI Implementation Guidelines, Version 1.2.
  1. The following EDI Segments are loaded to the notes field in invoice line:
    FTX - Any Free text coming from the Vendor in EDI File
    PRI - the price and the price type
    PCD - Discount/Over Percentage
    RTE - Rate and rate type
    In addition Alma may add the "Journal Title", "Unit Price", "Over Amount".
    Note: If the parameter invoice_split_additional_charges is set to true, then the PCD segment is not written to the notes field in the invoice line but registered as a separate invoice line.



Invoice Summary Segments

The summary section starts with the UNS, must appear once per invoice, and should contain the summary of the invoice:

  1. UNS+S’ - summary section


  1. CNT (Counter) - number of line items
CNT+2:2’ - number of line items = 2


  1. MOA+79 - total line item amounts


  1. MOA+129 - total before tax and payment discount
  1. MOA+176 - total tax amount


  1. MOA+86 - total after tax, before payment discount


  1. MOA+9 - total amount payable
  2. TAX+7+VAT++++Z’ tax summary: zero rate
  3. MOA+125:67.39’ amount taxable at zero rate
  4. MOA+124:0’ amount of tax payable

Invoice EDI sample: