Connect to supplier APIs for automatic order routing to dropship vendors, real-time inventory sync, and margin calculation per order
A dropshipping integration routes customer orders automatically to supplier warehouses, syncs supplier inventory to your storefront, and tracks your margin on every sale. Done right, customers receive their products on time without you ever touching physical inventory. Done poorly, oversells and fulfillment failures destroy your reputation.
This skill walks through setting up dropshipping on your platform using the right tools, then covers custom/headless implementations for those building from scratch.
| Platform | Recommended Tool | Why |
|---|---|---|
| Shopify | DSers (free), AutoDS, or Spocket | DSers is the official AliExpress partner; AutoDS and Spocket handle premium/US-based suppliers with automated order routing |
| WooCommerce | AliDropship plugin, DropshipMe, or WooCommerce + custom webhook | AliDropship handles AliExpress automation; for other suppliers use WooCommerce webhooks to push orders to a supplier API |
| BigCommerce | Modalyst, Spocket, or BigCommerce + custom integration | Modalyst and Spocket have native BigCommerce apps with inventory sync |
| Custom / Headless | Build a supplier integration layer using the supplier's API or CSV/EDI feed | Full control over routing logic, margin tracking, and supplier selection |
Keeping your storefront stock levels in sync with supplier availability is the most critical piece — oversells damage customer trust immediately.
Using DSers (AliExpress dropshipping):
Using Spocket (US/EU suppliers):
Using AutoDS (multi-supplier):
Using AliDropship plugin:
For non-AliExpress suppliers:
Using Modalyst:
Using Spocket:
For headless storefronts, build a supplier integration layer:
// Supplier product and inventory schema
interface SupplierProduct {
supplierId: string;
supplierSku: string; // supplier's own SKU
internalProductId: string; // your product ID
costPriceCents: number; // what you pay the supplier
stockQty: number;
lastSyncedAt: Date;
}
// Route an order line to the best available supplier
async function selectBestSupplier(
productId: string,
requiredQty: number
): Promise<SupplierProduct | null> {
// Pick the cheapest in-stock supplier with enough quantity
return db.supplierProducts.findOne({
internal_product_id: productId,
stock_qty: { gte: requiredQty },
is_active: true,
}, { orderBy: ['cost_price_cents', 'asc'] });
}
// Sync supplier inventory from CSV feed
async function syncSupplierInventoryFromCsv(
supplierId: string,
csvContent: string
): Promise<void> {
const rows = parseCsv(csvContent); // [{sku, qty, cost}]
for (const row of rows) {
await db.supplierProducts.upsert({
supplier_id: supplierId,
supplier_sku: row.sku,
stock_qty: parseInt(row.qty),
cost_price_cents: Math.round(parseFloat(row.cost) * 100),
last_synced_at: new Date(),
});
}
// Zero out SKUs not in the feed (discontinued)
const activeSKUs = new Set(rows.map(r => r.sku));
const allProducts = await db.supplierProducts.findBySupplierId(supplierId);
for (const sp of allProducts) {
if (!activeSKUs.has(sp.supplier_sku)) {
await db.supplierProducts.update(sp.id, { stock_qty: 0 });
}
}
}
// Submit a dropship order to a supplier API
async function submitDropshipOrder(params: {
supplierApiEndpoint: string;
supplierApiKey: string;
orderReference: string;
shippingAddress: Address;
items: { supplierSku: string; quantity: number }[];
}): Promise<string> {
const response = await fetch(params.supplierApiEndpoint + '/orders', {
method: 'POST',
headers: {
'Authorization': `Bearer ${params.supplierApiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
reference: params.orderReference,
ship_to: params.shippingAddress,
items: params.items,
}),
});
if (!response.ok) throw new Error(`Supplier API error: ${response.status}`);
const result = await response.json();
return result.order_id; // supplier's order reference
}
POST /wp-json/wc/v3/orders/{id})Margin tracking is critical — your cost price can drift from your selling price without you noticing.
| Problem | Solution |
|---|---|
| Customer orders an item that goes out of stock at the supplier after your sync | Sync frequently and keep a buffer stock threshold; enable email alerts in DSers/AutoDS for stock-out events |
| Supplier ships the wrong items | Most supplier apps don't validate fulfilled items — contact the supplier directly and have their order reference ready |
| Dropship order is placed twice when the app retries | DSers and AutoDS use idempotency internally; for custom integrations, check for an existing supplier order reference before re-submitting |
| Margin calculation ignores shipping costs | If you offer "free shipping" but pay the supplier for shipping, subtract that from your margin calculation — it's a real cost |
| Tracking number doesn't sync back to platform | Check the app's tracking sync settings; for WooCommerce webhooks verify the webhook delivery log in WooCommerce → Settings → Advanced → Webhooks |