Articles in this section

Sync billing and payment between NetSuite and Shopify

The Billing module automates the generation of invoices and cash sales in NetSuite for orders imported from Shopify, and then syncs the billing confirmation back to Shopify to trigger payment capture. The module contains two flows:

  • NetSuite sales order to NetSuite invoice or cash sale (add): auto-billing: converts sales orders to invoices or cash sales in NetSuite

  • NetSuite billing to Shopify billing (add): billing export: syncs billing confirmation from NetSuite to Shopify and triggers Shopify payment capture

Note

These flows do not support partially billed orders. Enable billing flows only after the order and fulfillment flows are verified and stable.

A3.png

Flow 1: NetSuite sales order to NetSuite invoice or cash sale (add)

This is an internal NetSuite flow that automatically converts qualifying sales orders to invoices or cash sales. Once enabled, you no longer need to manually bill orders in NetSuite.

How the flow works
  • Post invoice to NetSuite (Import): The Sales Order has payment terms set (the terms field is populated). Used for customers with net-30, net-60, or other deferred payment terms.

  • Post cash sale to NetSuite (Import): The Sales Order has no payment terms (the terms field is empty). Used for orders with immediate payment.

  1. Get orders pending billing from NetSuite (Export): Uses saved search customsearch_celigo_shopify_orders_billi to retrieve Sales Orders whose status matches the configured trigger (Pending Billing or Pending Fulfillment). After auto-billing is processed, the eTail Order Auto Billing Exported checkbox is checked on the Sales Order, preventing re-processing even if the billing creation errored. If the flow errors, resolve all errors before re-running.

  2. Auto-Billing Router:  Invoice or Cash Sale

Flow 2: NetSuite billing to Shopify billing (add)

This flow exports billing confirmation from NetSuite (for orders that have been billed, invoiced, or cash sale created) to Shopify and triggers Shopify payment capture for orders imported with "authorized" financial status.

How the flow works
  • Invoice: The billing transaction type is invoice. Posts the invoice reference to Shopify.

  • Cash Sale: The billing transaction type is cashsale. Triggers Shopify payment capture and posts the capture ID back to NetSuite.

  1. Get billing records from NetSuite (Export): Uses saved search customsearch_celigo_shopify_billing_expo to find Sales Orders with status Billed where the eTail Order Billing Exported checkbox is unchecked.

  2. Get order amount from Shopify (Lookup): Uses the GraphQL order(id).totalPriceSet { shopMoney, presentmentMoney } query to retrieve the Shopify order total. The postResponseMap script compares the Shopify total against the NetSuite billing total to determine whether this is a full billing or partial billing scenario.

  3. Post order capture to Shopify (Import): Uses a GraphQL mutation via an HTTP POST request to capture payments for Shopify orders. Dynamically maps source data, processes each record individually, and extracts the transaction ID from the response for tracking and captures errors. 

  4. Post capture ID to NetSuite (Import): Billing Export Router for invoice or cash sale (first matching branch)

After the billing is exported, the eTail Order Billing Exported checkbox is checked on the NetSuite Sales Order. For orders already captured in Shopify (orders not imported as "authorized"), this checkbox is checked on import, and the flow skips them automatically.

Map payment methods

Shopify payment gateways (for example, "shopify_payments", "paypal", "stripe") must be mapped to NetSuite Payment Method records.

A4.png

To configure payment method mapping:

  1. In the integration tile, go to Settings > Order > Payment.

  2. Locate the Payment methods mapping table.

  3. For each Shopify payment gateway, enter the corresponding NetSuite Payment Method internal ID.

  4. Configure a Default Lookup Value (defaultPaymentMethod) for unmatched gateways.

  5. Click Save.

Note

Payment gateway names in Shopify are lowercase and may include underscores (for example, shopify_payments, gift_card). Check the exact gateway name in your Shopify order data before configuring the mapping.

Common billing issues and resolutions

Billing flow picks up the same order multiple times

The eTail Order Auto Billing Exported checkbox is checked after the first auto-billing attempt, regardless of whether it succeeded or errored. If a billing creation errored, the order appears in the flow's error bubble. Resolve the error and retry from the error bubble. Do not uncheck the checkbox manually, as this may cause double-billing.

Payment not captured in Shopify after billing flow runs

The billing-to-Shopify flow only triggers Shopify payment capture for orders imported with "authorized" financial status. For orders already captured (financial status PAID), the flow marks the billing as exported without triggering a new capture.