Automated Inventory Sync from Suppliers
Schedule automated inventory synchronization from supplier APIs using TrigRun. Keep stock levels accurate across Shopify, WooCommerce, or custom e-commerce platforms.
Pull fresh inventory data from your supplier's API on a fixed schedule. TrigRun calls your sync endpoint, your backend fetches supplier stock levels and updates your catalog — automatically, every 4 hours.
The problem
Your e-commerce store sells products from multiple suppliers. Each supplier has an API or feed with current stock levels. If you don't sync regularly, you oversell out-of-stock items — leading to refunds, angry customers, and marketplace penalties (Amazon, Shopify).
Running a cron job on your server works until the server restarts, the cron daemon crashes, or someone accidentally deletes the crontab entry. You find out days later when a customer complains.
How it works with TrigRun
- TrigRun calls
POST /api/inventory/syncevery 4 hours - Your backend receives the request, calls the supplier API, and updates stock
- Your backend returns a summary:
{"synced": 342, "out_of_stock": 12, "errors": 0} - TrigRun logs the response — you can see every sync result for 30 days
- If it fails, TrigRun retries 3 times, then alerts you via Slack
Step-by-step setup
1. Create a secret for your sync endpoint auth
2. Create the scheduled job
3. Add a Slack notification for failures
4. Verify with a manual run
Expected results
After the job runs, TrigRun logs the full execution. In the dashboard you see:
| Field | Example value |
|---|---|
| Status | 200 OK |
| Duration | 4,230 ms |
| Response body | {"synced": 342, "out_of_stock": 12, "errors": 0, "duration_ms": 4100} |
| Next run | 2026-03-16T08:00:00Z |
If the supplier API is down, you see:
| Field | Example value |
|---|---|
| Status | 502 Bad Gateway |
| Attempts | 3 of 3 |
| Final result | failed |
| Notification | Slack alert sent to #e-commerce-alerts |
Multiple suppliers
Create one job per supplier with different schedules based on importance:
| Job | Supplier | Schedule | Expression |
|---|---|---|---|
| Inventory sync - Supplier A | Primary supplier | Every 2 hours | 0 */2 * * * |
| Inventory sync - Supplier B | Secondary | Every 4 hours | 0 */4 * * * |
| Inventory sync - Dropship | Dropshipping | Every 6 hours | 0 */6 * * * |
Your sync endpoint
Your backend endpoint should:
- Accept the POST from TrigRun (verify with the
X-Cron-Service-Signatureheader) - Call the supplier API to fetch current stock
- Update your database with new quantities
- Return a JSON summary so TrigRun logs meaningful data