Shopify B2B Purchase Orders & Net 30 Without Shopify Plus: Complete GraphQL Architecture

How to capture Purchase Order numbers, enforce atomic buyer credit limits, generate Net 15/30/60 orders via draftOrderCreate and draftOrderComplete, automate overdue dunning, and reconcile bank transfers on Shopify Basic, Grow, or Advanced plans.

Published November 30, 2026 · 11 min read · By André Théo Lauret (Eclipse Technology) · Verified against Shopify Admin GraphQL API 2025-10 / 2026

Direct answer

To run B2B Purchase Orders and Net 30/60 billing on Shopify Basic, Grow, or Advanced without paying for Shopify Plus, capture the PO reference through an Online Store 2.0 Cart App Block routed to an authenticated App Proxy. Lock the buyer credit row in SQL, create a draft order with paymentTerms via draftOrderCreate, call draftOrderComplete to reserve inventory as payment pending, and release credit automatically on orders/paid webhooks.

1. What non-Plus Shopify gives you (and what breaks in B2B)

Wholesale merchants on Shopify Basic, Grow, or Advanced face a recurring operational wall as soon as corporate accounts ask to pay by invoice. Procurement departments rarely put a 4,500 EUR restock order on a personal credit card. They send a Purchase Order reference (such as PO-2026-0418), expect Net 30 or Net 60 payment terms, require a PDF invoice showing their VAT number and PO reference, and settle by SEPA or ACH bank transfer.

Shopify Plus solves part of this natively through Company Profiles and B2B Checkout, but starts at roughly 2,300 USD per month on a multi-year contract. For an SMB doing 15,000 EUR to 120,000 EUR per month in wholesale volume, upgrading purely to capture PO numbers and Net 30 payment terms destroys margin. Meanwhile, trying to hack around standard checkout with manual payment methods ("Bank Deposit") introduces four production failures that finance teams discover only after a bad debt occurs:

If you want the credit-risk policy side of this problem in detail, read our companion guide on enforcing B2B credit limits and Net 30 dunning on Shopify without Plus. Below, we focus on the exact GraphQL, SQL, webhook, and accounting implementation required to run Purchase Orders reliably in production.

2. Architecture comparison: Manual Drafts vs Custom GraphQL vs Shopify Plus

Before writing code or installing an app, compare the three viable ways to operate Purchase Orders and Net Terms on Shopify in 2026. The right choice depends on order frequency, ERP integration depth, and whether your store already justifies a Shopify Plus license.

Capability Manual Bank Deposit + Admin Drafts OS 2.0 Cart Block + GraphQL API (Non-Plus) Shopify Plus Native B2B
Monthly platform cost Included in Basic / Grow / Advanced Basic / Grow / Advanced + app or private backend Starts around 2,300 USD / month
Mandatory PO capture Free-text cart note, easily skipped Validated PO input + buyer allowlist via App Proxy Native PO field inside B2B Checkout
Real-time inventory lock Only after staff manually completes draft Immediate via draftOrderComplete Immediate at checkout submission
Hard credit limit & overdue hold Manual spreadsheet check Atomic SQL row lock (FOR UPDATE) before order creation Not enforced natively without custom app or Flow
Automated dunning (J-3 to J+15) Manual emails from Shopify Admin Scheduled worker stopping immediately on orders/paid Requires Shopify Flow or third-party AR app
FEC / ERP double-entry export Manual reconciliation in accounting tool Native sequential invoices, credit notes, 18-column FEC Requires ERP connector or accounting app

3. End-to-end GraphQL workflow: Draft Order, Payment Terms, and Completion

On non-Plus plans, you cannot inject custom payment gateways into Shopify Checkout. Instead, the cleanest production architecture intercepts B2B buyers directly on the cart page via an Online Store 2.0 Theme App Block. When a logged-in customer tagged as an approved B2B buyer enters their Purchase Order number and selects "Pay by Invoice (Net 30)", the storefront block posts the active cart items and PO metadata to your backend through a signed Shopify App Proxy URL (/apps/net-terms/submit).

Your backend verifies the Shopify App Proxy HMAC signature, resolves the authenticated customer ID, runs the atomic credit check described in Section 4, and calls two verified Shopify Admin GraphQL mutations in sequence: draftOrderCreate (attaching the payment terms template and PO custom attributes) followed by draftOrderComplete (converting the draft into a live pending order and reserving stock).

Step 1: Verify required OAuth scopes and payment terms templates

Your Shopify app needs read_customers, write_draft_orders, write_orders, and write_payment_terms. Query paymentTermsTemplates once per store during installation and cache the returned global IDs (for example Net 15, Net 30, Net 60) rather than hardcoding numeric IDs across shops:

GraphQL (Shopify Admin API)Fetch store payment terms templates
query listPaymentTermsTemplates {
  paymentTermsTemplates {
    id
    name
    paymentTermsType
    dueInDays
    translatedName
  }
}

Step 2: Create the Draft Order with Purchase Order metadata and Net 30 terms

Pass the validated cart line items, the Shopify customer GID, the PO number inside customAttributes (and optionally poNumber / order metafields for ERP syncing), and the matching paymentTermsTemplateId. Always inspect userErrors before proceeding:

GraphQL (Shopify Admin API)draftOrderCreate with paymentTerms & PO attributes
mutation createB2bDraftOrder($input: DraftOrderInput!) {
  draftOrderCreate(input: $input) {
    draftOrder {
      id
      name
      totalPriceSet {
        shopMoney { amount currencyCode }
      }
      paymentTerms {
        id
        paymentSchedules(first: 5) {
          nodes {
            dueAt
            amount { amount currencyCode }
          }
        }
      }
    }
    userErrors {
      field
      message
    }
  }
}

Notice two subtle production details when building $input. First, recompute product prices and discounts from Shopify's authoritative variant catalog or cart token rather than trusting client-supplied unit prices from the browser. Second, include an idempotency token inside customAttributes (such as _eclipse_req_id) so retries caused by mobile network drops never spawn duplicate draft orders.

Step 3: Complete the Draft Order as Payment Pending

Once draftOrderCreate succeeds with an empty userErrors array, immediately invoke draftOrderComplete. Because payment terms are already attached to the draft order, Shopify transitions it into a real Order with displayFinancialStatus: PENDING, decrements available inventory immediately, and attaches the Net 30 payment schedule directly inside Shopify Admin:

GraphQL (Shopify Admin API)Convert draft order into a payment-pending live order
mutation completeB2bDraftOrder($id: ID!) {
  draftOrderComplete(id: $id) {
    draftOrder {
      id
      order {
        id
        name
        displayFinancialStatus
        totalPriceSet {
          shopMoney { amount currencyCode }
        }
        paymentTerms {
          id
          dueInDays
        }
      }
    }
    userErrors {
      field
      message
    }
  }
}

After draftOrderComplete returns the live order GID, clear the buyer's browser cart via POST /cart/clear.js and redirect them to a confirmation view displaying their Shopify order number, PO reference, due date, and downloadable PDF invoice with bank wire details (IBAN, BIC, and payment reference).

4. Atomic credit limits and double-submit protection in SQL

Most homegrown Net Terms integrations fail under concurrency. Imagine a buyer with a 3,000 EUR credit limit and 1,000 EUR already unpaid. They open two browser tabs or double-click the submit button on a 1,800 EUR cart. If your backend reads outstanding = 1000 in both requests before either writes back, both requests compute 1000 + 1800 <= 3000 and create 3,600 EUR of new exposure, pushing the account to 4,600 EUR.

The fix is standard transactional accounting: treat credit reservations as a two-phase ledger entry protected by a row lock and a unique idempotency key. Reserve exposure before calling Shopify, and either confirm the ledger row with the resulting Shopify order GID or roll back the reservation if Shopify rejects the draft order:

SQL (PostgreSQL)Atomic credit-limit reservation with overdue hold check
BEGIN;

-- 1. Lock the buyer credit account row to serialize concurrent submissions
SELECT credit_limit_cents,
       reserved_cents,
       overdue_invoice_count,
       is_blocked
FROM b2b_credit_accounts
WHERE shop_domain = $1
  AND shopify_customer_id = $2
FOR UPDATE;

-- 2. Application logic rejects immediately if:
--    is_blocked = TRUE
--    OR overdue_invoice_count > 0
--    OR (reserved_cents + $order_total_cents) > credit_limit_cents

-- 3. Insert idempotent reservation row (UNIQUE constraint on shop_domain + idempotency_key)
INSERT INTO b2b_credit_reservations (
  shop_domain, shopify_customer_id, idempotency_key,
  po_number, amount_cents, status
)
VALUES ($1, $2, $3, $4, $5, 'RESERVED');

-- 4. Increment reserved exposure atomically inside the same transaction
UPDATE b2b_credit_accounts
SET reserved_cents = reserved_cents + $5,
    updated_at = NOW()
WHERE shop_domain = $1
  AND shopify_customer_id = $2;

COMMIT;

Production failure recovery: Wrap the subsequent Shopify GraphQL calls in a deterministic reconciliation handler. If the network times out after draftOrderComplete, query recent orders by the idempotency attribute before releasing the reservation. Never blindly release a reservation on an HTTP timeout without verifying whether Shopify already created the order.

5. Webhook verification, bank reconciliation, and automated dunning

Issuing Net 30 orders is only half of the lifecycle. Without automated settlement tracking, credit limits remain artificially saturated long after buyers wire their funds, forcing staff to adjust balances by hand.

Wire up three Shopify webhooks in your backend: orders/paid, orders/cancelled, and refunds/create. Every incoming webhook must verify the X-Shopify-Hmac-Sha256 header against the raw request bytes before parsing JSON, and record X-Shopify-Webhook-Id in a deduplication table because Shopify delivers webhooks with at-least-once semantics:

Python (FastAPI / stdlib)Constant-time Shopify webhook HMAC verification
import base64
import hashlib
import hmac

def verify_shopify_webhook(raw_body: bytes, hmac_header: str, api_secret: str) -> bool:
    if not hmac_header or not api_secret:
        return False
    digest = hmac.new(
        api_secret.encode("utf-8"),
        raw_body,
        hashlib.sha256,
    ).digest()
    expected = base64.b64encode(digest).decode("ascii")
    return hmac.compare_digest(expected, hmac_header.strip())

Once verified, the settlement workflow stays deterministic:

  1. Bank transfer arrives: Finance matches the wire reference (invoice number or PO reference) and either marks the order paid inside Shopify Admin or triggers orderMarkAsPaid from an ERP bank-feed sync.
  2. Credit restores automatically: The orders/paid webhook marks the invoice PAID, decrements reserved_cents inside a transaction, and clears any overdue hold if zero past-due invoices remain.
  3. Dunning stops immediately: Before dispatching any scheduled reminder (typically J-3 courtesy notice, J+1 due-date reminder, J+7 escalation, and J+15 final hold warning), the worker re-checks the invoice state and live financial status so a buyer who paid two hours earlier never receives an awkward overdue email.

6. Sequential invoices, credit notes, and 18-column FEC accounting close

In France and across the European Union, B2B invoices follow strict immutability and numbering rules. A Shopify order name such as #1042 is not a compliant sequential accounting invoice sequence, especially if draft orders are deleted or mixed with retail B2C orders. Maintain a dedicated gap-free invoice counter (for example FAC-2026-0001) and a separate sequential credit-note counter (AV-2026-0001) whenever a partial or full refund occurs.

At month-end close, your accounting team needs structured double-entry lines rather than raw order summaries. Below is the standard French FEC (Fichier des Ecritures Comptables) mapping for a Net 30 invoice of 1,200.00 EUR TTC (1,000.00 EUR excl. tax + 200.00 EUR 20% VAT) carrying buyer reference PO-2026-0418:

JournalCode CompteNum PieceRef EcritureLib Debit Credit
VT 411000 FAC-2026-0148 Invoice FAC-2026-0148 - PO-2026-0418 (Client SAS) 1200,00 0,00
VT 707000 FAC-2026-0148 Wholesale Goods Net 30 - PO-2026-0418 0,00 1000,00
VT 445710 FAC-2026-0148 Collected VAT 20% - FAC-2026-0148 0,00 200,00

Every FEC export should enforce balanced journal entries (SUM(Debit) == SUM(Credit) per EcritureNum), French decimal commas when required by your accountant's software (Pennylane, Sage, Cegid, ACD), UTF-8 encoding without BOM surprises, and strict formula-injection neutralization (CWE-1236) on CSV exports whenever customer-controlled strings like PO numbers or company names are included.

If your team also runs self-hosted infrastructure alongside Shopify, our engineering hub covers related operational patterns, including our guide on removing Nextcloud duplicate files safely without breaking oc_filecache and our OS 2.0 Theme App Block setup guide for Shopify Net Terms.

7. Frequently asked questions

Can Shopify Basic, Grow, or Advanced stores accept B2B Purchase Orders with Net 30 terms without Shopify Plus?

Yes. Non-Plus Shopify plans do not include Shopify B2B Companies or Checkout UI Extensions for payment terms, but they expose the full Admin GraphQL API for draftOrderCreate, paymentTerms, draftOrderComplete, and orderMarkAsPaid. By capturing the Purchase Order number and buyer identity through an Online Store 2.0 Cart App Block and an authenticated App Proxy endpoint, your backend can reserve credit atomically and convert the cart into a payment-pending Shopify order with Net 15, Net 30, or Net 60 due dates.

Why does Shopify draftOrderComplete commit inventory immediately even when payment is pending?

When you call draftOrderComplete on a draft order carrying paymentTerms, Shopify creates a live Order with displayFinancialStatus set to PENDING and immediately allocates line-item inventory. This prevents overselling to retail buyers while waiting 30 or 60 days for a bank transfer, provided your credit-limit guard runs before draftOrderComplete is invoked.

How do you stop a B2B buyer from bypassing a credit limit with two simultaneous checkout tabs?

Never validate credit exposure with a loose read-then-write check in application memory. Store each buyer's credit_limit_cents and reserved_cents inside a relational database, lock the buyer row with SELECT ... FOR UPDATE inside a serializable transaction, verify reserved_cents + order_total_cents <= credit_limit_cents, increment reserved_cents with an idempotency key, and only then call draftOrderCreate and draftOrderComplete. If Shopify returns a userError, roll back the reservation.

Which Shopify webhook releases the buyer's credit exposure when a bank transfer clears?

Subscribe to orders/paid and orders/cancelled webhooks, verify the X-Shopify-Hmac-Sha256 header against your app secret using constant-time comparison, deduplicate using the X-Shopify-Webhook-Id header, and release the matching order's outstanding cents in your ledger. When a finance operator clicks Mark as paid in Shopify Admin or reconciles a SEPA transfer via orderMarkAsPaid, orders/paid fires automatically and restores the buyer's available credit.

What accounting fields are required to export Shopify Net Terms invoices into a French FEC or ERP ledger?

An audit-ready French FEC export requires 18 tab-separated or pipe-separated columns per journal entry, including JournalCode, EcritureNum, EcritureDate, CompteNum (411 customer receivable, 707 revenue, 44571 collected VAT), PieceRef (sequential invoice number), PieceDate, EcritureLib (including the buyer's Purchase Order reference), Debit, Credit, EcritureLet, DateLet, and ValidDate. Sequential credit notes must never overwrite an issued invoice; they post reversing entries tied to the original invoice reference.

Deploy Purchase Orders & Net 30 on Shopify in 10 minutes

Do not want to build and maintain your own App Proxy, atomic credit ledger, dunning worker, PDF invoice generator, and 18-column FEC exporter from scratch? Eclipse Net Terms & PO brings the entire architecture above to Shopify Basic, Grow, and Advanced stores via a zero-Liquid Online Store 2.0 Theme App Block.