Sample Input and Output: 810 Invoice

Big Daddy's big customers who are sending orders by X12 EDI also want the invoices to be sent to them by X12 EDI. Big Daddy doesn't want to pay the $25 to $100 penalty for each invoice those customers have to process manually. So, Big Daddy needs to create X12 810 Invoices from his system. Table 9.2 shows a summary of a typical 810 implementation. Note: The Segment Group column is empty if the segment is not part of a segment group.

Table 9.2. Sample X12 810 Invoice Implementation Guide
Segment GroupSegmentTagData Element PositionData Element or Composite Data Structure Number and NameX12 Data TypeMinimum LengthMaximum LengthDescription and Comments
 Beginning Segment for InvoiceBIG01373 DateDT88The invoice date
   0276 Invoice NumberAN122Seller-assigned invoice number
   04324 Purchase Order NumberAN122Relevant buyer-assigned purchase order number
Header N1NameN10198 Entity Identifier CodeID23Two N1 loops must be sent: one with the Ship To location contains an ST in this element, the other with the Remit To party contains an RE in this element
   0293 NameAN160For ST, the name of the receiving location; for RE, the vendor name
   0366 Identification Code QualifierID12For ST, 92 for Assigned by Buyer or Buyer's Agent; for RE, 9 for DUNS number
   0467 Identification CodeAN280For ST, the buyer-assigned DUNS+4 number (the buyer's DUNS number followed by a four-digit receiving location code); for RE, the DUNS number
 Terms of Sale/Deferred Terms of SaleITD01336 Terms Type CodeID2201 for Basic
   03338 Terms Discount PercentR16 
   04370 Terms Discount Due DateDT88Date payment is due for discount to apply
   05351 Terms Discount Days DueN013Number of days in the discount period
   06446 Terms Net Due DateDT88Date on which the net amount is due
   07386 Terms Net DaysN013Number of days until the net amount is due
IT1Baseline Item Data (Invoice)IT101350 Assigned IdentificationAN120Sometimes optional, but usually must match the line item number on the corresponding purchase order
   02358 Quantity InvoicedR110 
   03355 Unit or Basis for Measurement CodeID22Must match the unit of measurement of the corresponding purchase order; usually EA for each or CA for case
   04212 Unit PriceR117 
   06235 Product/Service ID QualifierID22Usually UP for UPC Consumer Package Code (1-5-5-1)
   07234 Product/Service IDAN148The UPC code for the item
IT1Product/Item DescriptionPID01349 Item Description TypeID11F for free-form item description
   05352 DescriptionAN180The item description
 Total Monetary Value SummaryTDS01610 AmountN2115Total amount of invoice before terms discount
 Transaction TotalsCTT01354 Number of Line ItemsN016The total number of line items in the transaction set

As with the sample implementation guide for our 850 Purchase Order, only the N1 segment is transmitted; there isn't a full N1 loop. Like the PO1 segment, the IT1 segment has only a single product code. Though you would think that major buyers could get by with just one product identifier, I have seen some implementation guides that require three. In addition to a standard UPC code they require their own internal identifier and their vendor's catalog identifier. Sellers don't have much choice but to comply if they want to keep the business.

Here are two invoice instance documents that correspond to the 810 Invoice. As noted earlier I use a naming convention based on segment ID and data element position. You may choose whatever Element names you like.

Sample Input (X12Invoice01.xml)
<?xml version="1.0" encoding="UTF-8"?>
<X12Invoice
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="X12Invoice.xsd">
  <BIG>
    <BIG01>2003-01-27</BIG01>
    <BIG02>2003030</BIG02>
    <BIG04>4497-0561</BIG04>
  </BIG>
  <N1Header>
    <N1>
      <N101>ST</N101>
      <N102>BIG BOX - STORE #97</N102>
      <N103>92</N103>
      <N104>001234567S097</N104>
    </N1>
  </N1Header>
  <N1Header>
    <N1>
      <N101>RE</N101>
      <N102>BIG DADDY'S GOURMET COCOA</N102>
      <N103>9</N103>
      <N104>987651234</N104>
    </N1>
  </N1Header>
  <ITD>
    <ITD01>01</ITD01>
    <ITD03>5</ITD03>
    <ITD04>2003-02-27</ITD04>
    <ITD05>30</ITD05>
    <ITD06>2003-02-27</ITD06>
    <ITD07>31</ITD07>
  </ITD>
  <IT1Group>
    <IT1>
      <IT101>1</IT101>
      <IT102>10</IT102>
      <IT103>CA</IT103>
      <IT104>30.36</IT104>
      <IT106>UP</IT106>
      <IT107>35790000122</IT107>
    </IT1>
    <PID>
      <PID01>F</PID01>
      <PID05>Instant Hot Cocoa Mix - Mint flavor</PID05>
    </PID>
  </IT1Group>
  <IT1Group>
    <IT1>
      <IT101>2</IT101>
      <IT102>30</IT102>
      <IT103>CA</IT103>
      <IT104>31.08</IT104>
      <IT106>UP</IT106>
      <IT107>35790000724</IT107>
    </IT1>
    <PID>
      <PID01>F</PID01>
      <PID05>Instant Hot Cocoa Mix - Vanilla flavor</PID05>
    </PID>
  </IT1Group>
  <TDS>
    <TDS01>1236.00</TDS01>
  </TDS>
  <CTT>
    <CTT01>2</CTT01>
  </CTT>
</X12Invoice>

Sample Input (X12Invoice02.xml)
<?xml version="1.0" encoding="UTF-8"?>
<X12Invoice
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="X12Invoice.xsd">
  <BIG>
    <BIG01>2003-01-27</BIG01>
    <BIG02>2003030</BIG02>
    <BIG04>4445-0323</BIG04>
  </BIG>
  <N1Header>
    <N1>
      <N101>ST</N101>
      <N102>BIG BOX - STORE #45</N102>
      <N103>92</N103>
      <N104>001234567S045</N104>
    </N1>
  </N1Header>
  <N1Header>
    <N1>
      <N101>RE</N101>
      <N102>BIG DADDY'S GOURMET COCOA</N102>
      <N103>9</N103>
      <N104>987651234</N104>
    </N1>
  </N1Header>
  <ITD>
    <ITD01>01</ITD01>
    <ITD03>5</ITD03>
    <ITD04>2003-02-27</ITD04>
    <ITD05>30</ITD05>
    <ITD06>2003-02-27</ITD06>
    <ITD07>31</ITD07>
  </ITD>
  <IT1Group>
    <IT1>
      <IT101>1</IT101>
      <IT102>20</IT102>
      <IT103>CA</IT103>
      <IT104>30.36</IT104>
      <IT106>UP</IT106>
      <IT107>35790000122</IT107>
    </IT1>
    <PID>
      <PID01>F</PID01>
      <PID05>Instant Hot Cocoa Mix - Mint flavor</PID05>
    </PID>
  </IT1Group>
  <IT1Group>
    <IT1>
      <IT101>2</IT101>
      <IT102>40</IT102>
      <IT103>CA</IT103>
      <IT104>31.08</IT104>
      <IT106>UP</IT106>
      <IT107>35790000641</IT107>
    </IT1>
    <PID>
      <PID01>F</PID01>
      <PID05>
        Instant Hot Cocoa Mix - Dutch Chocolate flavor
      </PID05>
    </PID>
  </IT1Group>
  <TDS>
    <TDS01>1850.40</TDS01>
  </TDS>
  <CTT>
    <CTT01>2</CTT01>
  </CTT>
</X12Invoice>

Here is the resulting interchange.

Sample Output (Invoices.X12)
ISA*00*     *00*     *12*9727839573  *ZZ*
  BIGBOX      *030125*1058*U*00401*000000006*0*P*~
GS*IN*9727839573*BIGBOX*X*20030125*1058*6*004010~
ST*810*0001~
BIG*20030127*2003030**4497-0561~
N1*ST*BIG BOX - STORE #97*92*001234567S097~
N1*RE*BIG DADDY'S GOURMET COCOA*9*987651234~
ITD*01**5*20030227*30*20030227*31~
IT1*1*10*CA*30.36**UP*35790000122~
PID*F****Instant Hot Cocoa Mix - Mint flavor~
IT1*2*30*CA*31.08**UP*35790000724~
PID*F****Instant Hot Cocoa Mix - Vanilla flavor~
TDS*123600~
CTT*2~
SE*12*0001~
ST*810*0002~
BIG*20030127*2003030**2003-01-23~
N1*ST*BIG BOX - STORE #45*92*001234567S045~
N1*RE*BIG DADDY'S GOURMET COCOA*9*987651234~
ITD*01**5*20030227*30*20030227*31~
IT1*1*20*CA*30.36**UP*35790000122~
PID*F****Instant Hot Cocoa Mix - Mint flavor~
IT1*2*40*CA*31.08**UP*35790000641~
PID*F****Instant Hot Cocoa Mix - Dutch Chocolate flavor~
TDS*185040~
CTT*2~
SE*12*0002~
GE*2*6~
IEA*1*000000006~

Again, the line breaks (and indentation on the continuation of the ISA segment) would not appear in actual usage and are included only to improve readability.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset