storlaunch.variant.updated.v1

Fires when a variant is mutated — PATCH /v1/inventory/variants/:id. Carries the full current state of the variant, not a diff.

When it fires

Once per successful PATCH. Also fired when the parent product's price changes (because variant priceCents is derived from parentPrice + priceDelta) — this implicit re-fire keeps your mirror's absolute prices in sync.

Payload

Same shape as storlaunch.variant.created.v1.

{
  "id": "evt_01HX...",
  "type": "storlaunch.variant.updated.v1",
  "createdAt": "2026-05-13T11:10:00Z",
  "accountId": "acc_01HX...",
  "data": {
    "id": "var_01HX...",
    "productId": "prod_01HX...",
    "storlaunchProductId": "prod_01HX...",
    "sku": "FNN-MED-BLK",
    "name": "Medium / Black",
    "priceCents": 80000,
    "costCents": 32000,
    "lowStockThreshold": 5,
    "isDefault": false,
    "archived": false
  }
}

Handler examples

// Node
if (event.type === 'storlaunch.variant.updated.v1') {
  const v = event.data;
  await mirror.variants.upsert({ id: v.id }, v);
}
# Python
if event["type"] == "storlaunch.variant.updated.v1":
    v = event["data"]
    mirror.variants.upsert(id=v["id"], **v)
// Go
if event.Type == "storlaunch.variant.updated.v1" {
    var v storlaunch.Variant
    _ = json.Unmarshal(event.Data, &v)
    mirror.UpsertVariant(ctx, v)
}

What to do

  • Upsert the variant row.
  • If archived: true, mark hidden (see variant.archived.v1 — you'll also get that event for an archive). The redundancy here exists because Storlaunch emits BOTH events on archive: an updated first (which sets archived: true) and then the dedicated archived event.
  • Recalculate cart totals if any open carts reference this variant.

Common pitfalls

  • Treating "no change" as a bug. PATCH with empty diff still re-emits. Idempotency in your handler protects you.
  • Storing prices from the variant's priceDelta only. The event ships priceCents (absolute). Use that. Internally Storlaunch keeps priceDelta, but downstream consumers don't need the math.
  • Missing the cascade on parent price change. When the merchant updates the parent product's price, you'll receive product.updated + an variant.updated per variant. If you only listen on one, your mirror drifts.

Related events

Next