Canonical Invoice Implementation Guide and Specification

Modified on Tue, May 26 at 9:26 AM

ECGrid Simplify

Canonical Invoice Format Specification

Version: 1.0    Date: April 23, 2026   Owner: ECGrid Product

1. Purpose

This document defines the canonical invoice format used by ECGrid Simplify. It's the single source of truth for invoice structure, field definitions, data types, length limits, required fields, and serialization rules across XML and JSON.

Both XML and JSON representations convey the same logical invoice. A JSON Schema (Simplify_XML_Invoice.schema.json) provides machine-enforceable validation. This document is the human-readable companion.

2. Scope

In scope:

  • Invoice document structure (header and detail lines).
  • Field-level definitions, data types, length limits, and validation rules.
  • Canonical XML and JSON representations.
  • Party identification, currency, and date conventions.

Out of scope:

  • Transport (HTTPS, AS2, SFTP). Covered in ECGrid Simplify API docs.
  • Functional acknowledgments, application responses, and remittance.
  • Tax calculation logic, line-level discounts, and freight allocation.

3. Document structure

An invoice payload contains one or more invoices. Each invoice has a single header block. The header contains trading partner identifiers, document metadata, three party blocks (Seller, Buyer, ShipTo), currency, date information, and one or more detail lines.

Top-level shape:

invoices[]

  └── header (required, exactly one)

       ├── tradingPartnerID

       ├── sender / senderQualifier

       ├── receiver / receiverQualifier

       ├── invoiceNumber / invoiceDate

       ├── currency { currencyId, currency }

       ├── dateInformation.shipDateTime { date, time }

       ├── seller  (party address)

       ├── buyer   (party address)

       ├── shipTo  (party address)

       └── detail[] (1..n line items)

4. Header fields

Field

Type

Length

Req

Description

Example

tradingPartnerID

string

1–35

Yes

ECGrid trading partner identifier. Routes the document.

SEV2TEST01

sender

string

2–17

Yes

Sender ID in the qualifier namespace.

SEV2TEST01

senderQualifier

string

1–4

Yes

Qualifier for sender ID (e.g. SE, ZZ, 01, 14).

SE

receiver

string

2–17

Yes

Receiver ID in the qualifier namespace.

SEV2TEST02

receiverQualifier

string

1–4

Yes

Qualifier for receiver ID.

SE

invoiceNumber

string

1–22

Yes

Supplier's invoice number. Unique per sender.

123456

invoiceDate

string

8

Yes

Invoice issue date. YYYYMMDD. 8 digits exact.

20260423

currency

object

Yes

Currency block. See §5.

dateInformation

object

Yes

Date block. See §6.

seller

party

Yes

Selling party. See §7.

buyer

party

Yes

Buying party. See §7.

shipTo

party

Yes

Ship-to party. See §7.

detail

array

1..n

Yes

One or more line items. See §8.

 

5. Currency block

Field

Type

Length

Req

Description

Example

currencyId

string

1–2

Yes

Currency qualifier. Typically matches senderQualifier convention.

SE

currency

string

3

Yes

ISO 4217 currency code. 3 chars exact.

USD

 

6. Date information block

Field

Type

Length

Req

Description

Example

shipDateTime.date

string

0 or 8

Yes

Ship date. YYYYMMDD or empty string when not yet known.

20260425

shipDateTime.time

string

0 or 4

Yes

Ship time. HHMM (24-hour) or empty string when unknown.

1430

Note: date and time are schema-required but accept empty strings when actual values are unavailable. Implementations should treat empty as "not supplied" rather than "zero".

7. Party address block

The same structure is used for seller, buyer, and shipTo.

Field

Type

Length

Req

Description

Example

partyIdentification

string

1–80

Yes

Party identifier value (DUNS, GLN, internal code, etc.).

12345

partyIdentificationTypeCode

string

1–5

Yes

Qualifier for the identifier (e.g. 92 = internal, 1 = DUNS, UL = GLN).

92

name

string

1–60

Yes

Legal name of the party.

Acme Corp

streetAddress1

string

1–55

Yes

Street address line 1.

123 Main St

city

string

2–30

Yes

City.

Albany

stateCode

string

2

Yes

State or province code. 2 chars exact for US/CA.

NY

postalCode

string

3–15

Yes

Postal/ZIP code.

12207

countryCode

string

2

Yes

ISO 3166-1 alpha-2 country code. 2 chars exact.

US

 

8. Detail line

The detail array is required and must contain at least one line. Each line carries the fields below.

Field

Type

Length

Req

Description

Example

lineItemNumber

integer

1–6

Yes

Sequential line number within the invoice. Starts at 1.

1

sku

string

1–48

Yes

SKU or internal product identifier.

HOR9904088

supplierAssignedPartNumber

string

1–48

Yes

Supplier's part number for the item.

VN123456789

buyerAssignedPartNumber

string

1–48

Yes

Buyer's part number for the item.

BY123456789

invoiceQty

number

1–15

Yes

Quantity invoiced. Decimals allowed. Up to 15 digits incl. decimals.

2

quantityUnitOfMeasure

string

2–3

Yes

Unit of measure (e.g. EA, CS, LB, KG).

EA

unitPriceNet

number

1–17

Yes

Net unit price in header currency. Excludes tax. Up to 17 digits incl. decimals.

100

 

9. Naming conventions

  • JSON: camelCase for all field names (e.g. invoiceNumber, shipDateTime).
  • XML: PascalCase for all element names (e.g. InvoiceNumber, ShipDateTime).
  • Field semantics and length limits are identical across both. Only casing differs.
  • Empty optional values in XML use self-closing tags (e.g. <Date/>). In JSON, use empty string for string fields.

10. XML example

<Invoices>

  <Invoice>

    <Header>

       <TradingPartnerID>SEV2TEST01</TradingPartnerID>

       <SenderQualifier>SE</SenderQualifier>

      <Sender>SEV2TEST01</Sender>

       <ReceiverQualifier>SE</ReceiverQualifier>

       <Receiver>SEV2TEST02</Receiver>

       <InvoiceNumber>123456</InvoiceNumber>

       <InvoiceDate>20260423</InvoiceDate>

      <Currency>

        <CurrencyId>SE</CurrencyId>

        <Currency>USD</Currency>

      </Currency>

      <DateInformation>

        <ShipDateTime>

          <Date/>

          <Time/>

        </ShipDateTime>

      </DateInformation>

      <Seller>

         <PartyIdentification>12345</PartyIdentification>

         <PartyIdentificationTypeCode>92</PartyIdentificationTypeCode>

        <Name>SellerName</Name>

        <StreetAddress1>Seller Address1</StreetAddress1>

        <City>Seller City</City>

        <StateCode>NY</StateCode>

         <PostalCode>12207</PostalCode>

         <CountryCode>US</CountryCode>

      </Seller>

      <Buyer>

         <PartyIdentification>12345</PartyIdentification>

         <PartyIdentificationTypeCode>92</PartyIdentificationTypeCode>

        <Name>BuyerName</Name>

        <StreetAddress1>Buyer Address1</StreetAddress1>

        <City>Buyer City</City>

        <StateCode>NY</StateCode>

         <PostalCode>12207</PostalCode>

         <CountryCode>US</CountryCode>

      </Buyer>

      <ShipTo>

         <PartyIdentification>92</PartyIdentification>

         <PartyIdentificationTypeCode>ABCDE</PartyIdentificationTypeCode>

        <Name>ShipToName</Name>

        <StreetAddress1>ShipTo Address1</StreetAddress1>

        <City>ShipTo City</City>

        <StateCode>NY</StateCode>

         <PostalCode>12207</PostalCode>

         <CountryCode>US</CountryCode>

      </ShipTo>

      <Detail>

         <LineItemNumber>1</LineItemNumber>

        <Sku>HOR9904088</Sku>

         <SupplierAssignedPartNumber>VN123456789</SupplierAssignedPartNumber>

         <BuyerAssignedPartNumber>BY123456789</BuyerAssignedPartNumber>

        <InvoiceQty>2</InvoiceQty>

         <QuantityUnitOfMeasure>EA</QuantityUnitOfMeasure>

         <UnitPriceNet>100</UnitPriceNet>

      </Detail>

    </Header>

  </Invoice>

</Invoices>

11. JSON example

{

  "invoices": [

    {

      "header": {

        "tradingPartnerID": "SEV2TEST01",

        "sender": "SEV2TEST01",

        "senderQualifier": "SE",

        "receiver": "SEV2TEST02",

        "receiverQualifier": "SE",

        "invoiceNumber": "123456",

        "invoiceDate": "20260423",

        "currency": { "currencyId": "SE", "currency": "USD" },

        "dateInformation": {

          "shipDateTime": { "date": "", "time": "" }

        },

        "seller": {

          "partyIdentification": "12345",

           "partyIdentificationTypeCode": "92",

          "name": "SellerName",

          "streetAddress1": "Seller Address1",

          "city": "Seller City",

          "stateCode": "NY",

          "postalCode": "12207",

          "countryCode": "US"

        },

        "buyer": {

          "partyIdentification": "12345",

           "partyIdentificationTypeCode": "92",

          "name": "BuyerName",

          "streetAddress1": "Buyer Address1",

          "city": "Buyer City",

          "stateCode": "NY",

          "postalCode": "12207",

          "countryCode": "US"

        },

        "shipTo": {

          "partyIdentification": "92",

           "partyIdentificationTypeCode": "ABCDE",

          "name": "ShipToName",

          "streetAddress1": "ShipTo Address1",

          "city": "ShipTo City",

          "stateCode": "NY",

          "postalCode": "12207",

          "countryCode": "US"

        },

        "detail": [

          {

            "lineItemNumber": 1,

            "sku": "HOR9904088",

             "supplierAssignedPartNumber": "VN123456789",

             "buyerAssignedPartNumber": "BY123456789",

            "invoiceQty": 2,

            "quantityUnitOfMeasure": "EA",

            "unitPriceNet": 100

          }

        ]

      }

    }

  ]

}

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article