50% off your first 3 months*

Mappings: turning an EDI purchase order into the fields your system expects

Every partner sends the same 850 a little differently, and every accounting system wants its own shape. A mapping is the small, testable piece in the middle.

Weredi team4 min read

Moving an EDI file from your partner to your systems is the easy half of an integration. The other half is reshaping it: a date written CCYYMMDD has to become a date your software accepts, a warehouse code has to become one of your customers, a case of 12 has to become 12 units. That reshaping is what a mapping does.

What a mapping is

A mapping describes the document your system expects and, for each of its fields, where the value comes from in the EDI document. Each field holds a short expression written in JSONata, an open, documented query language. Most are one line: take this element, reformat this date, look this code up.

Destination fieldExpressionResult
Order date$formatDate("20261001", "YYYY-MM-DD")2026-10-01
Delivery time$formatDate("1345", "h:mm A")1:45 PM
Customer$lookupTable(12, "0412")Sumner distribution centre
Units ordered2 * 1224

The examples use literal values so you can read them; in a real mapping each one points at the element in the partner’s document instead.

How you build one

  1. Describe the destination

    Paste an example of the JSON your system expects, or its JSON Schema. Weredi turns it into an empty structure with one slot per field, ready to fill.

  2. Write each field with help on hand

    The editor completes every JSONata function as you type, with its signature and an example, plus two made for EDI: $formatDate rewrites EDI dates and times, $lookupTable translates a code through one of your tables.

  3. Test against a real document

    Pick a sample from that partner and the editor shows the value each field produces, how many times each repeating group runs, and any field that comes out empty or invalid, before a single live order goes through it.

  4. Translate codes with lookup tables

    When a partner’s code has no match yet, the editor says so and lets you add the line on the spot. The expression is wrapped in $lookupTable for you. More on lookup tables.

    N104PO1TD5

The transformations you’ll actually need

  • Dates and times. EDI writes 20261001 and 1345; your system wants 2026-10-01 and 1:45 PM.
  • Codes. A store or distribution centre number becomes a customer or ship-to in your books; a carrier code becomes a carrier name.
  • Units and quantities. An order in cases becomes units, or the other way round.
  • Repeating lines. Every PO1 line becomes a line in your accounting system, however many there are.
  • Conditions. Use the partner’s ship-to when it is present, your default warehouse when it isn’t.
  • Text. Join, trim or split names and references so they fit the destination field.

Start from the connector’s default

The QuickBooks Online, Xero, Sage and NetSuite connections come with a default mapping for each direction and document. You only change what your partner does differently, and you can go back to the default at any time. See ERP and accounting integration.

Mapping in code vs. mapping in Weredi

Hand-written integration

  • Each partner difference is a code change and a deployment
  • Tested on live orders, after the fact
  • Code tables live in a developer’s head or a spreadsheet

A Weredi mapping

  • Each field is one expression you can read and change
  • Tested against the partner’s own sample before it runs
  • Code tables are lookup tables you can edit and extend

Questions

Do I need to be a developer?

No, but it helps to be comfortable with formulas. Most fields take a value as is; the editor completes functions as you type and shows the result on a real document.

What happens when a partner changes its documents?

You change the expression for the field that moved, test it against a new sample from that partner, and save. Nothing else is redeployed.

Which plans include mappings?

Mappings, lookup tables and the accounting connections are part of Weredi Plus and Enterprise, and of every active trial.

Weredi team

Practical EDI guides from the people who build and support Weredi, in Montréal.

Related articles

All articles →

Map once, then let every order flow

Mappings and lookup tables are part of Weredi Plus, along with the QuickBooks Online, Xero, Sage and NetSuite connections they feed.

Sign up free
Weredi
+1 877-WEREDI-1 (+1 877-937-3341)
Weredi is a high-performing global supply chain network that provides fully integrated, end-to-end supply chain visibility and management.
Weredi™ is a trademark of Weredi, Inc. All other names, logos, and brands appearing on this site are the property of their respective owners (including “X12,” a trademark of X12 Incorporated). Neither Weredi, Inc. nor its products or services are endorsed by, sponsored by, or affiliated with these third parties. Any use of third-party names, logos, or brands is solely for identification and does not imply endorsement, sponsorship, or affiliation.
*New Weredi and Weredi Plus accounts on monthly billing, applied automatically at checkout. Annual billing includes 2 months free instead. Enterprise plans are quoted separately.
© Weredi, Inc. 2023, All rights reserved | Sitemap | Legal & Privacy | System status | Log in