← All posts NetSuite & ERP 3 min read

B2B WooCommerce Customer Portal with NetSuite: Syncing Invoices, Credit Limits, and Order History

How to build a B2B WooCommerce customer portal that syncs invoices, credit limits, account-specific pricing, and full order history from NetSuite in real time.

Quick Summary

B2B WooCommerce Customer Portal with NetSuite — Syncing Invoices, Credit Limits, and Order History

  • A B2B customer portal in WooCommerce allows wholesale buyers to view their open invoices, credit balance, and order history — data that lives in NetSuite, not WooCommerce.
  • The portal requires a real-time (or near-real-time) read path from NetSuite to WooCommerce — not the scheduled sync used for inventory.
  • Credit limit enforcement must happen at cart/checkout in WooCommerce, but the credit data lives in NetSuite — requiring a synchronous API call at checkout time.
  • Invoice payment via the portal means WooCommerce processing a payment and then writing the receipt back to NetSuite against the correct Invoice record.
Real-time read
Required for portal data — scheduled sync is too slow for invoice/credit display
Checkout check
Where credit limit enforcement happens — synchronous NetSuite call at cart submission
Receipt
What writes back to NetSuite after portal payment — applied against the open Invoice record
RESTlet
The NetSuite interface for portal data reads — one call, aggregated customer data

A self-service B2B portal in WooCommerce is one of the highest-value use cases for NetSuite integration. Wholesale buyers can log in, see their account standing, view open invoices, pay outstanding balances, and place new orders — all without emailing or calling your sales team. The technical challenge is that all the financial data (invoices, credit, payment history) lives in NetSuite, while the UI and payment processing happen in WooCommerce.

Portal Data Architecture

B2B Portal Data Flow
  WooCommerce B2B Portal (customer logged in)
  │
  ├── My Invoices page
  │   └── RESTlet: GET /customer/{id}/invoices
  │       → NetSuite returns: open invoices, amounts, due dates
  │
  ├── Account Overview widget
  │   └── RESTlet: GET /customer/{id}/account
  │       → NetSuite returns: credit limit, credit used, available
  │
  ├── Order History page
  │   └── WooCommerce orders (local) + NetSuite SOs (via RESTlet)
  │
  └── Pay Invoice (payment gateway)
      └── On payment success:
          POST to RESTlet: apply payment to NetSuite Invoice
          → creates Customer Payment record in NetSuite
          → marks Invoice as Paid or Partially Paid

Credit Limit Enforcement at Checkout

When a B2B customer places a new order, WooCommerce must check whether the order total would exceed their available credit in NetSuite before allowing checkout to complete. This requires a synchronous API call during WooCommerce’s checkout validation — not a cached value from a previous sync.

Cache carefullyCredit limit data can be cached with a short TTL — but not too long:

Making a live NetSuite API call on every cart page load is too slow (adds 800–1500ms). Cache the credit data per customer for 5 minutes in WooCommerce transients. Make a fresh call only at the moment of checkout order submission. A 5-minute cache means a customer whose credit limit was just reduced by a payment received during their session may get a stale value — acceptable for most B2B use cases.

Invoice Payment Write-Back

When a customer pays an invoice through the portal, the payment flow is: WooCommerce processes the card via Stripe/PayPal → WooCommerce order is created as “paid” → your integration creates a NetSuite Customer Payment record linked to the specific open Invoice → the Invoice is marked fully or partially paid. The critical data to pass: Invoice internal ID (the NetSuite record being paid), payment method, payment date, and exact amount. Do not round the amount — partial payments must match to the cent.

Sources & Further Reading

References

  1. SuiteScript RESTlet for Data AggregationOracle NetSuite Help — RESTlet framework used to return aggregated customer financial data in a single call.
  2. WooCommerce Payment Gateway APIWooCommerce.com — payment processing API that triggers the NetSuite payment write-back on successful payment.
  3. NetSuite Customer Payment RecordOracle NetSuite Help — Customer Payment record creation via SuiteScript for invoice payment write-back.
Discussion

Leave a Reply

Your email address will not be published. Required fields are marked *


Ship it

Need this in your stack?

We build, integrate, and ship — no calls, just delivery.

Start a project →