The 832 is the X12 price/sales catalog. Suppliers use it to send item data and prices to customers, either as a full catalog or as updates.
BCT identifies the catalog, each LIN loop is an item with its product identifiers, followed by PID descriptions, CTP pricing, measurements and packaging.
004010SC (GS01)TS832 in EdiFabric.Templates.X12The full X12 832 layout from its OpenEDI definition, the same model ediFabric uses to parse, validate and generate it: 14 loops and 108 segment positions, in file order. Loops are shaded and their segments indented; Max use is how many times a segment or loop may repeat.
| Segment / loop | Name | Usage | Max use |
|---|---|---|---|
ST | Transaction Set Header | Mandatory | 1 |
BCT | Beginning Segment for Price/Sales Catalog | Mandatory | 1 |
CTP | Pricing Information | Optional | 100 |
REF | Reference Identification | Optional | >1 |
YNQ | Yes/No Question | Optional | 10 |
PER | Administrative Communications Contact | Optional | >1 |
DTM | Date/Time Reference | Optional | 10 |
CTB | Restrictions/Conditions | Optional | 25 |
CUR | Currency | Optional | 5 |
ITD | Terms of Sale/Deferred Terms of Sale | Optional | 2 |
LDT | Lead Time | Optional | >1 |
SAC | Service, Promotion, Allowance, or Charge Information | Optional | >1 |
TD1 | Carrier Details (Quantity and Weight) | Optional | >1 |
TD5 | Carrier Details (Routing Sequence/Transit Time) | Optional | >1 |
TD3 | Carrier Details (Equipment) | Optional | >1 |
TD4 | Carrier Details (Special Handling, or Hazardous Materials, or Both) | Optional | >1 |
FOB | F.O.B. Related Instructions | Optional | 1 |
PKG | Marking, Packaging, Loading | Optional | >1 |
G93 | Price Bracket Identifier, Quantity, Unitor Basisfor Measurement Code | Optional | 50 |
TXI | Tax Information | Optional | >1 |
AAA | Request Validation | Optional | 1 |
| N1 loop | Name | Optional | >1 |
N1 | Name | Mandatory | 1 |
N2 | Additional Name Information | Optional | 2 |
N3 | Address Information | Optional | 2 |
N4 | Geographic Location | Optional | >1 |
REF | Reference Identification | Optional | 12 |
PKG | Marking, Packaging, Loading | Optional | >1 |
PER | Administrative Communications Contact | Optional | >1 |
DTM | Date/Time Reference | Optional | 10 |
| LM loop | Code Source Information | Optional | >1 |
LM | Code Source Information | Mandatory | 1 |
LQ | Industry Code | Mandatory | >1 |
| N9 loop | Reference Identification | Optional | >1 |
N9 | Reference Identification | Mandatory | 1 |
DTM | Date/Time Reference | Optional | >1 |
| LIN loop | Item Identification | Optional | >1 |
LIN | Item Identification | Mandatory | 1 |
PO1 | Baseline Item Data | Optional | 1 |
G53 | Maintenance Type | Optional | 1 |
SI | Service Characteristic Identification | Optional | >1 |
DTM | Date/Time Reference | Optional | 10 |
REF | Reference Identification | Optional | >1 |
YNQ | Yes/No Question | Optional | 10 |
PER | Administrative Communications Contact | Optional | >1 |
CRD | Country Code, Amount Qualifier Code, Monetary Amount | Optional | >1 |
CTB | Restrictions/Conditions | Optional | 25 |
PID | Product/Item Description | Optional | 200 |
MEA | Measurements | Optional | 40 |
PKG | Marking, Packaging, Loading | Optional | 25 |
PO4 | Item Physical Details | Optional | 1 |
TD1 | Carrier Details (Quantity and Weight) | Optional | >1 |
TD5 | Carrier Details (Routing Sequence/Transit Time) | Optional | >1 |
TD3 | Carrier Details (Equipment) | Optional | >1 |
TD4 | Carrier Details (Special Handling, or Hazardous Materials, or Both) | Optional | >1 |
ITD | Terms of Sale/Deferred Terms of Sale | Optional | 2 |
LDT | Lead Time | Optional | 1 |
SAC | Service, Promotion, Allowance, or Charge Information | Optional | >1 |
FOB | F.O.B. Related Instructions | Optional | 1 |
AAA | Request Validation | Optional | 1 |
TC2 | Commodity | Optional | 2 |
TXI | Tax Information | Optional | >1 |
G55 | Item Characteristics - Consumer Unit | Optional | 1 |
G54 | Quantity, Unitor Basisfor Measurement Code, UPC Case Code | Optional | 1 |
| CTP loop | Pricing Information | Optional | 100 |
CTP | Pricing Information | Mandatory | 1 |
G40 | Price Bracket Identifier, Item List Cost New, Item List Cost Old | Optional | 99 |
DTM | Date/Time Reference | Optional | 10 |
G36 | Price List Number, Price List Issue Number, Date | Optional | 1 |
LDT | Lead Time | Optional | 1 |
CUR | Currency | Optional | 5 |
PO4 | Item Physical Details | Optional | 1 |
CTB | Restrictions/Conditions | Optional | 5 |
REF | Reference Identification | Optional | >1 |
G43 | Market Area Code Qualifier, Market Area Code Identifier, Description | Optional | 9999 |
SAC | Service, Promotion, Allowance, or Charge Information | Optional | >1 |
G26 | Price Condition Code, Date Qualifier, Date | Optional | 99 |
| N1 loop | Name | Optional | >1 |
N1 | Name | Mandatory | 1 |
N2 | Additional Name Information | Optional | 2 |
N3 | Address Information | Optional | 2 |
N4 | Geographic Location | Optional | 1 |
REF | Reference Identification | Optional | 12 |
PER | Administrative Communications Contact | Optional | >1 |
DTM | Date/Time Reference | Optional | 10 |
PKG | Marking, Packaging, Loading | Optional | >1 |
| G39 loop | Item Characteristics - Vendor's Selling Unit | Optional | >1 |
G39 | Item Characteristics - Vendor's Selling Unit | Mandatory | 1 |
CTP | Pricing Information | Optional | 1 |
| PKL loop | Product Service ID Qualifier, Product Service ID, Unitor Basisfor Measurement Code | Optional | 20 |
PKL | Product Service ID Qualifier, Product Service ID, Unitor Basisfor Measurement Code | Mandatory | 1 |
CTP | Pricing Information | Optional | 1 |
PKG | Marking, Packaging, Loading | Optional | 2 |
| LFG loop | Description, Hazardous Classification, UNNA Identification Code | Optional | 1 |
LFG | Description, Hazardous Classification, UNNA Identification Code | Mandatory | 1 |
| CRC loop | Conditions Indicator | Optional | >1 |
CRC | Conditions Indicator | Mandatory | 1 |
QTY | Quantity | Optional | 1 |
| LM loop | Code Source Information | Optional | >1 |
LM | Code Source Information | Mandatory | 1 |
LQ | Industry Code | Mandatory | >1 |
| SLN loop | Subline Item Detail | Optional | >1 |
SLN | Subline Item Detail | Mandatory | 1 |
SI | Service Characteristic Identification | Optional | >1 |
PID | Product/Item Description | Optional | >1 |
DTM | Date/Time Reference | Optional | >1 |
CTP | Pricing Information | Optional | >1 |
PAM | Period Amount | Optional | >1 |
PO4 | Item Physical Details | Optional | >1 |
PKG | Marking, Packaging, Loading | Optional | >1 |
QTY | Quantity | Optional | >1 |
MEA | Measurements | Optional | >1 |
SAC | Service, Promotion, Allowance, or Charge Information | Optional | >1 |
MTX | Text | Optional | >1 |
| LM loop | Code Source Information | Optional | >1 |
LM | Code Source Information | Mandatory | 1 |
LQ | Industry Code | Mandatory | >1 |
| N9 loop | Reference Identification | Optional | >1 |
N9 | Reference Identification | Mandatory | 1 |
DTM | Date/Time Reference | Optional | >1 |
CTT | Transaction Totals | Optional | 1 |
SE | Transaction Set Trailer | Mandatory | 1 |
Mandatory segments must be sent, Optional ones only when the data applies. Trading partners often add their own rules in companion guides - ediFabric templates can be adjusted to match. Open the element-level definition in the EdiNation spec library.
A catalog item with product identifiers, description and dates. Paste it into EdiNation to see every element named and validated.
ISA*00* *00* *16*SENDER1 *14*RECEIVER1 *071216*1406*U*00204*000000263*1*T*>~ GS*IN*SENDER1*RECEIVER1*20071216*1406*000000001*X*004010~ ST*832*2001~ BCT*RC*BISG*980112*******00~ LIN*1*IB*0940016699*B7*Book Industry Study Group~ DTM*043*971230***19~ PID*S**BI*EN*4~ PID*S**BI*FBP*RB~ PID*S**BI*ED*REV~ PID*S**BI*SA*ACT~ PID*S**BI*E01*Ted Berg~ PID*S**BI*TI*Implementation Guidelines for Electronic Data Interchange~ PID*S**BI*ST*Based on ANSI X12 Version 3.6~ PID*S**BI*SU*COM020010~ CTP*RS*SLP*100.00*1*UN~ CUR*SE*USD~ N1*AG*Book Industry Study Group*15*216793X*17*Q3~ CTT*1~ SE*17*2001~ GE*2*000000001~ IEA*1*000000263~
ediFabric turns every loop, segment and element into a named field. This is the transaction from the sample, in the JSON that ediFabric Native and Cloud return and accept.
{
"ST": {
"TransactionSetIdentifierCode_01": "832",
"TransactionSetControlNumber_02": "2001"
},
"BCT": {
"CatalogPurposeCode_01": "RC",
"CatalogNumber_02": "BISG",
"CatalogVersionNumber_03": "980112",
"TransactionSetPurposeCode_10": "00"
},
"LINLoop": [
{
"LIN": {
"AssignedIdentification_01": "1",
"ProductServiceIDQualifier_02": "IB",
"ProductServiceID_03": "0940016699",
"ProductServiceIDQualifier_04": "B7",
"ProductServiceID_05": "Book Industry Study Group"
},
"DTM": [
{
"DateTimeQualifier_01": "043",
"Date_02": "971230",
"DateTimePeriodFormatQualifier_05": "19"
}
],
"PID": [
{
"ItemDescriptionType_01": "S",
"AgencyQualifierCode_03": "BI",
"ProductDescriptionCode_04": "EN",
"Description_05": "4"
},
{
"ItemDescriptionType_01": "S",
"AgencyQualifierCode_03": "BI",
"ProductDescriptionCode_04": "FBP",
"Description_05": "RB"
},
{
"ItemDescriptionType_01": "S",
"AgencyQualifierCode_03": "BI",
"ProductDescriptionCode_04": "ED",
"Description_05": "REV"
},
{
"ItemDescriptionType_01": "S",
"AgencyQualifierCode_03": "BI",
"ProductDescriptionCode_04": "SA",
"Description_05": "ACT"
},
{
"ItemDescriptionType_01": "S",
"AgencyQualifierCode_03": "BI",
"ProductDescriptionCode_04": "E01",
"Description_05": "Ted Berg"
},
{
"ItemDescriptionType_01": "S",
"AgencyQualifierCode_03": "BI",
"ProductDescriptionCode_04": "TI",
"Description_05": "Implementation Guidelines for Electronic Data Interchange"
},
{
"ItemDescriptionType_01": "S",
"AgencyQualifierCode_03": "BI",
"ProductDescriptionCode_04": "ST",
"Description_05": "Based on ANSI X12 Version 3.6"
},
{
"ItemDescriptionType_01": "S",
"AgencyQualifierCode_03": "BI",
"ProductDescriptionCode_04": "SU",
"Description_05": "COM020010"
}
],
"CTPLoop": [
{
"CTP": {
"ClassofTradeCode_01": "RS",
"PriceIdentifierCode_02": "SLP",
"UnitPrice_03": "100.00",
"Quantity_04": "1",
"CompositeUnitofMeasure_05": {
"UnitorBasisforMeasurementCode_01": "UN"
}
},
"CUR": [
{
"EntityIdentifierCode_01": "SE",
"CurrencyCode_02": "USD"
}
]
}
],
"N1Loop": [
{
"N1": {
"EntityIdentifierCode_01": "AG",
"Name_02": "Book Industry Study Group",
"IdentificationCodeQualifier_03": "15",
"IdentificationCode_04": "216793X",
"EntityRelationshipCode_05": "17",
"EntityIdentifierCode_06": "Q3"
}
}
]
}
],
"CTT": {
"NumberofLineItems_01": "1"
},
"SE": {
"NumberofIncludedSegments_01": "17",
"TransactionSetControlNumber_02": "2001"
}
}Read the file into typed objects with ediFabric .NET, convert it to JSON in process with the ediFabric Native bindings for Python, Java and C, or post it to the ediFabric Cloud REST API from any language.
using EdiFabric.Templates.X12004010; License.SetSerial("YOUR_SERIAL_KEY"); using (var stream = File.OpenRead(@"C:\edi\PriceCatalog.txt")) using (var reader = new X12Reader(stream, "EdiFabric.Templates.X12")) { var items = await reader.ReadToEndAsync(); foreach (var transaction in items.OfType<TS832>()) { if (transaction.IsValid(out MessageErrorContext errors)) Console.WriteLine($"{transaction.ST.TransactionSetControlNumber_02} is valid"); else Console.WriteLine(string.Join(Environment.NewLine, errors.Flatten())); } }
import json import edifabric_x12 as ef serial = "YOUR_SERIAL_KEY" ef.load_library() ef.set_serial(serial) ef.set_map(json.dumps({"default": serial, "maps": {}})) edi = open("PriceCatalog.txt", "rb").read() output, offset = ef.parse(edi, ef.ParseMode.JSON_VALIDATE) transactions = output[:offset] report = json.loads(output[offset:]) print(report["errors_count"])
import com.edifabric.nativex12.EdiFabricX12; import com.edifabric.nativex12.ParseMode; import com.edifabric.nativex12.ParseResult; String serial = "YOUR_SERIAL_KEY"; EdiFabricX12.loadLibrary(); EdiFabricX12.setSerial(serial); EdiFabricX12.setMap("{\"default\":\"" + serial + "\",\"maps\":{}}"); String edi = Files.readString(Path.of("PriceCatalog.txt")); ParseResult result = EdiFabricX12.parse(edi, ParseMode.JSON_VALIDATE); System.out.println(result.getTransactions()); System.out.println(result.getReport());
#include "edifabric_x12.h" const char *serial = "YOUR_SERIAL_KEY"; ef_parse_result result; if (ef_load_library(NULL) != 0) return 1; ef_set_serial(serial); ef_set_map("{\"default\":\"YOUR_SERIAL_KEY\",\"maps\":{}}"); char *edi = read_file("PriceCatalog.txt", NULL); /* helper in example_all_functions.c */ if (ef_parse(edi, EF_PARSE_JSON_VALIDATE, NULL, &result) == 0) { /* transactions = output[0 .. offset), report = output[offset .. length) */ fwrite(result.output.data, 1, (size_t)result.output.length, stdout); ef_free(result.output.data); }
curl -X POST 'https://api.edination.com/v2/x12/read' \ -H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \ -H 'Content-Type: application/octet-stream' \ --data-binary '@PriceCatalog.txt'
Populate a TS832 object in .NET, or pass JSON in the shape shown above to ediFabric Native or ediFabric Cloud, and get a valid 832 file back.
using EdiFabric.Templates.X12004010; License.SetSerial("YOUR_SERIAL_KEY"); var transaction = new TS832(); // Transaction Type is 832 // Control number is 2001 transaction.ST = new ST(); transaction.ST.TransactionSetIdentifierCode_01 = "832"; transaction.ST.TransactionSetControlNumber_02 = "0001"; // This is a Resale catalog // The catalog name is BISG // The revision is 1 / 12 / 98 // This is the original file transaction.BCT = new BCT(); transaction.BCT.CatalogPurposeCode_01 = "RC"; transaction.BCT.CatalogNumber_02 = "BISG"; transaction.BCT.CatalogVersionNumber_03 = "980112"; transaction.BCT.TransactionSetPurposeCode_10 = "00"; // Repeating LIN Loops transaction.LINLoop = new List<Loop_LIN_832>(); // Begin LIN Loop var linLoop1 = new Loop_LIN_832(); // ... set the remaining loops and segments the same way // SegmentBuilders is in the Common project of the example repository using (var stream = new MemoryStream()) { using (var writer = new X12Writer(stream)) { writer.Write(SegmentBuilders.BuildIsa("1")); writer.Write(SegmentBuilders.BuildGs("1")); writer.Write(transaction); } Console.WriteLine(Encoding.UTF8.GetString(stream.ToArray())); }
import json import edifabric_x12 as ef serial = "YOUR_SERIAL_KEY" ef.load_library() ef.set_serial(serial) ef.set_map(json.dumps({"default": serial, "maps": {}})) # the transactions JSON returned by ef.parse, edited or produced by your application transactions = open("PriceCatalog.json", "rb").read() edi = ef.build(transactions, postfix="\r\n") print(edi)
import com.edifabric.nativex12.EdiFabricX12; String serial = "YOUR_SERIAL_KEY"; EdiFabricX12.loadLibrary(); EdiFabricX12.setSerial(serial); EdiFabricX12.setMap("{\"default\":\"" + serial + "\",\"maps\":{}}"); // the transactions JSON returned by parse, edited or produced by your application String transactions = Files.readString(Path.of("PriceCatalog.json")); String edi = EdiFabricX12.build(transactions, "\r\n"); System.out.println(edi);
#include "edifabric_x12.h" ef_buffer edi; if (ef_load_library(NULL) != 0) return 1; ef_set_serial("YOUR_SERIAL_KEY"); ef_set_map("{\"default\":\"YOUR_SERIAL_KEY\",\"maps\":{}}"); /* the transactions JSON returned by ef_parse, edited or produced by your application */ char *transactions = read_file("PriceCatalog.json", NULL); if (ef_build(transactions, "\r\n", &edi) == 0) { fwrite(edi.data, 1, (size_t)edi.length, stdout); ef_free(edi.data); }
# the JSON returned by /read, edited or produced by your application curl -X POST 'https://api.edination.com/v2/x12/write' \ -H 'Ocp-Apim-Subscription-Key: YOUR_SERIAL_KEY' \ -H 'Content-Type: application/json' \ --data-binary '@PriceCatalog.json' \ -o 'PriceCatalog.txt'
Either. BCT and the maintenance codes on each item say whether the file is a complete catalog or adds, changes and deletes items.
In CTP segments within each LIN loop, with the price qualifier, unit price and quantity breaks.
PRICAT, the price/sales catalogue message.
In .NET, install EdiFabric and EdiFabric.Templates.X12, read the file with X12Reader into TS832 objects and write them back with X12Writer. From Python, Java or C, use ediFabric Native, which converts 832 files to JSON and JSON back to X12 inside your process. From any other language, post the file to the ediFabric Cloud REST API.