{
  "slug": "edi-850-specification",
  "title": "EDI 850 specification: purchase order segments and a worked example",
  "description": "The structure of an X12 850 — BEG, N1 party loops, PO1 line items, DTM dates and CTT — with an endpoint that parses one into JSON.",
  "keywords": [
    "edi 850 specification",
    "850 purchase order format",
    "beg segment",
    "po1 segment",
    "edi 850 example",
    "x12 850 structure",
    "purchase order edi format"
  ],
  "cause": [
    "An 850 is a purchase order. BEG opens it with a transaction purpose code, an order type, the purchase order number and the order date. Everything else hangs off that.",
    "N1 loops identify the parties, each with an entity identifier code — ST ship to, BT bill to, VN vendor, BY buying party — optionally followed by N3 street and N4 city, state and postal code.",
    "PO1 carries each line: line number, quantity, unit of measure, unit price, then repeating pairs of product qualifier and value. UP is a UPC-12, UK a GTIN-14, EN an EAN-13, VP a vendor part number, IN a buyer item number. PID after a line carries a description.",
    "DTM segments carry dates by qualifier: 002 requested delivery, 010 requested ship, 001 cancel after, 038 ship no later than. CTT counts line items, and SE01 counts every segment from ST through SE inclusive."
  ],
  "example": {
    "label": "Parse a purchase order into structured JSON",
    "curl": "curl -sX POST https://fluentedi.com/v1/edi/parse -H 'content-type: application/json'   -d '{\"input\":\"ST*850*0001~BEG*00*SA*4500123456**20260824~N1*ST*ACME STORES*92*0042~PO1*1*100*EA*9.99**UP*012345678905~CTT*1~SE*6*0001~\"}'",
    "output": "\"document\": \"Purchase Order (850)\",\n\"purchase_order_number\": \"4500123456\",\n\"order_date\": \"2026-08-24\",\n\"parties\": [{ \"role\": \"Ship To\", \"name\": \"ACME STORES\", \"id\": \"0042\" }],\n\"lines\": [{ \"quantity\": 100, \"unit\": \"EA\", \"unit_price\": 9.99,\n            \"product_ids\": { \"UPC-12\": \"012345678905\" } }],\n\"estimated_total\": 999"
  },
  "fix": [
    "Read the product qualifier before the value. UP, UK, EN and VP are different identifier schemes and treating them interchangeably produces the wrong item.",
    "Prices in PO104 are decimal in most retail implementations but check the guide — some partners use implied decimals, where 999 means 9.99.",
    "The 850 you receive determines the 810 you send. Keep the purchase order number and party identifiers; a three-way match compares them."
  ],
  "tools": [
    "https://fluentedi.com/v1/edi/parse",
    "https://fluentedi.com/v1/edi/validate",
    "https://fluentedi.com/v1/id/validate"
  ]
}