1 / 15
Developer Guide

Building Sanko

A Complete E-commerce Platform Guide for Developers

๐ŸŒ Premium African Fashion Marketplace ๐Ÿ’ผ Multi-Vendor Platform ๐Ÿš€ Full-Stack Architecture
01

The Sanko Business Model

What is Sanko?

A premium digital platform showcasing the finest African fashion designers - from luxury apparel to contemporary streetwear and accessories.

๐Ÿ‘”

For Sellers

  • Curated retail space
  • Access to global buyers
  • List products & set prices
  • Fulfil orders directly
๐Ÿ›๏ธ

For Buyers

  • Seamless secure purchases
  • Escrow protection
  • 21-day money hold
  • ยฃ150 minimum order
20%
Commission Rate
ยฃ200+
Target Average Order Value(AOV)
21 Days
Escrow Period
02

Your Tech Stack Overview

Think of building Sanko like assembling LEGO blocks - each service handles one job really well:

๐Ÿช

Shopify

Your store foundation - product listings, checkout, basic payments

๐Ÿ’ณ

Stripe Connect

Handles split payments and holds money in escrow

๐Ÿ“ฆ

Shippo / EasyPost

Package tracking integration

๐Ÿ“ง

Resend.com

Email notifications

๐Ÿ”—

Webhooks

The "messenger" that tells services when things happen

๐Ÿ—„๏ธ

PostgreSQL

Database for orders, users, and transactions

03

Part 1: Setting Up Shopify

Basic Setup Steps

1 Go to shopify.com and sign up
2 Choose Shopify Grow plan
3 Set up your domain (pjmsanko.com)
4 Pick a theme (e.g "Dawn" - free & clean)

Key Configurations

  • Store currency: USD
  • Taxes: Auto-calculate
  • Shipping: International zones

โš ๏ธ Multi-Vendor Challenge

Shopify isn't built for marketplaces by default. You need to make it work like one!

Solution: Install "Marketplace Kit" or "Multi Vendor Marketplace" app

04

Part 2: The Money Flow (Escrow + Commission)

How Money Moves in Sanko

๐Ÿ’ฐ
Customer Pays ยฃ200
โ†’
๐Ÿฆ
Money โ†’ Your Stripe Account
โ†’
โณ
Held for 21 Days
โ†’
๐Ÿ“ฆ
After Delivery Confirmation
ยฃ40
You Keep (20%)
ยฃ160
Designer Gets (80%)
05

Setting Up Stripe Connect

What is Stripe Connect?

Stripe's tool for platforms that pay out to multiple sellers (like Uber pays drivers, Airbnb pays hosts)

Setup Steps

1 Create account at stripe.com
2 Enable "Stripe Connect" in dashboard
3 Choose "Express" type (easier onboarding)

Onboarding Designers

const account = await stripe.accounts.create({
  type: 'express',
  country: 'GH',
  email: 'designer@example.com',
  capabilities: {
    transfers: {requested: true},
  },
});

// Generate onboarding link
const accountLink = await stripe.accountLinks.create({
  account: account.id,
  type: 'account_onboarding',
});
06

Holding Funds (Escrow Logic)

Capturing Payment

// Capture payment to Sanko's account (not designer's yet)
const paymentIntent = await stripe.paymentIntents.create({
  amount: 20000, // ยฃ200 in cents
  currency: 'usd',
  metadata: {
    designer_id: 'designer_123',
    order_id: 'order_456',
  },
});
โš ๏ธ

Important

Money sits in Sanko's Stripe account. You control when it transfers to designers.

This gives us the ability to implement the 21-day escrow period.

07

Releasing Funds After 21 Days

Daily Automated Check

// Check for orders ready to pay out
const ordersToPayOut = await database.getOrders({
  delivered: true,
  deliveredDate: { olderThan: '21 days ago' },
  payoutSent: false,
});

for (let order of ordersToPayOut) {
  const totalAmount = order.amount; // ยฃ200
  const commission = totalAmount * 0.20; // ยฃ40
  const designerPayout = totalAmount - commission; // ยฃ160
  
  // Transfer to designer
  await stripe.transfers.create({
    amount: designerPayout * 100,
    currency: 'usd',
    destination: order.designer_stripe_account_id,
  });
  
  await database.updateOrder(order.id, { payoutSent: true });
}
๐Ÿ’ก Pro Tip: Run this code daily using a cron job (scheduled task)
08

Part 3: Package Tracking with Shippo

What is Shippo?

Connects to shipping carriers (DHL, FedEx, UPS) and provides real-time tracking info

Implementation

const Shippo = require('shippo')('your_api_key');

// Get tracking status
const tracking = await Shippo.track.get_tracking_update(
  'dhl',
  'DHL123456789'
);

console.log(tracking.tracking_status.status); 
// "TRANSIT", "DELIVERED", etc.

Webhook for Real-Time Updates

Shippo automatically notifies your server when package status changes - no need to keep checking!

09

Part 4: Email Notifications

๐Ÿ‘ค For Customers

  • Order confirmed
  • Order shipped (with tracking)
  • Order delivered
  • Payment processed

๐Ÿ‘” For Designers

  • New order received
  • Payment released (after 21 days)

Using Resend

const resendMail = require('@resend/mail');

const msg = {
  to: order.customer_email,
  from: 'orders@pjmsanko.com',
  subject: 'Order Confirmed - Sanko',
  html: `

Thanks for your order!

Order #${order.id}

` }; await resendMail.send(msg);
10

Part 5: Enforcing $150 Minimum

Frontend Approach (Shopify Theme)

{% if cart.total_price < 15000 %}
  

Minimum order: $150

Add ${{ 150 | minus: cart.total_price | divided_by: 100 }} more

{% else %} {% endif %}

Backend Approach (Shopify Scripts)

MINIMUM_ORDER = 150

if cart.subtotal_price < MINIMUM_ORDER * 100
  # Block checkout
end
11

Part 6: Complete Order Flow

1
Customer browses Sanko
2
Adds items to cart (must hit ยฃ150)
3
Checks out โ†’ Payment goes to Sanko's Stripe
4
Shopify webhook โ†’ Our server receives order
5
Server emails: designer & customer
6
Designer ships & enters tracking number from DHL, UPS etc
7
Shippo tracks package
8
Package delivered โ†’ Shippo notifies Sanko platform (our server)
9
Server marks order as delivered in the database
10
21 days later โ†’ Cron(scheduler) job runs
11
Stripe transfers ยฃ160 to designer
12
Email designer: "Payment sent!"
12

Part 7: Your Backend Server

Tech Architecture

Shopify Theme (Frontend)
โ†“
Node.js Server (Backend)
โ†“
PostgreSQL Database
โ†“
Stripe
Shippo
Resend.com

Basic Server Structure

const express = require('express');
const app = express();

// Webhook from Shopify
app.post('/webhooks/shopify/order-created', async (req, res) => {
  await database.createOrder(req.body);
  await sendNotifications(req.body);
  res.sendStatus(200);
});

// Daily payout check
cron.schedule('0 0 * * *', processPayouts);
13

Part 8: Development Roadmap

Phase 1 Week 1-3

MVP

  • Set up Shopify store
  • Install marketplace app
  • Configure Stripe Connect
  • Build designer onboarding
  • Implement ยฃ150 minimum
  • Basic email notifications
Phase 2 Week 4-6

Automation

  • Integrate Shippo tracking
  • Build webhook handlers
  • Create payout cron job
  • Add customer tracking page
Phase 3 Week 6-8

Polish

  • Custom designer(seller) dashboard
  • Advanced analytics
14

Key Concepts & Costs

Key Concepts

Webhooks:

Apps telling each other "something happened"

Escrow:

Holding money temporarily

API:

Way for software to communicate

Cron job:

Scheduled automated task

Cost Breakdown

Shopify ยฃ29-299/mo
Stripe 2.9% + 30ยข
Shippo Free
Resend.com Free