Skip to content
Matt MacDougall edited this page Sep 9, 2026 · 1 revision

Orders

New store orders are queued for export as NetSuite SalesOrder records. The package imports a limited set of changes to already-linked store orders. NetSuite-originated order creation belongs to a separate Rocket Web add-on and is not included here.

Before exporting

Import or link every ordered product so it has a valid netsuite_internal_id. Configure the customer address field, payment methods, shipping items, initial order status, optional location, and tax/discount behavior.

The sales_model_service_quote_submit_success observer queues order_place with the Magento order entity ID. The exporter maps current order data, resolves or creates its NetSuite customer, submits an Add request, and saves the returned NetSuite ID on the store order.

Export mapping

NetSuite field Behavior
tranDate Store order creation timestamp.
entity Resolved or newly created NetSuite customer. Guest orders also need a NetSuite customer.
orderStatus Configured initial status, normally Pending Fulfillment or Pending Approval. Default: _pendingFulfillment.
Billing/shipping addresses Store order addresses, independent of future customer-address edits.
shipMethod, shippingCost Configured shipping-item mapping/fallback and the order's shipping charge.
paymentMethod, creditCardProcessor Payment mappings and optional processor helper.
location Optional configured Order Location Id, also applied to exported line items by the location mapper.
itemList Linked products, ordered quantities, descriptions/options, and custom prices from the order.
Custom fields Fixed values or named Magento order data fields, using configured field types.

Product lines use NetSuite custom price level -1. Configurable parent lines are skipped and their simple variation is exported with the appropriate parent price fallback. Bundle-child handling is specialized; test kits/bundles with discounts and fulfillments as complete orders. Do not infer a general component-export mode from the inherited "Push line items with fixed price bundles" label.

Shipping methods

Map a store shipping method to a NetSuite shipping-item internal ID and configure the fallback ID for unmatched methods. Shipping cost is taken from the order. Tracking-carrier mapping is separate and is used when fulfillments return.

NetSuite field IDs and shipping method codes are account/store-specific. The connector's empty mapping does not prove that a NetSuite account will accept the order without a shipping item.

Payment methods and helpers

Payment-method mapping can distinguish credit-card type; an empty card-type entry matches all card types. Put specific entries before a catch-all when needed. Processor mapping matches payment method and either a specific website or all websites; the first matching row is used.

Helper Additional mapped data
Simple No extra processor-specific fields.
Check Purchase-order/check reference mapped to otherRefNum.
PayPal Express Transaction IDs mapped to PayPal/payment reference fields.
Cybersource tokenized Reads MageDelight-specific subscription/transaction values and maps them into the NetSuite order. Requires that exact integration context.

These helpers map data; they are not generic authorization, capture, or refund orchestration. Validate the actual payment extension and NetSuite workflow. Do not copy the older FAQ's broad capture-on-shipment promise into an acceptance plan.

Custom transaction fields

The mapping supports:

  • simple: a StringCustomFieldRef.
  • list: a custom list value matched by its text, case-insensitively.
  • standard: direct assignment to a SOAP record property.
  • standard_record_ref: assignment of an internal ID through RecordRef.

Choose a fixed value or a Magento order attribute read with getData(), such as increment_id. Attribute names must match the current order data model; the older sales_flat_order table reference does not apply to Magento 2.

The UI's wording about fields being "synched" does not mean these mappings are imported back. This implementation applies them on order export.

Imported order changes

The order import processor updates:

  • State and status using the configured NetSuite status map, with fallback processing.
  • Existing item qty_invoiced from NetSuite quantityBilled and qty_shipped from quantityFulfilled.
  • Corresponding configurable-parent quantity counters and the last-import timestamp.

The same mapped value is assigned as both state and status. Use a valid Magento state/status combination and test custom status mappings. Quantity counters are not themselves invoice or shipment documents; those have separate processors.

It does not create an unlinked order or update its item list, ordered quantities, prices, totals, billing/shipping addresses, or shipping method. Its scheduled queue path also bypasses the processor's normal eligibility check; unrelated NetSuite orders can become failed queue messages. See Known limitations.

Reprocessing

# Magento order entity ID, not the displayed increment number
bin/magento netsuite:utils:processrecord --type=order_export --id=456

This command invokes the Add path directly. It is not an idempotent "update existing NetSuite order" command. Before replaying an uncertain export, check whether NetSuite already accepted it. A timeout after a successful remote write can otherwise lead to duplicate sales orders.

Sources: order observer, export processor, order mapper, line mapping, payment helpers, custom fields, order import, status mapping.

Clone this wiki locally