How to Auto-Create NetSuite Invoices from E-commerce Orders

Generate NetSuite invoices automatically from orders across your stores.

What This Integration Does

If your finance team currently exports a CSV from Shopify each morning and hand-creates invoices in NetSuite, this workflow replaces that ritual. Every paid order in your store becomes a NetSuite invoice within seconds, with the correct customer, line items, tax, shipping, and tracking IDs.

The workflow listens for paid-order webhooks from your store. For each order it normalizes the payload, looks up or creates the matching NetSuite customer, builds the invoice record, and posts it. The result is a one-to-one relationship between store orders and NetSuite invoices that finance can trust.

Prerequisites

  • A Shopify (or WooCommerce) connection with read access to orders and customers.
  • A NetSuite connection with permission to create customers and invoices.
  • A NetSuite item record for each SKU you sell (or a generic catch-all item for unmapped products).

Step 1: Order Paid Webhook Trigger

Add a Trigger node set to Webhook. Register the resulting URL with your store as an orders/paid webhook. Spojit verifies the signature so spoofed payloads are rejected before any work runs.

Step 2: Fetch the Full Order

Webhook payloads sometimes omit fields you'll need (full tax breakdown, shipping address, line item options). Add a Connector node pointing at shopify using get-order with the order ID from the trigger to pull the full record.

Step 3: Look Up or Create the NetSuite Customer

Add a Connector node pointing at netsuite using run-suiteql:

SELECT id FROM customer WHERE email = '{{ order.email }}'

Branch on the result with a Condition. If a customer exists, capture the ID. If not, call netsuite create-customer with the order's billing details and capture the new ID.

Step 4: Transform Order Lines to NetSuite Invoice Items

Add a Transform node that maps each Shopify line item to a NetSuite item line. The mapping needs:

  • item: NetSuite internal ID looked up by SKU (use a Knowledge collection or a SuiteQL lookup).
  • quantity: line item quantity.
  • rate: unit price in the order currency.
  • amount: line total before tax.

Also flatten shipping into its own line and append a discount line if the order has a discount code.

Step 5: Create the Invoice

Add a Connector node pointing at netsuite using create-record with type invoice. Pass the customer ID, the item array, the tax total, the order's external ID for traceability, and the order's currency. NetSuite returns the new invoice ID, which you'll use in the next step.

Step 6: Stamp the Source Order and Notify

Add a Connector node pointing at shopify using update-order to write the NetSuite invoice ID into a metafield on the order. Then send a slack send-message to your finance channel summarizing the new invoice. On failure, route to the same channel with the error and stop.

Tips

  • For complex orders (split payments, multi-currency, gift cards), drop in an Agent step before the create. It can reason through edge cases and emit a clean invoice payload while the deterministic path handles 95% of orders.
  • Match Shopify SKUs to NetSuite items in a single Knowledge collection. It's faster to maintain than scattered if rules.
  • Send the invoice in NetSuite's account currency. Use Shopify's reported FX rate at the time of payment so reconciliation stays clean.

Common Pitfalls

  • Tax line mismatches. Shopify's tax model is line-level; NetSuite often configures tax at the invoice level. Pick one and stick to it before the first run.
  • Refunded orders triggering a duplicate paid event. Guard the workflow with a Condition that checks the order's financial status before creating.
  • Customer dedup. Email is not unique in NetSuite by default. If you allow duplicate emails, match on a stable external ID instead.

Testing

Place one real test order in Shopify, watch the run trace, and confirm the resulting NetSuite invoice line by line. Repeat with a discounted order, a multi-line order, and a gift card order before enabling the webhook for live traffic.

Learn More

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.