Articles in this section

Sync fulfillments between NetSuite and Shopify

The Fulfillment module syncs shipment and fulfillment data in both directions between NetSuite and Shopify. When warehouse staff create an Item Fulfillment record in NetSuite, the fulfillment flow posts the shipment, including tracking numbers and carrier information, to Shopify. When a fulfillment is created directly in Shopify (for example, by a third-party logistics provider), the Shopify-to-NetSuite fulfillment flow creates the corresponding Item Fulfillment record in NetSuite.

This template uses the GraphQL fulfillmentCreate mutation for all NetSuite-to-Shopify fulfillment creation, supporting multiple tracking numbers per shipment, split shipments across locations, and carriers not recognized by Shopify (via a tracking URL fallback).

Fulfillment_1.png

Flow 1: NetSuite fulfillment to Shopify fulfillment (add)

How the flow works

  1. Get fulfillments from NetSuite (Export): Uses the saved search customsearch_celigo_shopify_fulfillments to retrieve new Item Fulfillment records created in NetSuite since the last flow run. The saved search filters for fulfillments that have not yet been exported to Shopify (the eTail Fulfillment Exported checkbox is unchecked).

  2. Get fulfillment status from Shopify (Lookup): For each NetSuite fulfillment, checks the current displayFulfillmentStatus of the Shopify order using the GraphQL node(id) query. If the order is already fully fulfilled in Shopify, the fulfillment record is skipped to prevent duplicate fulfillments.

  3. Get assigned fulfillment orders from Shopify (Lookup): Retrieves the Shopify fulfillment order IDs and assigned locations for the order using the GraphQL fulfillmentOrders(query, first) query. These IDs are required by the fulfillmentCreate mutation to identify which fulfillment order lines are being fulfilled.

  4. Post location changes to Shopify (Import): Ensures the correct Shopify location is set for the fulfillment order before creating the fulfillment. This aligns the Shopify fulfillment location with any changes made in NetSuite (for example, if the fulfillment was reassigned to a different warehouse).

  5. Post fulfillment to Shopify (Import): Creates the fulfillment in Shopify using the fulfillmentCreate GraphQL mutation. The mutation includes:

    • Tracking numbers: If a NetSuite fulfillment has multiple tracking numbers separated by <BR> in the tracking number field, the script splits them into a trackingNumbers array and includes all numbers in a single fulfillment.

    • Carrier information: Maps the NetSuite carrier name to a recognized Shopify carrier. If the carrier is not recognized, the tracking URL is used as a fallback.

    • Location matching: Uses the Locations mapping (integration settings) to map the NetSuite location to the corresponding Shopify location.

    • Customer notification: Controlled by the Notify Customer setting (Fulfillment flow group). Default is false.

    After the fulfillment is posted successfully, the eTail Fulfillment Exported checkbox is checked on the NetSuite Item Fulfillment record to prevent the record from being picked up again.

  6. Mark fulfillment as exported in NetSuite (Import): Updates the NetSuite Item Fulfillment record to set the eTail Fulfillment Exported flag, preventing re-export on subsequent flow runs.

Exchange order fulfillments

When a fulfillment is created in NetSuite for an exchange order, the ShopifyOrderId field may contain a hyphen-separated suffix (for example, 1234567890-1 indicating the first exchange order). The pre-save script automatically strips the suffix before calling the fulfillmentCreate mutation, using only the base Shopify order ID.

Setting

Description

Notify Customer

When enabled, Shopify sends a fulfillment notification email to the customer when a new fulfillment is created. Default: disabled.

Locations mapping

Required. Maps NetSuite location to Shopify location. The fulfillment pre-save script uses this mapping to assign the correct Shopify location to each fulfillment line item.

Note

The saved search selected in Settings and the saved search configured in the Flow Builder Export step must be the same; both should reference customsearch_celigo_shopify_fulfillments. If they differ, the flow will either export records that should not be exported or miss eligible fulfillments.

Flow 2: Shopify fulfillment to NetSuite fulfillment (add)

How the flow works

  1. Get fulfilled orders from Shopify (Export): Uses the GraphQL orders query with displayFulfillmentStatus filter to find orders with recent fulfillment events since the last flow run (delta-based).

  2. Post order fulfillment to NetSuite (Import): Creates an Item Fulfillment record in NetSuite linked to the corresponding Sales Order, using the Shopify order ID cross-reference.

Known limitations
  • The flow skips Shopify orders that already have a displayFulfillmentStatus of FULFILLED to prevent duplicate fulfillments.

  • For fulfillments with more than 250 fulfillment order lines, the lookup query may not return all lines. Contact Celigo support if you regularly process large fulfillments.