n8n Integration
n8n is a first-class automation target for IoneShop.
Options
| Method | When |
|---|---|
| Webhooks (HTTP Request node / Webhook node) | Immediate events — preferred |
| HTTP Request with API key | Pull/reconcile, CRUD |
| IoneShop node (community / official — roadmap) | First-class ops in palette |
IoneShop node — planned operations
| Operation | Maps to |
|---|---|
| Create Product | POST /v1/products |
| Update Product | PATCH /v1/products/{id} |
| Get Orders | GET /v1/orders |
| Get Order | GET /v1/orders/{id} |
| Create Customer | POST /v1/customers |
| Sync Inventory | PUT /v1/inventory/levels |
| Manage Webhooks | POST/GET/DELETE /v1/webhooks |
| Trigger Workflow | Partner-side; emit custom event |
Until the node is published, use HTTP Request + credentials. Starter workflow: examples/n8n-ioneshop-products-sync.json.
Credential (n8n)
- Name:
IoneShop API - Header Auth:
Authorization=Bearer isk_… - Base URL: sandbox or production
/v1
Reference workflow: New order → ERP → Invoice → Shipping
┌─────────────────┐
│ IoneShop │ order.paid webhook
│ Webhook Trigger │
└────────┬────────┘
▼
┌─────────────────┐
│ Verify HMAC │ Function / Code node (mandatory)
└────────┬────────┘
▼
┌─────────────────┐
│ Upsert ERP │ HTTP → ERP (Idempotency-Key = order.id)
│ Sales Order │
└────────┬────────┘
▼
┌─────────────────┐
│ Create Invoice │ ERP / accounting API
└────────┬────────┘
▼
┌─────────────────┐
│ Create Shipment │ Carrier / WMS
└────────┬────────┘
▼
┌─────────────────┐
│ Fulfill in │ POST /v1/orders/{id}/fulfillments
│ IoneShop │
└─────────────────┘
Webhook trigger setup
- n8n Webhook node → Production URL
- Register that URL in IoneShop (
events:order.paid) - Code node verifies signature before any ERP call
- Respond
200quickly; move ERP work to async branch if needed
Sample HMAC function node
const crypto = require("crypto");
const secret = $credentials.ioneshopWebhookSecret;
const sig = $item(0).$node["Webhook"].json.headers["x-ioneshop-signature"];
const raw = $item(0).$node["Webhook"].json.rawBody; // ensure raw body preserved
const expected = crypto.createHmac("sha256", secret).update(raw).digest("hex");
if (expected !== sig) throw new Error("Invalid IoneShop signature");
return items;
(Adjust to your n8n version’s raw-body handling.)
Error handling in n8n
- On
429, use Wait + retry - On
409, fetch current order and continue - Dead-letter failed executions to a queue / Slack with
request_id