Articles in this section

Sync modified Shopify orders to NetSuite sales orders

You can add items, remove items, and adjust the item quantities in Shopify for an order. These Shopify-edit orders can now be synced to NetSuite using the “Shopify Order to NetSuite Order/CashSale Add” flow. 

The flow syncs the order edit adjustments data to NetSuite, only if:

  • The fulfillment process is not initiated for the order or a particular line item. (Note: Make sure that none of the items in the fulfillment is fulfilled or partially fulfilled. A change in the status of even just one line item will cause an error to appear.)
  • The order is not in the closed status in NetSuite.
  • A particular order edit line (positively or negatively) adjusted is not closed in NetSuite.

Notes

  • The real-time flows do not support this feature.
  • The auto-billing flow does not support this feature.
  • This feature is not supported for the orders originated from NetSuite.

Important: The item type "Description" is not supported by the default NetSuite item settings: Tracking order lines when no matching SKU is found in NetSuite and Tracking Shopify order lines that have no SKU value.

To understand more about the order edit adjustments and limitations in Shopify, refer here.

Prerequisite: In the line of Shopify order to NetSuite order (cash sale or sales order), click Configure Settings:

  • In the Filter orders by* setting, select Last updated time.
  • Check the Sync Shopify edited order data to NetSuite box.

Open the Post Orders to NetSuite mapping of the same flow and confirm the Items: Replace All Lines mapping is configured correctly:

  1. Locate (or add) the Items: Replace All Lines mapping in the Post Orders to NetSuite import step.
  2. Click Settings next to the field, set Field Type to Boolean, and select the value true (lowercase) from the dropdown.
  3. Do not hard-code the string "True" (capital T) into the mapping. The integration app treats hard-coded strings as text and silently ignores the Replace-All instruction; the removed Shopify line will not be removed in NetSuite, and a variance line will be created instead.

Without this mapping, line removals in Shopify do not propagate to NetSuite even when the Sync Shopify edited order data to NetSuite checkbox is enabled. Line additions still flow through, but removed lines stay and have to be closed manually.

When you enable the Sync Shopify edited order data to NetSuite setting and run the Shopify order to NetSuite order (cash sale or sales order) flow, the flow syncs all the edited orders from the last run. The sales order in NetSuite is updated to reflect the latest order edits. The updated sales order in NetSuite helps the warehouse team plan inventory appropriately so that the removed items are not fulfilled.

Important

  • If the sales order is not found in NetSuite, a new sales order record is created with the updated details.
  • When you perform order edit adjustments and run the Shopify Order to NetSuite Order/CashSale Add flow, the flow updates the orders with the latest advanced settings.
  • All the order components (such as taxes, discounts, etc) are recalculated.
  • If the existing order items have discounts and you perform an order edit by adding another item without a discount, ensure that you add the mapping as shown in the following screenshot. If you do not add the mapping, the sequence of items with discounts will appear incorrectly after the sales orders are synced to NetSuite. To add the mapping, navigate to the Shopify Order to NetSuite order (cash sale or sales order) flow > click on Post Orders to NetSuite mapping and add the Persist New Line Insertion Order field mapping as "true".
  • The order flow in the integration app does not support setting different default tax codes based on country. However, you can hardcode the HST or PST tax values to zero and club
    them under GST for collective reporting.

Order edit adjustments

The “Shopify Order to NetSuite Order/CashSale Add” flow performs the followings with below order edit adjustments:

Positive adjustments

  • This includes positive adjustments to the existing items or the addition of new items. 
  • The NetSuite sales order gets updated with the positive adjustments made to the existing items or the addition of new items. 
  • After positive adjustments, if the “Shopify Order Transaction to NetSuite Add '' flow is enabled, for the additional amount received, the transaction flow creates a custom transaction record in NetSuite.
  • If the “Shopify Transaction to NetSuite Customer Deposit Add” flow is enabled, for additional payments made, a customer deposit record is created and linked to the corresponding sales order. 
  • All the order components (such as taxes, discounts, etc) are recalculated with the latest advanced settings.

Negative adjustments

  • This includes negative adjustments to the existing item or deletion of existing items.
  • The NetSuite sales order gets updated with the negative adjustments to the existing item or deletion of existing items (provided the Items: Replace All Lines prerequisite above is satisfied).
  • When you run the “Shopify Refund to NetSuite Refund Add” flow, you can expect two refund records in NetSuite:
    • One customer refund record is created against the customer deposit for the refunded amount. 
    • Another refund record is an auto-generated refund that is created with a $0 amount to restock the inventory. 
  • All the order components (such as taxes, discounts, etc) are recalculated with the latest advanced settings.

Order editing scenarios

Scenario 1

When you sync the Shopify order in the Captured payment status and if the billing happens before fulfillment:

No_Color_Scenario1.png

  • For positive adjustments:
    • The sales order is updated with the order edit adjustments.
    • Note: Update the cash sale record manually.
  • For negative adjustments:
    • The sales order is updated with the order edit adjustments.
    • The cash sale is not updated. 
    • In this scenario, as the order is already billed, two refund records are created:
      • An auto-generated cash refund record with a $0 amount is created for restocking the inventory. 
      • Another cash refund record is created with the actual refund amount for the negative adjustments made to the order.

 Scenario 2

When you sync a Shopify order with Capture status and billing is after fulfillment:

No_Color_Scenario2.png

  • For positive adjustments:
    • The sales order is updated with the order edit adjustments.
    • An additional customer deposit record is created for the positive adjustments made to the order.
  • For negative adjustments:
    • The sales order is updated with the order edit adjustments.
    • In this scenario, as the order is adjusted before billing, restocking the inventory is not required. Only one customer refund record is created for the refunded amount.

Scenario 3

When you sync the Shopify order in the Authorize payment status:

No_Color_Scenario3.png

  • The sales order is updated with the order edit adjustments for positive adjustments.
  • For negative adjustments:
    • The sales order is updated with the order edit adjustments.
    • As the order is not billed and the payment is not captured, refund records are not created in this scenario. Also, the $0 refund record that is used to restock the inventory should be ignored. To achieve this, it is recommended to add the below mapping in the “Shopify Refund to NetSuite Refund Add” flow for the “NetSuite Refund Order Import Adaptor”, below the “Import Mappings”. If the mapping is set to “true”, the flow ignores to create the $0 refund record.
       

      Export Field (REST API Import Field (NetSuite)
      “true” ignoreOrderEditRefunds

Are the Shopify Payouts impacted by the order editing feature?

Previously, a corresponding record for payout transactions in NetSuite was tracked using the “order ID.” For a +ve payout transaction, we use to match the corresponding cash sale or customer deposit with the order ID. If there are multiple matches found, we used to consider the number of matches.

With the order editing feature, there might be more records for each order (be it +ve transactions or -ve transactions). So, instead of simply depending on the order ID, we’re introducing a transaction ID for all the records (cash sale, customer deposit, cash refund, or customer refund). We are modifying the saved search to do it via the “transaction ID”. 

  • There is no impact on the customer deposit flow, as there will be a different transaction record in NetSuite for each Shopify transaction.
  • For the cash sales flow, it is expected that you maintain a single record in NetSuite. For two transactions in Shopify, there is only one record in NetSuite, because of which Payouts will not behave as expected.

Example: If an order has 10$, and 20$ transactions in Shopify and in NetSuite, it is recorded as 30$ value. So, we’ll be marking 30$ as a deposit, and two variance transactions will be created:

  • Amount mismatch of 20$ for the first one
  • Missing transaction for -20$ for the second one.

In this scenario, the payout total will match the deposit total, but there will be variance transactions.

Common pitfalls

The following are common issues and their resolutions. If your issue matches one of the scenarios below, follow the recommended resolution.

Removed Shopify line items remain in NetSuite after re-sync

Symptom

You remove a line item from a Shopify order (and optionally add a different item). After the order is synchronized:

  • The new line item is added to the NetSuite sales order.
  • The removed line item remains on the sales order.
  • A variance line may also be created.

The Sync Shopify edited order data to NetSuite setting is already enabled.

Cause

The Items: Replace All Lines field mapping is either:

  • Missing, or
  • Configured as the text value "True" instead of the Boolean value true.

The integration treats "True" as a string rather than a Boolean, so the Replace All Lines instruction is ignored.

Resolution

  1. Open the Post Orders to NetSuite flow.
  2. Edit the field mappings.
  3. Locate Items: Replace All Lines.
  4. Click Settings.
  5. Set Field Type to Boolean.
  6. Select True from the value list.
  7. Save the mapping.
  8. Re-run the order synchronization.

After the order is re-synchronized, NetSuite removes the deleted line items and no longer creates variance lines for them.

Discount lines appear in the wrong order

Symptom

After synchronizing an edited Shopify order that adds a new item to an order containing discounted items, the line sequence in NetSuite is incorrect. Discount lines may appear out of order or no longer align with their associated items.

Cause

The Persist New Line Insertion Order field mapping is either:

  • Missing, or
  • Set to false.

Resolution

  1. Open the Post Orders to NetSuite flow.
  2. Add or edit the Persist New Line Insertion Order field mapping.
  3. Click Settings.
  4. Set Field Type to Boolean.
  5. Select True from the value list.
  6. Save the mapping.
  7. Re-run the order synchronization.

Edited Shopify orders don't synchronize

Symptom

The Sync Shopify edited order data to NetSuite setting is enabled, but updates made to Shopify orders never appear in NetSuite.

Cause

You're using the real-time Shopify order flow.

The real-time flow processes an order only when it is created. It doesn't process subsequent edits.

Resolution

Use the scheduled Shopify Order to NetSuite Order/Cash Sale Add flow to synchronize edited orders.

If you need both immediate order creation and edited-order synchronization:

  • Enable both the real-time and scheduled flows.
  • Configure field mappings in the real-time flow.

Important: The scheduled flow inherits its field mappings from the real-time flow. As a result, the mappings in the scheduled flow are read-only. To modify field mappings, update them in the real-time flow.