gmi.software
01 · Your app

Mobile apps

When the app is slow to change, crashes or nobody owns it.

  • Develop or take over an app
  • Loyalty apps
  • Mobile app code audit
  • App maintenance and releases

SFD: 100,000+ downloads, 4.9 App Store rating

02 · Your shop

Online shops

When the platform takes a cut of every sale or blocks what you need.

  • Online shop development
  • Shop app analytics
  • Plan and prototype before you build

120+ projects delivered

03 · Systems behind them

Integrations

When orders, stock and points are copied by hand.

  • ERP, warehouse and payments
  • AI for one manual process
  • Workshops and estimate

100+ integrations

Before a call
  • App cost estimateScope and a budget range
  • Shop platform adviserDecisions, risks and options
  • Shop cost over 5 yearsOff-the-shelf or custom, compared

After workshops: an agreed scope and a fixed price for delivering it

All services →
SFDLoyalty and shopping app100,000+ downloads · 4.9 App Store ratingMój Świat KsiążkiLoyalty programme for a bookstore chain100,000+ downloadsEMKAMedical waste tracking app5000+ downloads in first month
All 120+ projects →App ideas library
TeamAbout usWho we are and how we workCareersHow we work and open roles
Contact and stackContact[email protected]TechnologiesReact Native, MedusaJS, Node.js and the rest
Reviews5.0 on Google4.9 on ClutchClutch ↗ (opens in a new tab)
Blog
ENBook a free consultation
What we do+−

01 · Your app

Mobile apps

  • Develop or take over an app
  • Loyalty apps
  • Mobile app code audit
  • App maintenance and releases

02 · Your shop

Online shops

  • Online shop development
  • Shop app analytics
  • Plan and prototype before you build

03 · Systems behind them

Integrations

  • ERP, warehouse and payments
  • AI for one manual process
  • Workshops and estimate

Before a call

  • App cost estimateScope and a budget range
  • Shop platform adviserDecisions, risks and options
  • Shop cost over 5 yearsOff-the-shelf or custom, compared
All services →
Projects+−
  • SFD100,000+ downloads · 4.9 App Store rating
  • Mój Świat Książki100,000+ downloads
  • EMKA5000+ downloads in first month
  • All 120+ projects →
  • App ideas library
Company+−
  • About usWho we are and how we work
  • CareersHow we work and open roles
  • Contact[email protected]
  • TechnologiesReact Native, MedusaJS, Node.js and the rest
Blog→
Book a free consultation

5.0 on Google · 4.9 on Clutch

Back to blog
Services
Updated: July 11, 2026· Originally published: March 4, 2026
22 min read

B2B ecommerce trade credit: how to connect checkout with ERP, limits and invoices

A practical guide for CTOs, CFOs and ecommerce leads: how to model credit exposure, limit reservations, net terms, ERP reconciliation, MedusaJS, NestJS and B2B checkout without blocking sales.

Mikołaj Lehman, CEO & Founder, GMI Software
Mikołaj Lehman
CEO & Founder, GMI Software

In brief

Short answer: trade credit in B2B ecommerce should be a payment method backed by an exposure ledger, not a simple "pay by invoice" checkbox. The storefront must know customer limit, utilization, overdue invoices, reservations from open carts, orders in fulfilment and ERP blocking rules. Otherwise you either block good buyers or ship goods above the agreed limit.

Short answer: trade credit in B2B ecommerce should be a payment method backed by an exposure ledger, not a simple "pay by invoice" checkbox. The storefront must know customer limit, utilization, overdue invoices, reservations from open carts, orders in fulfilment and ERP blocking rules. Otherwise you either block good buyers or ship goods above the agreed limit.

The problem: the B2B buyer has a limit, but the store only sees a cart

"Pay later" in B2B is not a convenient version of card payment. It is a credit and operations decision. A buyer can have a PLN 150,000 limit, Net 30 terms, open invoices, partial payments, orders in fulfilment, manual finance blocks, different limits per branch and special rules for specific categories.

If the storefront only sees the current cart, it makes the wrong decision. It can block a buyer who paid an invoice in the morning but the ERP balance has not synchronized yet. It can also accept an order even though the buyer already has three open orders and will exceed the limit once they ship.

Good B2B trade credit does not query ERP on every click and does not blindly trust cache. It builds an exposure layer: limit, utilization, reservations, holds, orders, adjustments, payments and invoice statuses. Only that layer should tell checkout whether to continue, require approval, reduce the cart or route the buyer to sales.

What is trade credit in B2B ecommerce?

Trade credit is the ability to place an order now and pay later based on an agreed limit and payment term, for example Net 14, Net 30 or Net 60. In a B2B store it appears as a payment method, but its logic belongs to finance, risk and ERP.

The key difference from consumer BNPL: B2B is usually not about a one-off consumer installment. It is a commercial relationship with contract limits, invoices, company accounts, branches, order approval and accounting reconciliation. It must be auditable.

In practice, the storefront should answer one question: "how much real available limit does this buyer have now, for this cart, this branch and this delivery date?". If the answer is "we do not know", automation is mostly theatre.

Architecture map: exposure ledger between checkout and ERP

The safest pattern is not a direct checkout-to-ERP call on every render. The pattern is an exposure ledger: a transactional layer that syncs ERP data, reserves limit at cart and order time, releases holds on cancellation, adjusts exposure after invoicing and reconciles payments.

The diagram shows the minimum domains: buyer account, credit policy, exposure ledger, ERP/AR sync, order hold, invoice/payment reconciliation and override flow for finance or sales. Checkout stays fast, while the credit decision has an audit trail.

Article graphic: B2B ecommerce trade credit: ERP, limits, invoices and risk
Article graphic: B2B ecommerce trade credit: ERP, limits, invoices and risk

What must come from ERP, and what should not be synchronous?

ERP is the system of truth for receivables, invoices, payments and finance blocks. It is not always a good system for checkout traffic. Older SAP, Comarch, Microsoft Dynamics, enova, Subiekt or custom ERP deployments can have API limits, slow reports and posting windows.

The useful ERP data includes customer account, credit limit, payment terms, overdue amount, open invoices, unapplied payments, credit memo, manual blocks, branch hierarchy and invoice status. The store should not ask ERP for all of that on every mini-cart open.

A safer model is event sync plus scheduled refresh: payment posted, invoice issued, credit note, order shipped, order cancelled, limit changed, customer blocked. Checkout uses a fresh projection, and high-value carts can trigger an additional verification before final submit.

Limit reservation: the moment most builds forget to design

Credit limit should not be checked only when the buyer clicks "place order". In B2B, a buyer can work on a cart for several days, and multiple employees from the same company can create parallel carts. Without reservation, two orders can look valid separately and exceed exposure together.

A good build separates soft hold and hard hold. A soft hold can reserve limit for an active cart for a short time. A hard hold is created after order submit and lasts until cancellation, rejection, invoicing or shipment. Every hold needs expiration, owner, source and relationship to the order.

This is where idempotency keys and backend transactions matter. If the buyer double-clicks, the API must not reserve the limit twice. If ERP responds late, the system must know whether the order is accepted, pending approval, blocked or needs finance review.

MedusaJS, NestJS and Next.js: responsibility boundaries

The Medusa Cart Module provides cart management, addresses, line items, shipping methods, adjustments, tax lines and cart scoping to sales channel, region and customer. The Payment Module handles authorize, capture, refund, payment collections, payment providers and webhook events. That is a strong foundation, but trade credit needs custom domain rules.

At GMI we usually do not put exposure rules inside React components. Next.js shows limit status and checkout path. MedusaJS keeps the commerce core. NestJS or a domain module handles credit policy, exposure ledger, ERP adapters, approval workflow, idempotency, retry policy and audit log.

This split helps later with mobile commerce. React Native/Expo can use the same endpoints: `getAvailableCredit`, `reserveCredit`, `releaseHold`, `submitForApproval`, `confirmInvoicePayment`. You do not build a second credit engine for the mobile app.

Invoices, net terms and reconciliation

Trade credit does not end when the order is accepted. After checkout comes the cycle: order accepted, shipment, invoice issued, payment due, reminder, partial payment, credit note, dispute, overdue block and reconciliation. Each state can change available credit.

If you use Stripe Invoicing or a similar invoicing layer, keep payment terms separate from the credit decision. An invoice can have `collection_method=send_invoice`, payment due date and credit notes, but the commerce system still needs to know whether the buyer may place another order before paying the previous one.

Reconciliation should compare at least four sources: storefront order, exposure ledger, ERP accounts receivable and payment/invoicing provider. Without this, finance exports CSV files and manually explains why the store showed PLN 40,000 available while ERP blocked the account.

Buyer UX: do not show only a red error

The worst UX is "credit limit exceeded, contact sales". A B2B buyer needs operational information: available limit, used exposure, overdue invoices, missing amount, partial payment option, approval flow or account-manager contact with cart context.

A strong checkout shows three paths: the order fits the limit and continues, the order requires approval, or the order needs payment change or cart reduction. Larger accounts also need PO number, cost center, buyer role, branch selection and downloadable documents.

This matters especially on mobile. If the React Native app shows a simplified message without invoices and limit context, the buyer will still call sales. Automation merely moved the problem from checkout to support.

How GMI designs trade credit before development

In DDT we start with finance, sales, operations and IT in the room. We map customer types, limits, payment terms, blocks, invoices, credit notes, returns, approval, ERP API, posting windows, integration SLA and failure scenarios. Without finance at the table, trade credit only looks easy in mockups.

A typical stack is MedusaJS as headless commerce core, Next.js storefront, NestJS for exposure ledger and integrations, PostgreSQL for transactional records, Redis/queues for sync and retry, ERP/PIM/WMS and a payment/invoicing provider. If mobile is an ordering channel, we add React Native/Expo on the same API contracts.

After DDT we can discuss fixed price because the risks are known: ERP data quality, API availability, credit-policy rules, approval flow, reconciliation, observability, account migration and handover. The client keeps source code, documentation and architecture without vendor lock-in.

Checklist before automating trade credit

Use this list before choosing a platform or integrator. Without these answers, the project may work in the happy path and fail at the first partial payment, overnight posting window or invoice dispute.

  • Which system is the truth for credit limit, overdue invoices, open orders and manual blocks?
  • Is the limit per company, branch, buyer role, currency, region or sales channel?
  • When do we reserve limit: cart, submit order, approval, shipment or invoice?
  • How do we release holds on cancellation, partial shipment, return or credit note?
  • How do we handle partial payment, credit note, dispute, overdue block and sales override?
  • How often do we sync ERP, and what happens when ERP is unavailable?
  • Which statuses do we show buyers instead of a plain "limit exceeded"?
  • How does reconciliation compare storefront, exposure ledger, ERP and invoicing provider?

Sources and further reading

Medusa Cart Module - cart management, tax lines, adjustments, cart scoping and workflows: https://docs.medusajs.com/resources/commerce-modules/cart

Medusa Payment Module - authorize, capture, refund, payment collections, providers and webhooks: https://docs.medusajs.com/resources/commerce-modules/payment

Medusa storefront development - storefront as separate application and API/SDK integration: https://docs.medusajs.com/resources/storefront-development

Stripe API - create invoice, send_invoice collection method and invoice due fields: https://docs.stripe.com/api/invoices/create

Stripe API - idempotent requests for safe retries: https://docs.stripe.com/api/idempotent_requests

Related GMI guide on Medusa B2B ecommerce: https://gmi.software/blog/medusa-b2b-ecommerce-guide

Related GMI guide on Next.js commerce production patterns: https://gmi.software/blog/nextjs-commerce-production-patterns-2026

Frequently asked questions

What is trade credit in B2B ecommerce?
It is the ability to place an order now and pay later based on a limit and payment term, for example Net 30. In the store it behaves like a payment method, but technically it needs credit policy, exposure ledger, invoices, ERP reconciliation and decision audit.
Why must a B2B store integrate with ERP?
ERP is usually the system of truth for receivables, invoices, payments, blocks and limits. Without integration, the store cannot know whether the buyer has overdue invoices, available limit, partial payment or a manual finance block. Deferred orders fall back to manual review.
Should the store ask ERP for credit limit on every click?
Usually no. A better model is ERP event sync, local exposure ledger and final verification for risky or high-value carts. Checkout stays fast while credit decisions still use finance data.
Why does MedusaJS make sense for B2B trade credit?
MedusaJS gives a modular commerce core for cart, payments, providers, webhooks and workflows. Trade credit can be added as a custom domain layer instead of forcing finance rules into a closed SaaS checkout or React components.
How does credit-limit reservation work in a B2B cart?
The system creates a soft hold for an active cart or a hard hold after order submit, so parallel carts from the same company do not exceed the limit. A hold should have expiration, owner, reason, order relationship and release rules for cancellation, invoicing or return.
What does DDT clarify before implementing trade credit?
DDT aligns credit policy, ERP data sources, approval flow, limit reservations, reconciliation, UX statuses and failure scenarios before estimation. Only after that discovery can we responsibly discuss fixed price and implementation scope.

Content updated: July 11, 2026

Mikołaj Lehman, CEO & Founder, GMI Software
Mikołaj Lehman
CEO & Founder, GMI Software

Mikołaj Lehman is the CEO and founder of GMI Software. On the blog, he covers decisions around mobile apps, ecommerce and digital product delivery.

  • Mobile apps and React Native
  • Headless and B2B ecommerce
  • MedusaJS
  • Digital product delivery

Google Preferred Sources

See GMI more often in Google

Add gmi.software as a preferred source. Google may highlight our new articles more often in Top Stories and supported AI experiences.

Share article:

Related articles

Services

React Native app store launch checklist for App Store and Google Play

A practical React Native and Expo release checklist: developer accounts, EAS Build/Submit, TestFlight, Google Play closed testing, privacy, payments, reviewer access and rejection recovery.

→
Services

CPQ for manufacturing and B2B ecommerce: pitfalls, architecture and cost

A practical CPQ guide for manufacturers: where configuration rules should live, how to connect BOM, ERP, pricing, 3D and B2B storefronts, and when MedusaJS + NestJS makes sense.

→

Let’s discuss your project.

Tell us what you need. We’ll suggest the next step.

[email protected]
gmi.software Sp. z o.o.ul. Jana Heweliusza 11 / 819
80-890 Gdansk, Poland
Rated 5.0 out of 5 on Google5.017 client reviews on Google
TechnologiesReact NativeExpoNext.jsReactTypeScriptMedusaJS3D configuratorsNode.jsNestJSPostgreSQLDockerAWSPlaywrightMaestro
© 2026 gmi.software Sp. z o.o.
Privacy PolicyTerms