How I Built a Proper B2B Buying System for RKP

B2B trade portal for kart teams, with a humorous contrast between automated trade accounts and manual paperwork chaos.
B2B trade portal for kart teams, with a humorous contrast between automated trade accounts and manual paperwork chaos.

Most B2B ecommerce sounds simple until you try to make it behave like a real trade account.

For Rental Kart Parts, the requirement was not just “give trade customers a discount”. A customer needed to log in, belong to the correct company, see the correct market pricing, have permission to order for that company, and reach the right catalogue without somebody manually fixing it afterwards.

The problem

The old way was full of hand-offs: an application arrives, somebody checks it, somebody creates an account, somebody sets pricing, somebody fixes permissions, somebody discovers one field has mapped to the wrong place. Every extra hand-off is another place to forget something.

What we built

The flow now starts with trade approval and provisions the account into Shopify B2B. It creates or connects the customer, company, location and contact, assigns the ordering role, and routes the company into the correct market/catalogue setup.

The customer then uses passwordless login and lands in the buying experience intended for their business rather than a generic retail account.

What went wrong

Quite a lot, which is why this is in the Build Log.

  • One company-name mapping managed to use the wrong value entirely.
  • Contacts could exist but still not have the right to place orders.
  • Market and catalogue routing needed to be explicit rather than assumed.
  • GraphQL validation and API-token assumptions caused several trips down the wrong road.

The useful lesson was that “account created” is not the same as “account ready to buy”. The boring permissions and relationships are the actual product.

What worked

Once the full chain was treated as one system rather than a set of individual API calls, the end-to-end process became reliable. The storefront, trade approval flow and background provisioning now work together rather than leaving a human to stitch the pieces together.

Why it matters

Good B2B ecommerce should make the customer feel like nothing complicated happened. They log in, see their pricing and order. The complexity belongs behind the curtain.

That is the bit I like building: taking something that used to require a checklist and turning it into something the customer barely notices.

Steal the idea, not the secrets

Want to build your own version?

This is the public build brief: enough architecture to get moving, without the production-specific wiring that took the painful bit to discover.

Build a Shopify B2B onboarding workflow for trade customers.

Requirements:
- Start when a trade application is approved.
- Create or connect the customer to the correct company account.
- Assign a company location and ordering permission.
- Route the company to the correct market or catalogue.
- Use passwordless customer login where possible.
- Make the provisioning job idempotent so retries do not create duplicates.
- Run the heavy work in a background job and return quickly to the approval system.
- Log each provisioning step and surface failures for manual review.
- Add validation that checks the account is actually ready to order, not merely created.
- Test with dummy companies in a development store before touching production.

Do not hard-code customer pricing or production credentials. Keep market rules, field mappings and live account-routing logic configurable.

Back to Things I Built That Actually Worked