Marketplace & Payments

Multi-Vendor Marketplace — Payments, Roles & Scalable Architecture

Role-Permission System · Multi-Gateway Payments · Concurrent Vendor Operations

Laravel Stripe PayPal Role-Based Access Eloquent ORM
Client
Confidential
Product Type
Multi-Vendor Gaming Marketplace
Payment Gateways
3 — Stripe, PayPal, Manual
Engagement
External Technical Partner

Executive Summary

A multi-vendor marketplace for buying and selling video games needed a backend that could support many vendors operating simultaneously — listing games, fulfilling orders, and getting paid — without permission logic or payment failures getting in the way of a sale.

We built a flexible role-permission system covering vendors, admins, and support staff, and a multi-gateway payment architecture spanning Stripe, PayPal, and manual settlement — so a failure in one payment path never means a lost sale.

Business Problem

Running a marketplace with many independent vendors introduces problems that a single-seller storefront never has to solve.

Permissions didn't match how vendors actually operate

A single generic "vendor" role couldn't express the difference between a solo seller, a team account with multiple staff, and platform admins who needed oversight without full control.

Payments were a single point of failure

Relying on one payment gateway meant that a gateway outage, a declined card, or a region the gateway didn't support could block a sale entirely — with no fallback path.

Concurrent vendor activity caused contention

With many vendors updating listings, inventory, and orders at the same time, naive locking and update patterns created race conditions and occasional overselling.

Payout logic was fragmented

Tracking what each vendor was owed, across multiple payment methods and order states, required manual reconciliation rather than a single source of truth.

Solution Overview

We designed the backend around two core systems: a permission structure that reflects the marketplace's actual vendor hierarchy, and a payment layer that treats gateway failure as an expected case to handle, not an edge case to ignore.

The system supports four roles

Vendor Owners — Full control of their own listings, orders, staff accounts, and payout settings
Vendor Staff — Scoped access to fulfil orders and manage listings without touching payout or account settings
Marketplace Admins — Oversight across all vendors — dispute resolution, listing moderation, payout approval
Buyers — Standard purchasing flow with gateway choice at checkout

Key Features Delivered

1 Role-Permission System

Granular permission sets — Permissions are assigned per capability — manage listings, fulfil orders, view payouts, manage staff — not bundled into one fixed role
Vendor-scoped staff accounts — Vendor owners can add staff with exactly the access they need, without giving up control of payout or account settings
Admin oversight without overreach — Marketplace admins get visibility and moderation tools across all vendors without being able to directly alter a vendor's financial settings

2 Multi-Gateway Payment Architecture

Flow

Stripe attempt
Decline / unsupported
PayPal fallback
Manual settlement
Stripe as primary gateway — Standard card payments processed through Stripe for the majority of transactions
PayPal fallback — Buyers whose cards are declined or unsupported can complete checkout through PayPal without losing their cart
Manual settlement path — For regions or payment types neither gateway covers, a manual settlement flow keeps the sale recorded and reconcilable
Single payout ledger — Regardless of which gateway processed the sale, every transaction feeds one payout ledger per vendor

3 Concurrent Vendor Operations

Contention-safe inventory updates — Listing and inventory writes use row-level locking so simultaneous updates from a vendor's own staff never overwrite each other
Order-safe stock decrements — Stock is decremented atomically at order time, preventing overselling when multiple buyers purchase the same limited item at once
Vendor dashboard performance — Vendor-facing dashboards are scoped and indexed so a marketplace with many vendors doesn't slow down any individual vendor's view

Operational Improvements

Sales no longer die at checkout

A declined card or unsupported region no longer means a lost sale — the fallback gateway path picks it up automatically.

Vendor teams work without stepping on each other

Vendor owners can bring on staff with exactly the access needed, and simultaneous updates from a vendor's team no longer clash.

Overselling is no longer possible

Atomic stock decrements at order time mean limited-quantity items can't be sold twice, even under a traffic spike.

Payouts are a single source of truth

Every vendor's earnings, across every gateway, live in one ledger — no more manual reconciliation across three payment systems.

Technical Approach

Permissions as Composable Capabilities

Rather than a fixed set of roles, permissions are modeled as individual capabilities that get composed into roles. This meant vendor owners could define exactly what their staff could touch without the team having to hardcode every possible combination in advance.

Gateway Abstraction Layer

Stripe, PayPal, and manual settlement all sit behind a common payment interface. The checkout flow doesn't need to know which gateway ultimately processed a transaction — it just records the result against the vendor's ledger in a consistent shape.

Database-Level Concurrency Control

Stock and inventory writes are protected with row-level locking and atomic operations at the database layer, not just application-level checks — the correctness holds even under genuinely simultaneous requests.

Payments Breaking at the Worst Moments?

If your marketplace's billing logic is fragile, book a free 30-minute call.

Book a 30-Min Discovery Call

What Was Built

Role-Permission System
4 roles, composable capabilities
Multi-Gateway Payments
Stripe, PayPal, manual fallback
Concurrency Control
Row-level locking, atomic stock
Payout Ledger
Single source of truth per vendor

Project Notes

External technical partner engagement
Client retains full ownership of the codebase
Zero-downtime payment gateway rollout
Built to the marketplace's exact vendor hierarchy

Related Case Studies

Have a Project That Needs Custom Software? Let's Talk.

Book a free 30-minute partner call. We'll tell you honestly whether we can help and what it would take to deliver.

Book a 30-Min Discovery Call

No pitch. No sales call. Just an honest conversation about your project.

Book a 30-Min Discovery Call