A Complete E-commerce Platform Guide for Developers
A premium digital platform showcasing the finest African fashion designers - from luxury apparel to contemporary streetwear and accessories.
Think of building Sanko like assembling LEGO blocks - each service handles one job really well:
Your store foundation - product listings, checkout, basic payments
Handles split payments and holds money in escrow
Package tracking integration
Email notifications
The "messenger" that tells services when things happen
Database for orders, users, and transactions
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
Stripe's tool for platforms that pay out to multiple sellers (like Uber pays drivers, Airbnb pays hosts)
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',
});
// 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',
},
});
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.
// 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 });
}
Connects to shipping carriers (DHL, FedEx, UPS) and provides real-time tracking info
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.
Shippo automatically notifies your server when package status changes - no need to keep checking!
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);
{% if cart.total_price < 15000 %}
Minimum order: $150
Add ${{ 150 | minus: cart.total_price |
divided_by: 100 }} more
{% else %}
{% endif %}
MINIMUM_ORDER = 150
if cart.subtotal_price < MINIMUM_ORDER * 100
# Block checkout
end
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);
Apps telling each other "something happened"
Holding money temporarily
Way for software to communicate
Scheduled automated task