Skip to main content

// developers · events

Be told, instead of polling.

45 event types; 19 publish today, 22 more are built and switched off. Deliveries are CloudEvents 1.0 envelopes, signed with the same ES256 key the access tokens use, so you verify them with a public key and no shared secret.

// subscribe

One call per endpoint.

subscribe
curl -X POST https://app.magistry.io/api/v1/subscriptions \
  -H "Authorization: Bearer mag_sk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://your-app.example/hooks/magistry",
        "event_types": ["order.*", "approval.decided"],
        "description": "Order sync" }'

event_types takes exact types or a trailing *; leave it out to receive every type. Creating a subscription needs automation:write, plus the read scope of each type it filters, because a webhook is a read. It is refused when the URL is not https or resolves to a private address, when a filter matches no type in the catalogue, and past 20 subscriptions per store. A filter on a type that does not publish yet is saved, with a no_publisher_yet warning in the response.

Finance events belong to a set of books rather than a store, so they are subscribed per entity at POST /api/v1/finance/subscriptions with an entity_id. Missed ones can be replayed from the finance change feed, which keeps 730 days.

// catalogue

45 event types.

19 publish today. 22 more have a publisher built but are switched off, so nothing is delivered for them yet. 4 are defined in the contract with their payload, and listed here so you can plan for them, but nothing emits them yet. Generated from the API's event catalogue at build time; the AsyncAPI document carries the payload schemas.

Store events (34)

  • order.created
    built, switched off

    A new order was recorded for the store, from any sales channel.

    Subject: The order id. · Scope: orders:read

  • order.updated
    built, switched off

    A contract field of an order changed: total, currency, line-item count, payment or fulfilment status, cancellation or deletion.

    Subject: The order id. · Scope: orders:read

  • order.cancelled
    built, switched off

    An order was cancelled.

    Subject: The order id. · Scope: orders:read

  • order.fulfilled
    built, switched off

    An order became fully fulfilled.

    Subject: The order id. · Scope: orders:read

  • order.refunded
    built, switched off

    A refund was recorded against an order, by Magistry or by a person.

    Subject: The order id. · Scope: orders:read

  • product.price_changed
    built, switched off

    A variant price or reference price changed on the storefront.

    Subject: The variant id. · Scope: catalog:read

  • product.created
    built, switched off

    A product was added to the catalogue, from any channel.

    Subject: The product id. · Scope: catalog:read

  • product.updated
    built, switched off

    A product title, status, handle, vendor or product type changed.

    Subject: The product id. · Scope: catalog:read

  • product.stock_changed
    built, switched off

    A variant went out of stock or came back in stock. Sent on the crossing, never per unit.

    Subject: The variant id. · Scope: catalog:read

  • cs.thread_escalated
    defined, not publishing yet

    A customer-service thread was escalated to a person.

    Subject: The thread id. · Scope: cs:read

  • cs.thread_opened
    built, switched off

    A customer started a conversation: the first inbound message of a customer thread arrived. Imported history, spam and non-customer mail are not openings.

    Subject: The thread id. · Scope: cs:read

  • cs.human_requested
    built, switched off

    The customer asked for a person. Sent each time the request is made again after a release, including on desks with no person to take it.

    Subject: The thread id. · Scope: cs:read

  • cs.thread_resolved
    built, switched off

    A customer thread was closed. Sent again if it is reopened and closed; moving it to spam or trash is not a resolution.

    Subject: The thread id. · Scope: cs:read

  • decision.proposed
    built, switched off

    Magistry recorded a decision it proposes to take for the store.

    Subject: The decision id. · Scope: automation:read

  • decision.approved
    built, switched off

    A decision was approved, by a merchant user or by a policy the merchant set.

    Subject: The decision id. · Scope: automation:read

  • decision.executed
    built, switched off

    A decision was applied to the system it acts on.

    Subject: The decision id. · Scope: automation:read

  • decision.reverted
    built, switched off

    An applied decision was undone.

    Subject: The decision id. · Scope: automation:read

  • decision.expired
    built, switched off

    A proposed decision lapsed before it was approved or applied. It will not be taken.

    Subject: The decision id. · Scope: automation:read

  • decision.blocked
    built, switched off

    A decision was stopped by a guard, a policy or a missing precondition, at proposal or later. It will not be taken as proposed.

    Subject: The decision id. · Scope: automation:read

  • decision.superseded
    built, switched off

    A decision was replaced by a newer one. It will not be taken.

    Subject: The decision id. · Scope: automation:read

  • campaign.status_changed
    defined, not publishing yet

    An ad campaign was paused, resumed, or had its budget changed.

    Subject: The campaign id. · Scope: ads:read

  • compliance.finding_opened
    defined, not publishing yet

    A compliance audit opened a finding against the store.

    Subject: The finding id. · Scope: automation:read

  • approval.requested
    publishing

    A connected app asked the merchant to approve something.

    Subject: The approval id. · Scope: automation:read

  • approval.decided
    publishing

    A person approved or rejected an app's approval request.

    Subject: The approval id. · Scope: automation:read

  • approval.expired
    publishing

    An approval request reached its deadline with no decision, and is closed as not approved.

    Subject: The approval id. · Scope: automation:read

  • webhook.tested
    publishing

    A test sent to one endpoint on request (webhook_test); nothing happened in the store.

    Subject: The subscription id the test was sent to. · Scope: automation:read

  • operation.succeeded
    publishing

    A long-running operation (a render, an AI design edit, a proposed write) finished and has a result.

    Subject: The operation id (op_…). · Scope: automation:read

  • operation.failed
    publishing

    A long-running operation ended without a result; `error.code` says why.

    Subject: The operation id (op_…). · Scope: automation:read

  • operation.cancelled
    publishing

    A long-running operation was cancelled, rejected or superseded before it ran.

    Subject: The operation id (op_…). · Scope: automation:read

  • operation.expired
    publishing

    A long-running operation, usually a write waiting for approval, reached its deadline with nobody acting on it.

    Subject: The operation id (op_…). · Scope: automation:read

  • intent.field_overwritten_externally
    publishing

    A field Magistry set (a variant price, a campaign status, budget or bidding, a theme file) was changed afterwards by someone else. Sent once per overwrite, when it is first read back.

    Subject: The declaration (intent) id. · Scope: automation:read

  • research.run_completed
    built, switched off

    A product research run finished, with its products found or the reason it stopped. Sent once per run; a run interrupted by a deploy and continued is still one run.

    Subject: The research run id. · Scope: research:read

  • research.candidate_onboarded
    built, switched off

    A research candidate became a Shopify DRAFT product in the store. Sent once per candidate and product; the product is never published by this step.

    Subject: The research candidate id. · Scope: research:read

  • account.audit
    built, switched off

    A line was written to the workspace audit log: a member, invite, role, API key, app grant or policy changed. Sent to the merchant's own subscriptions (dashboard or API key), never to a connected app; a workspace-wide line is sent to every store of the workspace.

    Subject: The audit line id. · Scope: admin:read

Finance entity events (11)

  • fin.entry.posted
    publishing

    A journal entry was posted. Entries of a bulk import are announced once, by the import, and read through the API.

    Subject: The entry id. · Scope: finance:read

  • fin.entry.reversed
    publishing

    A journal entry was reversed by a new entry. The original stays; this is its tombstone.

    Subject: The reversal entry id. · Scope: finance:read

  • fin.period.closed
    publishing

    A period was closed: nothing more is posted into it until it is reopened.

    Subject: The period id. · Scope: finance:read

  • fin.period.reopened
    publishing

    A closed period was reopened.

    Subject: The period id. · Scope: finance:read

  • fin.bank.imported
    publishing

    A bank statement was imported: how many rows arrived, how many were new and how many were duplicates.

    Subject: The import id. · Scope: finance:read

  • fin.bank_transaction.dismissed
    publishing

    A bank row was dismissed as not_a_transaction or as a duplicate_of another row; any booking of it was reversed.

    Subject: The bank transaction id. · Scope: finance:read

  • fin.bank_transaction.undismissed
    publishing

    A dismissal was undone: the bank row counts again.

    Subject: The bank transaction id. · Scope: finance:read

  • fin.bank_account.created
    publishing

    A bank, card, cash or PSP account was added to the books, with the ledger account it books on.

    Subject: The bank account id. · Scope: finance:read

  • fin.bank_account.updated
    publishing

    A bank account's details changed; `fields` names which.

    Subject: The bank account id. · Scope: finance:read

  • fin.bank.consent_expiring
    defined, not publishing yet

    A bank connection's consent ends soon; the bank feed stops unless the owner renews it.

    Subject: The bank connection id. · Scope: finance:read

  • fin.einvoice.status_changed
    publishing

    An e-invoice moved to a new Peppol status; `previous_status` says where it came from.

    Subject: The e-invoice message id. · Scope: finance:read

asyncapi
curl https://app.magistry.io/api/v1/asyncapi.json

// verify

Check the signature before you trust the body.

Standard Webhooks, asymmetric

Each delivery carries webhook-id, webhook-timestamp and webhook-signature: v1a,<signature>: an ES256 signature, raw r‖s in base64url, over {id}.{timestamp}.{body}.

webhook-key-id names the key in /.well-known/jwks.json to verify with, so a key rotation needs no change on your side. A library that already speaks Standard Webhooks verifies these without Magistry-specific code.

Delivery

Guarantee
At least once; dedupe on webhook-id
Attempts
6, with jittered backoff
Timeout
10 seconds
Answer 410
Unsubscribes the endpoint
Disabled after
20 consecutive failures
node · verify a delivery
import { createPublicKey, verify } from "node:crypto";

const { keys } = await (await fetch("https://app.magistry.io/.well-known/jwks.json")).json();

// rawBody: the request body exactly as received, before any JSON parsing.
export function isFromMagistry(headers, rawBody) {
  const id = headers["webhook-id"];
  const ts = headers["webhook-timestamp"];
  const [scheme, sig] = String(headers["webhook-signature"]).split(",");
  if (scheme !== "v1a") return false;
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; // your replay window
  const jwk = keys.find((k) => k.kid === headers["webhook-key-id"]);
  if (!jwk) return false;
  return verify(
    "sha256",
    Buffer.from(`${id}.${ts}.${rawBody}`),
    { key: createPublicKey({ key: jwk, format: "jwk" }), dsaEncoding: "ieee-p1363" },
    Buffer.from(sig, "base64url"),
  );
}

Build on the same tools the product uses.

Create a sandbox key on demo data, or start free and connect a real store.

MCP + REST · OAuth 2.1 or API keys · every call audited