Designing a Hybrid B2B and B2C E-Commerce Backend

Shared catalog, different prices and approval rules: how one backend can serve distributors and retail customers.
Habbits Food sells to both distributors and individual customers. Running two separate stores would double the work, so the backend serves both from shared infrastructure.
One catalog, many price lists
Products are shared. Prices come from price lists attached to customer groups: retail, distributor, or a specific account. The API resolves the price for the signed-in customer at request time.
Accounts with roles
A B2B account is a company with several users: a buyer who places orders and an admin who approves them. B2C accounts are just a single user. Modeling both as organizations with members keeps the code paths the same.
Different checkout rules
- B2C pays immediately by card or cash on delivery.
- B2B may need minimum order quantities, approval steps or invoice payment terms.
- Both produce the same order document, so fulfillment and tracking do not care who bought.
Onboarding distributors
Distributor sign-ups go through an application and verification flow before they see wholesale prices. Automating the paperwork and approvals saves the sales team hours each week.
One admin command center
Admins see all orders, filterable by channel. Shared infrastructure means one place for reporting, stock and dispatch, instead of reconciling two systems.









