Setting up webhooks for custom sync automation
SyncTec's webhook system lets you trigger your own workflows on any sync event. Here's a practical guide with real examples using Make.com and Zapier.
SyncTec can send webhooks whenever a sync happens. This lets you trigger custom workflows in tools like Make.com, Zapier, or your own systems.
Here's how to set it up and what you can build.
What Are Webhooks?
Webhooks are HTTP POST requests sent to a URL you specify when something happens.
SyncTec sends webhooks for:
- Product synced — When a product is pushed to a destination store
- Sync failed — When a sync encounters an error
- Inventory updated — When Location Groups update inventory
- Collection synced — When a collection is pushed
Each webhook contains event data (which product, which stores, what changed).
Setting Up Webhooks
1. Go to Settings → Webhooks
2. Click 'Add Webhook'
3. Enter your webhook URL (the endpoint that will receive the POST request)
4. Select which events to subscribe to
5. Save
SyncTec will now POST to your URL whenever those events occur.
Webhook Payload
Example payload for 'product synced':
```json
{
"event": "product.synced",
"timestamp": "2025-01-29T14:30:00Z",
"product": {
"id": "1234567890",
"title": "Merino Wool Sweater",
"sku": "MWS-001"
},
"source_store": "main-store.myshopify.com",
"destination_store": "eu-store.myshopify.com",
"status": "success"
}
```
Example 1: Slack Notifications (Zapier)
Send a Slack message whenever a product sync fails.
**Steps:**
1. Create a Zapier zap
2. Trigger: Webhook (catch hook)
3. Copy webhook URL from Zapier
4. Paste URL in SyncTec → Settings → Webhooks
5. Subscribe to 'sync.failed' event
6. In Zapier, add action: Send Slack message
7. Message: 'Sync failed for {{product.title}} to {{destination_store}}'
Now you get Slack alerts for every failed sync.
Example 2: Update Google Sheets (Make.com)
Log every product sync to a Google Sheet for record-keeping.
**Steps:**
1. Create a Make.com scenario
2. Trigger: Webhook
3. Copy webhook URL from Make
4. Paste URL in SyncTec
5. Subscribe to 'product.synced' event
6. In Make, add module: Google Sheets → Add Row
7. Map fields: Product title, SKU, Source store, Destination store, Timestamp
Now every sync is logged to Google Sheets automatically.
Example 3: Custom Analytics (Your Own Server)
Send sync data to your own analytics system.
**Steps:**
1. Set up an endpoint on your server (e.g., POST /webhooks/storelink)
2. Paste your URL in SyncTec
3. Subscribe to all events
4. Your server receives POST requests with sync data
5. Parse JSON, store in your database, run analytics
Now you can build custom dashboards and reports.
Example 4: Trigger Other Syncs
When a product syncs to Store A, automatically trigger a related action in another tool.
**Steps:**
1. Product syncs from Main Store to EU Store
2. Webhook fires
3. Zapier/Make catches webhook
4. Zapier triggers action in another tool (e.g., update inventory in your ERP system)
Webhooks let you chain SyncTec with other systems.
Security
SyncTec signs webhook payloads with HMAC-SHA256.
**How to verify:**
1. SyncTec sends a header: `X-StoreLink-Signature`
2. Compute HMAC of the payload using your webhook secret
3. Compare with the signature header
4. Only process webhooks with valid signatures
This prevents spoofed webhooks from malicious actors.
Debugging Webhooks
**Use webhook.site for testing:**
1. Go to webhook.site
2. Copy the unique URL
3. Paste in SyncTec
4. Trigger a sync
5. See the webhook payload on webhook.site
Great for debugging before building your real integration.
Common Issues
**Issue 1: Webhook endpoint returns 4xx/5xx**
SyncTec retries 3 times with exponential backoff. If all retries fail, the webhook is dropped.
**Issue 2: Webhooks arriving out of order**
Webhooks are async. If you sync 10 products at once, webhooks may arrive in any order.
**Issue 3: Duplicate webhooks**
Rare, but possible. Use idempotency: check if you've already processed this event (using event ID).
Rate Limits
SyncTec sends webhooks as fast as events occur. If you're syncing 1,000 products at once, you'll get 1,000 webhooks.
Make sure your endpoint can handle the load.
Final Thoughts
Webhooks make SyncTec extensible. Whatever you can't do in SyncTec natively, you can build with webhooks.
Use them to:
- Notify your team
- Log events
- Trigger other tools
- Build custom integrations
The possibilities are endless.