Back to projects
iOS & Android API

E-commerce Vendor App — Mobile API

Product Management, Order Fulfilment & Payouts for Marketplace Sellers

LaravelPHP 8.2MySQLSanctumQueuesFCM
Platforms
iOS + Android
Auth
Sanctumtokens
Real-time
FCM push
Access
Per-vendorscoped
iOS & Android · REST APIUI concept
E-commerce Vendor App — Mobile API — screenshot

Seller-side API for a multi-vendor marketplace. Vendors manage their products and stock from their phone, receive and fulfil orders, print shipping labels, and track sales and payouts — while only ever seeing their own store's data.

Architecture & System Design

Every vendor endpoint is scoped to the authenticated vendor through policies and query scopes, so one seller can never read or change another's products or orders. Marketplace orders are split into per-vendor sub-orders, and payouts are calculated from completed sub-orders minus commission.

Request Flow
Customer Order
Split per Vendor
Vendor Notified
Fulfil & Ship
Order Completed
Commission & Payout
  • Policies and global scopes enforce strict per-vendor data isolation
  • Marketplace orders split into vendor sub-orders for independent fulfilment
  • Low-stock alerts sent to vendors automatically
  • Payout statements generated from completed sub-orders

Engineering Challenges

Data Isolation Between Sellers

Problem

Vendors share the same tables, so a missed filter in any endpoint could expose another seller's data.

Solution

Applied a vendor global scope on vendor-facing models and authorization policies on every route, with tests asserting cross-vendor access is denied.

Result

Vendor data isolation is enforced by default rather than by remembering to add filters.

Mixed-Vendor Orders

Problem

A single customer order can contain products from several vendors who ship separately.

Solution

Split each order into vendor sub-orders with their own status and shipping, while the customer still sees one order.

Result

Vendors fulfil independently and payouts are calculated per vendor accurately.

Core Features

Inventory

Add and edit products, variants, prices and stock from the app.

Clean Code

BelongsToVendor.php
1trait BelongsToVendor
2{
3 protected static function bootBelongsToVendor(): void
4 {
5 static::addGlobalScope('vendor', function (Builder $query) {
6 if ($vendor = auth()->user()?->vendor) {
7 $query->where('vendor_id', $vendor->id);
8 }
9 });
10
11 static::creating(function (Model $model) {
12 $model->vendor_id ??= auth()->user()?->vendor?->id;
13 });
14 }
15}

Want something like this for your business?

I design and build full stack products end to end. Tell me about your idea and I'll get back to you with a plan.