850 Purchase Order
Send an EDI 850 purchase order via API
Quick answer
Can I send raw X12 instead of JSON?
What is an EDI 850?
The 850 Purchase Order is the most common retail EDI document. SignalEDI accepts JSON that maps to your partner's X12 850 implementation guide.
- See /documents/850 for segment-level reference
- Partner profiles control mandatory loops and qualifiers
POST request
Pass partnerId, environment, documentTypeCode 850, and a payload with purchase order fields. SignalEDI verifies the account integration, then validates and translates to X12 before routing.
curl -X POST https://api.signaledi.com/v1/documents/outbound \
-H "Authorization: Bearer $SIGNALEDI_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"partnerId": "your-partner-id",
"environment": "LAB",
"documentTypeCode": "850",
"payload": {
"purchaseOrderNumber": "PO-1042",
"shipTo": {
"id": "DC-01",
"name": "RetailMart DC 01"
},
"lines": [
{
"lineNumber": 1,
"sku": "SKU-100",
"quantity": 24,
"unitPrice": 12.5
}
]
}
}'Node and Python
Same outbound call in application code — store SIGNALEDI_API_KEY and partnerId in environment variables.
const res = await fetch("https://api.signaledi.com/v1/documents/outbound", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SIGNALEDI_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
partnerId: "your-partner-id",
environment: "LAB",
documentTypeCode: "850",
payload: {
purchaseOrderNumber: "PO-1042",
shipTo: { id: "DC-01", name: "RetailMart DC 01" },
lines: [{ lineNumber: 1, sku: "SKU-100", quantity: 24, unitPrice: 12.5 }],
},
}),
});
const data = await res.json(); // { ok: true, documentId, status, environment }
import os
import uuid
import requests
r = requests.post(
"https://api.signaledi.com/v1/documents/outbound",
headers={
"Authorization": f"Bearer {os.environ['SIGNALEDI_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"partnerId": "your-partner-id",
"environment": "LAB",
"documentTypeCode": "850",
"payload": {
"purchaseOrderNumber": "PO-1042",
"shipTo": {"id": "DC-01", "name": "RetailMart DC 01"},
"lines": [{"lineNumber": 1, "sku": "SKU-100", "quantity": 24, "unitPrice": 12.5}],
},
},
)
print(r.json())Validation errors
Missing required fields return 400 with fieldErrors. Terminal failures after admission emit document.delivery_failed.v1 and remain visible in the multi-stage receipt.
- Example 400: { "fieldErrors": { "partnerId": "Required" } }
{
"ok": true,
"documentId": "doc_01HXYZ…",
"status": "validated",
"environment": "LAB",
"partnerContacted": false
}FAQ
Common questions
Yes. Send exact X12 in content or lossless Base64 in contentBase64. Every recognized X12 or EDIFACT type with rawSend=true can use the raw lane when the account profile authorizes it.
Watch document.transport_delivered.v1 and document.acknowledgement_received.v1, and inspect the receipt because transport delivery and partner acknowledgement are separate states.