Automation2026
Kit stock automation
Updates ERP stock for each piece in a paid kit, with protection against duplicate movements.
Credits Bling as ERP.
Evidence
What it delivers
Production capture · live store
Where each piece is chosen

Execution record · anonymised
Go-live record, 31 May 2026
A real kit order: what the integration did with each piece
| Piece | ERP SKU | Stock in the ERP |
|---|---|---|
| Top | …19811 | −1 · success |
| Short | …25096 | −1 · success |
How the pieces are read (property names from the integration's code, not this order's payload)
_kit_component_N_sku
_kit_component_N_variant_id
_kit_component_N_quantityA repeated webhook can't move the same piece twice: the key order + line + SKU is saved before the stock call.
Overview
What I built
- The Shopify order-paid webhook is checked with HMAC before anything runs.
- Kit pieces come from the order's line-item properties; each piece maps to its SKU in the ERP.
- ERP sign-in with OAuth tokens stored in the database and refreshed automatically when they expire.
- Stock movements are idempotent and sit behind two switches, dry run by default, with retry and backoff when the ERP rate-limits.
- A manual rollback is documented for each release.
How it's wired
The flow, step by step
ExplanationA diagram drawn for this page: how the flow is built, not live traffic.
- Shopify
1 kit → its pieces HMAC · SKU per piece · idempotent
- Piece A stock in the ERP
- Piece B stock in the ERP
- Order paid webhook, HMAC checked
- Kit pieces read from the order
- ERP SKU for each piece
- Idempotent stock intent
- Stock moved in Bling
Screens
Where it shows up

Need something similar? Tell me what you're working on.
Contact on LinkedInor e-mail contato@rafaelshopify.dev
Explore more

Fitness-apparel store & kit operations
Product screen · synthetic data

Order-to-fulfilment integration
Execution record · anonymised
Load manifest, 28 Sep 2026
| Archive photo | SKU prefix | Check |
|---|---|---|
| 20586.jpg | 1006_1000 | attached, verified |
| 20770.jpg | 1006_4001 | attached, verified |
| 20502.jpg | 1006_2000 | attached, verified |
+1 more
Product photo load for an ERP catalogue