B2B wholesale · Sales ops
How we designed a rep portal, territory rules and an append-only commission ledger on top of Shopify's native B2B, built so the numbers stay correct after refunds and edits.
Shopify's native B2B gives wholesale brands companies, contracted price lists and payment terms. It doesn't give them a way to run a sales team. Reps email spreadsheets that someone re-keys as draft orders. Commissions get recalculated in Excel at the start of each month, and they're wrong whenever an order is refunded or edited after the fact. Giving a contractor rep a Shopify staff account exposes the whole admin and still offers no territories, commissions or payouts.
The alternatives we looked at either handled rep ordering with no commission engine, or were separate enterprise platforms with long integrations. We wanted one native app that covered the whole loop: rep portal, ordering on behalf of accounts at contracted pricing, territories, commission rules, a ledger and payouts.
Commission software touches people's pay, so the hardest requirement was correctness. The ledger had to reach the right total after any sequence of payments, partial refunds, edits and cancellations, including refunds that arrive after a rep has been paid. RepHub is pre-launch, so this is a story about how we built it, not about results. It uses the same skills as our internal tools work.
We built sales rep commission automation around a reconcile-to-target model. Whenever an order changes, RepHub re-fetches it from Shopify instead of trusting the webhook payload, works out what the total commission should now be, and writes the difference as a new typed ledger row: Earned, Reversal, Adjustment or Clawback. Amounts are never edited in place. Each entry records the rule that produced it, and property-based tests check that the ledger reconciles after any sequence of refunds, edits and cancellations. Duplicate webhooks and replayed jobs can't double-pay.
The rules had to match how real sales teams are paid. The builder supports five scope levels (shop, rep, company, collection, product), percentage, flat-per-order, flat-per-unit and tiered rates, splits that must total 100%, effective dates and a fixed precedence order. A "test an order" dry run shows which rule wins on every line without writing anything.
Reps get a separate mobile web portal they can install on a phone, with passwordless login by code or magic link. They see only their assigned companies and browse a locally cached catalog at each account's contracted price. When they place an order, Shopify calculates it, payment terms included, before anything is created. Territories assign new companies to the least-loaded rep by country, state, ZIP prefix or tag, and manual assignments always win. Payouts move from draft to finalized to paid, with printable statements. More on the RepHub page.
RepHub today runs inside Shopify admin for the merchant and as a separate portal for reps. Merchants get a dashboard with rep sales and unpaid commission liability, and a filterable ledger with approvals, voids and manual adjustments. Payout runs hold back reps with zero or negative balances instead of invoicing them, and statements print to PDF. On non-Plus plans, RepHub applies contract pricing through its own price lists with CSV import. On Plus, it uses native company catalogs. Shopify Flow triggers, an order-page block, order tags, CSV exports and a weekly digest connect it to the rest of the store.
RepHub hasn't launched yet, so we make no claims about results for users. We can share what building it taught us. First, money software should be append-only: correcting with new rows makes every number traceable. Second, re-reading the source of truth costs a few API calls and removes a whole class of bugs. Third, adoption is decided by the rep on a phone at a trade show, so the portal had to be fast and simple. These lessons apply to most reporting automation and payout projects. Have a commission spreadsheet you want to retire? Start a project.
How it's built
Every order change recomputes what the commission should be and writes the difference, so refunds, edits and cancellations end at the right total.
Amounts are never overwritten. Corrections are new Reversal, Adjustment or Clawback rows that record the rule that produced them.
Orders are re-fetched from Shopify before commission is calculated, and duplicate deliveries or retries can't double-pay.
Reps sign in without passwords, see only their own accounts and order at contracted prices without using Shopify staff seats.
"Test an order" shows which rule wins on each line and what each rep would earn before anything touches the ledger.
Lessons
Commissions, rebates, bonuses and partner payouts all share the same traps, and most of them only show up months later. Here's what we'd tell a client automating any of them.
We build this kind of system as a custom Shopify app or as a standalone tool connected to your CRM and accounting software, such as HubSpot, Xero or QuickBooks.
Live product · Shopify
RepHub
How we designed a Shopify app that syncs supplier stock and prices from any file or API, shows a diff before writing, and refuses to import files it doesn't trust.
Read the storyHow we turned a Google Form, a serial-number spreadsheet and a claims inbox into one Shopify app that registers units, issues coverage and resolves claims with real Shopify objects.
Read the storyHow we built a deterministic, explainable rules engine that scores Shopify return and refund requests, shows the reasons behind every score, and never declines a customer automatically.
Read the storyTell us how it works today. We'll tell you honestly what's worth automating, what it would take, and what it would cost.