Generate EDIFACT ORDERS
generate_edifactGenerate a syntactically valid EDIFACT ORDERS D.96A interchange from a simple JSON order description. Parties, dates, currency, and line items are automatically enveloped and computed.
Instructions
Generate a syntactically valid EDIFACT ORDERS D.96A interchange (UNA + UNB...UNZ) from a simple JSON order description: parties, dates, currency and line items. Envelopes, escaping and UNT/UNZ counters are computed automatically; the output round-trips through parse_edifact with zero issues.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| buyer | No | Buyer party (NAD+BY), id is typically a GLN | |
| items | Yes | Order lines (LIN groups) | |
| sender | Yes | Interchange sender (UNB) | |
| currency | No | ISO 4217 currency code (CUX), e.g. EUR | |
| freeText | No | Header free text (FTX+AAI) | |
| supplier | No | Supplier party (NAD+SU) | |
| orderDate | Yes | Order date, "YYYYMMDD" or "YYYY-MM-DD" (DTM+137) | |
| recipient | Yes | Interchange recipient (UNB) | |
| messageRef | No | Message reference number (UNH/UNT), default 1 | |
| orderNumber | Yes | Purchase order number (BGM) | |
| deliveryDate | No | Requested delivery date (DTM+2) | |
| deliveryParty | No | Delivery party (NAD+DP) | |
| interchangeRef | No | Interchange control reference (UNB/UNZ), default 1 |