# EDI X12 850 Purchase Order Parser & JSON Converter
> B2B supply chain EDI parser converting retail and enterprise ANSI X12 850 purchase orders into structured JSON.

- **Canonical URL:** https://stanzaapi.com/tools/x12-parser/transaction/850-purchase-order
- **Governing Standard:** ANSI ASC X12 Standards (005010) (Accredited Standards Committee X12 / HIPAA 5010)
- **Latency:** <3ms Edge
- **Privacy:** In-memory execution only (zero data stored or logged)

## Technical Overview & Governing Rules
The ANSI X12 850 Purchase Order transaction set is the cornerstone of electronic B2B commerce used by Amazon, Walmart, Target, and major distributors.

Parses BEG segments containing PO number, order date, and release numbers.

Extracts PO1 line item loops with SKU, UPC, GTIN, quantity ordered, unit of measure, unit price, and SAC promotional allowances/charges.

## Specification Matrix
| Segment | Description | Key Elements Extracted | Usage |
| --- | --- | --- | --- |
| BEG | Beginning Segment for PO | BEG01 (00=Original), BEG02 (SA=Stand Alone, DS=Drop Ship), BEG03 (PO #) | Order header |
| N1 | Name and Address Loop | N101 (BT=Bill To, ST=Ship To, VN=Vendor), N104 (GLN/DUNS ID) | Party routing |
| PO1 | Purchase Order Baseline Item Data | PO102 (Quantity), PO103 (UOM: EA/CA), PO104 (Unit Price), PO107 (UPC/SKU) | Line items |
| CTT | Transaction Totals | CTT01 (Total Line Items), CTT02 (Hash Total Quantity) | Validation integrity |

## Standard JSON Response Model
```json
{
  "transactionSet": "850",
  "purchaseOrderNumber": "PO-991823",
  "orderDate": "20260830",
  "shipTo": {
    "name": "DISTRIBUTION CENTER 4",
    "address": "100 LOGISTICS WAY",
    "city": "CHICAGO",
    "state": "IL"
  },
  "lineItems": [
    {
      "lineNumber": "1",
      "quantity": 500,
      "uom": "EA",
      "unitPrice": 12.5,
      "upc": "012345678905",
      "sku": "SKU-A99"
    }
  ]
}
```

## Frequently Asked Questions & Edge Cases
### Q: Are drop-ship 850 orders supported?
**A:** Yes. Drop-ship addresses in N1/N3/N4 segments are cleanly separated from billing entities.
