---
updatedAt: 2026-03-05T17:38:16.000Z
agentTools:
  projectIndex: https://docs.orderful.com/llms.txt
---

# 850 Purchase Order

# 📄 EDI 850 to NetSuite Sales Order Mapping Documentation

This document maps fields from an inbound EDI 850 Purchase Order document to a NetSuite Sales Order, detailing how each EDI field translates into NetSuite record fields.

***

### 🧾 Header Mapping

| **EDI Field (JSON)**                                   | **NetSuite Field**                                                                                | **Description**                                           |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
| `beginningSegmentForPurchaseOrder.purchaseOrderNumber` | `otherrefnum`                                                                                     | Customer's PO number.                                     |
| `beginningSegmentForPurchaseOrder.date`                | `custbody_orderful_edi_po_date`, `trandate`                                                       | PO date, optionally used as the order date if configured. |
| (current date)                                         | `trandate`                                                                                        | Defaults to today unless overridden by config.            |
| `contacts.orderContact.email`                          | `email`                                                                                           | Order contact email.                                      |
| `entityNetSuiteId` (lookup)                            | `entity`                                                                                          | Internal customer entity ID in NetSuite.                  |
| `ediServiceCode`, `ediCarrierId`, `ediRouting`         | `custbody_orderful_edi_service`, `custbody_orderful_edi_carrier`, `custbody_orderful_edi_routing` | Carrier and routing info from EDI.                        |
| `departmentNumber`                                     | `custbody_orderful_department_number`                                                             | Department number (custom).                               |
| `customerOrderNumber`                                  | `custbody_orderful_cust_order_num`                                                                | Additional customer-facing order number.                  |
| `earliestDelivery`, `latestDelivery`                   | `custbody_orderful_earliest_delivery`, `custbody_orderful_latest_delivery`                        | Delivery window info.                                     |
| `N1_loop[].EntityIdentifier.Ship_To`                   | `custbody_orderful_n1_shipto`                                                                     | JSON representation of the ship-to party.                 |
| `N1_loop[].EntityIdentifier.Bill_To`                   | `custbody_orderful_n1_billto`                                                                     | JSON representation of the bill-to party.                 |
| EDI Transaction Type                                   | `custbody_orderful_document`                                                                      | Linked to the internal Orderful transaction ID.           |

***

### 🏢 Address Handling

| **EDI Field (JSON)**                  | **NetSuite Field**                     | **Description**                                                   |
| ------------------------------------- | -------------------------------------- | ----------------------------------------------------------------- |
| `shippingAddress`, `shipToId`         | `shippingaddress` or `shipaddresslist` | Based on whether the address is direct or referenced via a DC ID. |
| `billingAddress`, `ediId`             | `billingaddress` or `billaddresslist`  | Same as above for billing.                                        |
| `shipToId`, if used as DC             | `custbody_orderful_ship_dc_number`     | Captures the distribution center number.                          |
| `billingAddress.ediId`, if used as DC | `custbody_orderful_bill_dc_number`     | Captures the billing DC number.                                   |

***

### 🔁 Reference Identifiers

| **EDI Field (JSON)**                                        | **NetSuite Field**                 | **Description**                          |
| ----------------------------------------------------------- | ---------------------------------- | ---------------------------------------- |
| `referenceInformation[].referenceIdentification (PO)`       | `otherrefnum`                      | PO number from EDI.                      |
| `referenceInformation[].referenceIdentification (Vendor)`   | `tranid`                           | Sales Order ID if used for traceability. |
| `referenceInformation[].referenceIdentification (Customer)` | `custbody_orderful_cust_order_num` | Additional customer-facing order number. |

***

### 📦 Line Items

| **EDI Field (JSON)**                           | **NetSuite Field**                                         | **Description**                                  |
| ---------------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------ |
| `PO1_loop[].quantity`                          | `quantity`                                                 | Ordered quantity.                                |
| `PO1_loop[].price`                             | `rate`                                                     | Price or rate, if EDI pricing is enabled.        |
| `PO1_loop[].productServiceID`                  | `custcol_orderful_item_identification`                     | Original product identifiers (JSON format).      |
| `PO1_loop[].lineItemChange.lineItemStatusCode` | `custcol_orderful_line_ref`                                | Line reference or change status tracking.        |
| `ACK_loop[].date`                              | `shipdate`                                                 | Requested ship date, parsed from the EDI format. |
| `N9_loop[].text[].textualData`                 | `custbody_orderful_n9_notes`                               | Notes and comments pulled from the N9 loop.      |
| `SLN_loop[]` (kit reference)                   | `custcol_orderful_kit_ref` / `custcol_orderful_kits_count` | Used for kits and component breakdowns.          |

***

### 💲 Discounts and Adjustments

| **EDI Field (JSON)**                       | **NetSuite Field**                | **Description**                                                                                                                                                                                                                                     |
| ------------------------------------------ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SAC_loop[]` (header)                      | `discountitem`                    | Discount Item from Authorized Discount mapping. Set when exactly one header-level SAC discount is present. See [Discounts & Allowances](https://docs.orderful.com/docs/sac-discount-handling).                                                                                 |
| `SAC_loop[]` (header)                      | `discountrate`                    | Discount rate (dollar amount or percentage). Set when exactly one header-level SAC discount is present. When multiple discounts exist, they are added as line items after a Subtotal line. See [Discounts & Allowances](https://docs.orderful.com/docs/sac-discount-handling). |
| `SAC_loop[]` (header)                      | `custbody_orderful_discount_item` | Reference to the Authorized Discount record. See [Discounts & Allowances](https://docs.orderful.com/docs/sac-discount-handling).                                                                                                                                               |
| `SAC_loop[]` (line-level, in `PO1_loop[]`) | Discount line items               | Line-level discounts are added as Discount line items immediately after the corresponding product line. See [Discounts & Allowances](https://docs.orderful.com/docs/sac-discount-handling).                                                                                    |

***

### 🔄 Custom Mappings

| **EDI Field (Custom/Derived)**                 | **NetSuite Field (via plugin or SDF map)** | **Description**                              |
| ---------------------------------------------- | ------------------------------------------ | -------------------------------------------- |
| Any `customrecord_orderful_edi_field_map_head` | Mapped dynamically to header fields        | Custom header field mapping via SuiteQL.     |
| Any `customrecord_orderful_edi_field_map_line` | Mapped dynamically to line fields          | Custom line-level field mapping via SuiteQL. |