X12 832 Price/Sales Catalog

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.

At a glance

Standard
X12
Version
004010
Functional group
SC (GS01)
Sent by
Supplier or manufacturer to customer
Responses
997
ediFabric .NET template
TS832 in EdiFabric.Templates.X12
OpenEDI definition
View 832 in the spec library

832 structure

The 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
STTransaction Set HeaderMandatory1
BCTBeginning Segment for Price/Sales CatalogMandatory1
CTPPricing InformationOptional100
REFReference IdentificationOptional>1
YNQYes/No QuestionOptional10
PERAdministrative Communications ContactOptional>1
DTMDate/Time ReferenceOptional10
CTBRestrictions/ConditionsOptional25
CURCurrencyOptional5
ITDTerms of Sale/Deferred Terms of SaleOptional2
LDTLead TimeOptional>1
SACService, Promotion, Allowance, or Charge InformationOptional>1
TD1Carrier Details (Quantity and Weight)Optional>1
TD5Carrier Details (Routing Sequence/Transit Time)Optional>1
TD3Carrier Details (Equipment)Optional>1
TD4Carrier Details (Special Handling, or Hazardous Materials, or Both)Optional>1
FOBF.O.B. Related InstructionsOptional1
PKGMarking, Packaging, LoadingOptional>1
G93Price Bracket Identifier, Quantity, Unitor Basisfor Measurement CodeOptional50
TXITax InformationOptional>1
AAARequest ValidationOptional1
N1 loopNameOptional>1
N1NameMandatory1
N2Additional Name InformationOptional2
N3Address InformationOptional2
N4Geographic LocationOptional>1
REFReference IdentificationOptional12
PKGMarking, Packaging, LoadingOptional>1
PERAdministrative Communications ContactOptional>1
DTMDate/Time ReferenceOptional10
LM loopCode Source InformationOptional>1
LMCode Source InformationMandatory1
LQIndustry CodeMandatory>1
N9 loopReference IdentificationOptional>1
N9Reference IdentificationMandatory1
DTMDate/Time ReferenceOptional>1
LIN loopItem IdentificationOptional>1
LINItem IdentificationMandatory1
PO1Baseline Item DataOptional1
G53Maintenance TypeOptional1
SIService Characteristic IdentificationOptional>1
DTMDate/Time ReferenceOptional10
REFReference IdentificationOptional>1
YNQYes/No QuestionOptional10
PERAdministrative Communications ContactOptional>1
CRDCountry Code, Amount Qualifier Code, Monetary AmountOptional>1
CTBRestrictions/ConditionsOptional25
PIDProduct/Item DescriptionOptional200
MEAMeasurementsOptional40
PKGMarking, Packaging, LoadingOptional25
PO4Item Physical DetailsOptional1
TD1Carrier Details (Quantity and Weight)Optional>1
TD5Carrier Details (Routing Sequence/Transit Time)Optional>1
TD3Carrier Details (Equipment)Optional>1
TD4Carrier Details (Special Handling, or Hazardous Materials, or Both)Optional>1
ITDTerms of Sale/Deferred Terms of SaleOptional2
LDTLead TimeOptional1
SACService, Promotion, Allowance, or Charge InformationOptional>1
FOBF.O.B. Related InstructionsOptional1
AAARequest ValidationOptional1
TC2CommodityOptional2
TXITax InformationOptional>1
G55Item Characteristics - Consumer UnitOptional1
G54Quantity, Unitor Basisfor Measurement Code, UPC Case CodeOptional1
CTP loopPricing InformationOptional100
CTPPricing InformationMandatory1
G40Price Bracket Identifier, Item List Cost New, Item List Cost OldOptional99
DTMDate/Time ReferenceOptional10
G36Price List Number, Price List Issue Number, DateOptional1
LDTLead TimeOptional1
CURCurrencyOptional5
PO4Item Physical DetailsOptional1
CTBRestrictions/ConditionsOptional5
REFReference IdentificationOptional>1
G43Market Area Code Qualifier, Market Area Code Identifier, DescriptionOptional9999
SACService, Promotion, Allowance, or Charge InformationOptional>1
G26Price Condition Code, Date Qualifier, DateOptional99
N1 loopNameOptional>1
N1NameMandatory1
N2Additional Name InformationOptional2
N3Address InformationOptional2
N4Geographic LocationOptional1
REFReference IdentificationOptional12
PERAdministrative Communications ContactOptional>1
DTMDate/Time ReferenceOptional10
PKGMarking, Packaging, LoadingOptional>1
G39 loopItem Characteristics - Vendor's Selling UnitOptional>1
G39Item Characteristics - Vendor's Selling UnitMandatory1
CTPPricing InformationOptional1
PKL loopProduct Service ID Qualifier, Product Service ID, Unitor Basisfor Measurement CodeOptional20
PKLProduct Service ID Qualifier, Product Service ID, Unitor Basisfor Measurement CodeMandatory1
CTPPricing InformationOptional1
PKGMarking, Packaging, LoadingOptional2
LFG loopDescription, Hazardous Classification, UNNA Identification CodeOptional1
LFGDescription, Hazardous Classification, UNNA Identification CodeMandatory1
CRC loopConditions IndicatorOptional>1
CRCConditions IndicatorMandatory1
QTYQuantityOptional1
LM loopCode Source InformationOptional>1
LMCode Source InformationMandatory1
LQIndustry CodeMandatory>1
SLN loopSubline Item DetailOptional>1
SLNSubline Item DetailMandatory1
SIService Characteristic IdentificationOptional>1
PIDProduct/Item DescriptionOptional>1
DTMDate/Time ReferenceOptional>1
CTPPricing InformationOptional>1
PAMPeriod AmountOptional>1
PO4Item Physical DetailsOptional>1
PKGMarking, Packaging, LoadingOptional>1
QTYQuantityOptional>1
MEAMeasurementsOptional>1
SACService, Promotion, Allowance, or Charge InformationOptional>1
MTXTextOptional>1
LM loopCode Source InformationOptional>1
LMCode Source InformationMandatory1
LQIndustry CodeMandatory>1
N9 loopReference IdentificationOptional>1
N9Reference IdentificationMandatory1
DTMDate/Time ReferenceOptional>1
CTTTransaction TotalsOptional1
SETransaction Set TrailerMandatory1

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.

Sample 832 file

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~

The same 832 as JSON

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"
  }
}

Parse and validate an 832 file

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'

Generate an 832 file

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'

832 questions

Is an 832 a full catalog or a change?

Either. BCT and the maintenance codes on each item say whether the file is a complete catalog or adds, changes and deletes items.

Where are the prices in an 832?

In CTP segments within each LIN loop, with the price qualifier, unit price and quantity breaks.

What is the EDIFACT equivalent of the 832?

PRICAT, the price/sales catalogue message.

How do I parse and generate X12 832 files in .NET, Python, Java and C?

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.

Parse your first 832 in five minutes

The Community plan is free forever and needs no credit card. It includes ediFabric .NET, Native and Cloud.