novinzodevelopers
Plugins

Webhooks

Event payloads, delivery status codes, retries, and durable deduplication for standalone plugin Workers.

Webhooks are one-way event notifications. Novinzo sends JSON with POST to fixed paths under /webhooks/. Delivery success depends on the HTTP status alone. Use the linked HTTP references without installing a Novinzo package.

At a glance

WebhookPathEventRetry ceiling
VariantPurchased/webhooks/variant-purchasedPayment confirmed5 attempts
VariantRefunded/webhooks/variant-refundedPaid order fully refunded5 attempts
OrderRefunded/webhooks/order-refundedMoney of a payment refunded288 attempts
PaymentDisputed/webhooks/payment-disputedPayment disputed288 attempts
PaymentFraudWarned/webhooks/payment-fraud-warnedEarly fraud warning on a payment288 attempts
PaymentAttempted/webhooks/payment-attemptedCard authorization approved or declined288 attempts
VariantDeleted/webhooks/variant-deletedVariants removed288 attempts
VariantStockChanged/webhooks/variant-stock-changedVariant sold out or restocked288 attempts
SubscriptionStarted/webhooks/subscription-startedSubscription first paid288 attempts
SubscriptionRenewed/webhooks/subscription-renewedSubscription period paid288 attempts
SubscriptionPastDue/webhooks/subscription-past-dueSubscription period unpaid288 attempts
SubscriptionEnded/webhooks/subscription-endedSubscription ended288 attempts
CheckoutCompleted/webhooks/checkout-completedCheckout paid5 attempts
CheckoutCancelled/webhooks/checkout-cancelledCheckout ends unpaid5 attempts
CheckoutExpired/webhooks/checkout-expiredPrepared checkout expires5 attempts
StoreProfileChanged/webhooks/store-profile-changedStore profile may have changed288 attempts
HourlyTick/webhooks/hourly-tickAn hour began12 attempts
SellerAction/webhooks/seller-actionSellers' dashboard calls288 attempts

Who receives a webhook

A recipient meets all these conditions:

  • Novinzo registers its subscription to the event code.
  • The store has the plugin installed.
  • The plugin is active and the store exists.

Coordinate subscriptions with Novinzo through Registration. There is no public self-service provisioning API.

Novinzo resolves recipients again for each attempt. Uninstalling a plugin stops pending retries for that store. Store-private plugins subscribe to the events their manifest lists, including seller-action.

Request format

POST /webhooks/variant-purchased HTTP/1.1
content-type: application/json
x-novinzo-plugin-invocation: <platform-issued invocation token>
x-novinzo-store-id: 7d5c4a7e-1f0b-4c35-9a52-1b2f0e8d9c41

{"storeId":"7d5c4a7e-1f0b-4c35-9a52-1b2f0e8d9c41","variantId":"0b8f6c3e-2a71-4d9e-8f05-6c4b3a2d1e90","customerId":"3c1e9a52-7b4d-4f80-a6e2-5d0c8b7f1a23","orderId":"9e2d7b14-5c3a-4b6f-8d01-7a9c2e4f6b85","quantity":2,"deliveredByYou":true}

Webhook requests carry the trusted x-novinzo-store-id header of the same invocation. Scope your records by it; only a delivery without it, from an older sender, falls back to the payload's storeId. A retry receives a fresh invocation token. Forward that token unchanged when calling core-for-plugins. The signed token identifies the plugin and store on platform calls, in every environment.

Plugin Workers have no public URL. Keep workers_dev=false and preview_urls=false. A token-presence test in a handler does not authenticate arbitrary public callers.

Status codes

ResponseDelivery result
Any 2xxDelivered. Novinzo ignores the response body.
404 with {"_tag":"VariantNotEnabledError","variantId":"…"} for VariantPurchased or VariantRefundedExpected permanent skip for this recipient.
410Permanent rejection of this delivery.
409 with {"_tag":"VariantDeliveryRefusedError","reason":"…"} for VariantPurchasedFailed without further attempts, until staff choose Retry delivery.
400 with {"_tag":"MissingStoreIdError"} or 401 with {"_tag":"UnauthorizedError"}Permanent failure without further attempts.
Transport failures, no response within 10 seconds, ordinary 4xx, or 5xxRetryable until the attempt ceiling.
Unknown plugin, unauthorized installation, or deterministic contract/configuration failurePermanent failure without further attempts.

A plain 404 is not a variant decline. Return the exact tagged body for that case. A tagged 400 MissingStoreIdError or 401 UnauthorizedError says your Worker refused Novinzo's own request, which a retry cannot change, so the delivery is not attempted again. Answer a webhook with them only when the store header is absent or malformed or the invocation token is missing, never for a failure of your own. Return the tagged 409 when you cannot deliver a purchase until someone fixes a cause on your side, such as a supplier balance too low to buy keys. The order shows that the plugin refused the delivery; reason is yours, and Novinzo shows none of it. A plain 409 stays retryable. A 410 ends only this delivery. Ask Novinzo to change the subscription to stop future events. Never return success after a failed write.

Delivery semantics

Delivery is at least once. An event arrives again when its response disappears or a retry overlaps a slow attempt. Novinzo records events transactionally with the changes that cause them. Each recipient has a separate delivery claim.

  • Successful recipients do not repeat because another recipient fails.
  • The relay runs every five minutes and retries unsettled deliveries.
  • Purchase, deletion, store-profile and CheckoutCompleted deliveries also run immediately after commit, the store-profile delivery for a new install included. A failed immediate attempt is left to the relay.
  • Refunds, disputes, fraud warnings, payment attempts, stock changes, subscription events, CheckoutCancelled, CheckoutExpired, hourly ticks and seller actions arrive through the relay.
  • Delivery fanout runs at a maximum concurrency of eight.
  • Event ordering is not guaranteed.
EventRecipient claim identityMaximum attempts
VariantPurchasedOrder, plugin, variant5
VariantRefundedOrder, plugin, variant5
VariantDeletedPlugin, variant288
CheckoutCompleted or CheckoutCancelledOrder, plugin, outcome type5
CheckoutExpiredPrepared checkout, plugin5
StoreProfileChangedChange, plugin288
OrderRefundedRefund, plugin288
PaymentDisputedDispute, plugin288
PaymentFraudWarnedWarning, plugin288
PaymentAttemptedAttempt, plugin288
VariantStockChangedStock change, plugin288
SubscriptionStarted or SubscriptionEndedSubscription, plugin288
SubscriptionRenewedRenewal order, plugin288
SubscriptionPastDueUnpaid period, plugin288
HourlyTickHour, store, plugin12
SellerActionAction, plugin288

Deletion, store-profile, refund, dispute, stock-change, subscription and seller-action attempts span about one day at the relay interval, and hourly tick attempts about one hour. A backlog extends that period. Exhausted deliveries are dead-lettered and are not delivered again automatically. A store member can send a dead-lettered or refused VariantPurchased again, with a fresh attempt budget, using Retry delivery on the order or the OrderRetryPluginDelivery RPC. The first attempt is made right away; if it fails, the rest follow the usual retry schedule. Only that order line's recipient receives it, so expect the same purchase again after you refused it. A late payment produces CheckoutCompleted after cancellation or expiry. Never undo confirmed fulfillment because an older cancellation arrives later.

The webhooks

VariantPurchased

Novinzo sends one request per variant in a paid order to each subscribed installed plugin. It sums quantities when several order lines contain the same variant.

FieldJSON typeMeaning
storeIdUUID stringStore owning the order
variantIdUUID stringPurchased variant
customerIdUUID stringStore customer
orderIdUUID stringPaid order
quantityPositive integerUnits to fulfill
chargedObject, optional{ listMinor, paidMinor, currency }: what the units cost and what the buyer paid for them
deliveredByYouBooleanWhether the order recorded your plugin as the delivery of these lines when it was paid
buyerInputsArray{ label, value } your storefront block collected for this variant's line
subscriptionObject, optional{ id, periodEnd } of the subscription this line pays a period of; absent for a one-off sale

Every field but subscription and charged is required. A body without buyerInputs, from a core that predates them, means none. The event includes all purchased variants, not just variants your plugin handles. buyerInputs holds only what your own plugin passed to UpdatePlan; another plugin's are never sent to you. Return the tagged VariantNotEnabledError response for variants you do not handle. charged is in the order currency's minor units. listMinor is what the units cost, with any charge lines a plugin added to them, and paidMinor what the buyer paid of that once the order's discounts came off: the line's own and its share of the order's. Tax, shipping and payment fees are in neither. quantity does not change when a coupon or a volume discount lowers the price, so a plugin that hands out value by the unit, such as prepaid credit, must give it in proportion to paidMinor over listMinor. An older delivery has no charged.

When deliveredByYou is false, another delivery fulfills the lines, even if your plugin still lists the variant (the seller may have moved it to another delivery). Decline it with VariantNotEnabledError instead of delivering it a second time.

For plugin-owned stock, report successful delivery in the same handler. Fail the webhook if that platform report fails. Make both local fulfillment and reporting safe to repeat. See Product deliveries and stock.

VariantRefunded

Novinzo sends one request per variant to each subscribed installed plugin once a paid order is refunded as a whole. The payload has the same fields as VariantPurchased plus paymentId, the payment whose refund completed the order's. quantity is every unit of the variant that the order bought.

An order is announced refunded once. Deduplicate by (paymentId, variantId); a redelivery carries the same pair. This event can arrive before the order's VariantPurchased. Record the refund by orderId and variantId, and grant nothing for a purchase that arrives after it. Return the tagged VariantNotEnabledError response when you granted nothing for the variant.

OrderRefunded

Novinzo sends one request to each subscribed installed plugin when money of a paid order's payment goes back to the buyer: every refund Novinzo recorded that succeeds, partial or full, and the part of a payment a provider reports refunded in full that no recorded refund accounts for.

FieldJSON typeMeaning
storeIdUUID stringStore owning the order
orderIdUUID stringRefunded order
paymentIdUUID stringPayment the money went back from
customerIdUUID stringStore customer
refundIdUUID string, optionalThe refund; absent for a part no recorded refund names
amount{ "amountMinorUnits": "<integer>", "currency": "<ISO 4217>" }What went back, in the payment's currency
paymentFullyRefundedBooleanWhether the refunds recorded for the payment now cover all of it

Deduplicate by refundId. When a provider reports the whole payment refunded, the part no refund Novinzo recorded accounts for (a refund made in Stripe's or Mollie's own dashboard, or a payment plugin's refunded report) arrives once without refundId, with paymentFullyRefunded set; deduplicate that one by paymentId. The amounts announced for a payment never add up to more than was paid. A refund still being settled when the provider reports the whole payment refunded is announced on its own once it succeeds. A refund made in Square's, PayPal's or Whop's own dashboard, or in Revolut Business, is recorded with the amount the provider reports once it completes, and arrives then with its own refundId, as a refund made in Novinzo does. A partial refund made in Stripe's or Mollie's own dashboard is not announced when it is made, because Novinzo has no record of it. Its amount arrives as part of that remainder once the payment is refunded in full, and never if it is not. MoneyMotion's refund webhook carries no amount, so it announces a refund only when it settles the one refund Novinzo has open for the payment. A refund made in MoneyMotion's own dashboard is never announced, and a webhook that matches no single open refund announces nothing. A refund records an amount, not the lines it returns. VariantRefunded still announces each variant once the order is refunded as a whole. A refund of an order that was never paid, or of a payment without an order, is not announced.

PaymentDisputed

Novinzo sends one request to each subscribed installed plugin when a payment of a paid order moves to disputed: a payment plugin reports a dispute, or Stripe, PayPal, Mollie, Revolut, MoneyMotion or NMI does. NMI's chargebacks are read from its records once an hour, so they arrive up to an hour late. An NMI chargeback is never closed. NMI's records show a chargeback as a return action on the sale, but nothing about how it ended, and its chargeback webhooks announce only new chargebacks. A payment whose chargeback the merchant wins in representment stays disputed in Novinzo. Payload: storeId, orderId, paymentId, customerId, eventId, provider (stripe, cashapp, moneymotion, crypto, rewarble, plugin, square, sumup, whop, nmi, mollie, revolut, paypal or store_credit), amount, the payment's whole amount, shaped as in OrderRefunded, and reason, why the buyer disputed it. reason is fraud (the cardholder did not make or allow the payment), not_received, not_as_described, duplicate, other (a reason the provider named that is none of these) or unknown (the provider gave none). Stripe and PayPal name a reason, and a payment plugin's dispute carries the reason it reported, or unknown when it reported none. Disputes from Mollie, Revolut, MoneyMotion and NMI arrive as unknown. Deduplicate by eventId, which stays the same on every redelivery. A payment refunded after a dispute and disputed again arrives with a new eventId. Other providers' disputes, such as Square's, SumUp's and Whop's, do not reach Novinzo yet, so their payments are never announced disputed.

PaymentFraudWarned

Novinzo sends one request to each subscribed installed plugin when a card network sends an early fraud warning on a payment of a paid order: the card's issuer says the cardholder reported the payment as fraud. Only Stripe reports these today. The warning moves no money and leaves the payment as it is, but a dispute often follows. Payload: storeId, orderId, paymentId, customerId, eventId, provider, amount, the payment's whole amount, shaped as in OrderRefunded, and fraudType, the kind of fraud the issuer reported, as the provider wrote it (Stripe's are card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc and unauthorized_use_of_card). Deduplicate by eventId, which stays the same on every redelivery.

PaymentAttempted

Novinzo sends one request to each subscribed installed plugin for each card authorization attempt on a payment of an order, approved or declined, as its provider reports it. A declined attempt is announced while the buyer may still retry, so the order need not be paid. Store-private plugins cannot subscribe to it. Payload: storeId, orderId, paymentId, eventId, provider, and attempt:

FieldMeaning
outcomeapproved or declined
declineCategoryOnly when declined: fraud (the processor or issuer flagged it), insufficient_funds, do_not_honor, invalid_card, error or other
card.brand, card.bin, card.last4, card.expMonth, card.expYearThe card, never its full number; each null when the provider did not report it
card.fundingcredit, debit, prepaid or unknown
card.issuerCountryThe issuing bank's country, ISO 3166-1 alpha-2, or null
card.walletThe wallet the card was paid through, such as apple_pay, or null
card.fingerprintThe provider's own stable id of the card number, or null
card.avs, card.cvvmatch, partial, no_match or unavailable
card.threeDSecureauthenticated, attempted, failed, not_attempted or unavailable

Deduplicate by eventId, which stays the same on every redelivery.

VariantDeleted

Payload: { "storeId": "<uuid>", "variantId": "<uuid>" }. Novinzo sends one request per removed variant to each recipient. Scope cleanup by both fields. Retain deduplication records or deletion markers when delayed purchases overlap deletion.

VariantStockChanged

Novinzo sends one request to each subscribed installed plugin when a variant whose stock the seller counts sells out or comes back in stock. Only the crossing is announced: the last free unit going ("state": "sold_out") or a unit coming back to a sold-out variant ("state": "in_stock"), never every change of the count. A sale, an open checkout holding the last units or letting them go when it ends unpaid, and the seller changing the count on the product page all count. Units held by open checkouts are not free, as on the storefront.

FieldJSON typeMeaning
storeIdUUID stringStore owning the variant
productIdUUID stringProduct of the variant
variantIdUUID stringVariant whose stock crossed zero
eventIdStringThe change; the same on every redelivery
state"sold_out" or "in_stock"Where the variant's stock ended
availableUnitsInteger or nullFree units after the change; null when the seller stopped counting the stock
changedAtISO 8601 stringWhen the change was made

Deliveries are retried independently, so an older change can arrive after a newer one. Keep the one with the latest changedAt for each variant. Stock a plugin owns is that plugin's to report, so it is never announced.

Subscription events

A variant the seller sells as a subscription is bought once at sign-up and paid again each period by a renewal order. Each paid order still sends VariantPurchased, whose subscription names the subscription and the end of the period the order paid. Grant what the variant gives once, on the first VariantPurchased of a subscription, and on later ones renew it until periodEnd instead of granting it again.

Novinzo also sends each subscribed installed plugin what happens to the subscription. Every payload carries subscriptionId, storeId and customerId, and items, the subscription's variants.

WebhookSent whenOther fields
SubscriptionStartedThe sign-up order is paidorderId, periodEnd; items are { variantId, quantity }
SubscriptionRenewedA renewal order is paid, in grace tooorderId (the renewal order), periodEnd (the new period's end); items as above
SubscriptionPastDueA period ended unpaidperiodEnd (the unpaid period's end), graceEndsAt; items are { variantId, access }
SubscriptionEndedIt was cancelled, or grace ran out unpaidreason (cancelled or expired), endedAt; items as in SubscriptionStarted

Dates are ISO 8601 strings. access is what the seller chose the subscriber keeps during grace: keep what the variant gave, or suspend it until SubscriptionRenewed. A subscription that ends at the end of a period it was cancelled in is announced ended then, not when it was cancelled.

Deliveries are retried independently, so they can arrive in any order, and a period's VariantPurchased can arrive before or after its SubscriptionStarted or SubscriptionRenewed. Keep the latest periodEnd per subscription, apply a SubscriptionPastDue only while no later period was paid, and treat SubscriptionEnded as final. Deduplicate SubscriptionStarted and SubscriptionEnded by subscriptionId, SubscriptionRenewed by orderId, and SubscriptionPastDue by (subscriptionId, periodEnd).

CheckoutCompleted

Payload: { "storeId": "<uuid>", "orderId": "<uuid>", "attributes": {}, "buyerInputs": [] }. buyerInputs lists { variantId, label, value } for what your storefront block collected for the order's lines, and none of another plugin's. A body without it means none. This event announces payment. Confirm previously recorded claims without creating a second fulfillment.

CheckoutCancelled

Payload: { "storeId": "<uuid>", "orderId": "<uuid>", "attributes": {} }. This event announces an unpaid checkout ending through cancellation or expiry. Release only claims that are not already confirmed. A payment that lands after a checkout expired can still complete it, and CheckoutCompleted then follows its CheckoutCancelled: keep a released claim, so it can be confirmed. This is rare for a checkout paid through Stripe, whose payment is cancelled before it expires, but it still happens when that cancel could not be made, so treat every provider alike.

Compatible checkout outcome payloads

storeId remains optional for older deliveries. The generated JSON contract also accepts null. An omitted attributes field represents an empty object. Scope writes by the x-novinzo-store-id header, or by storeId on a delivery without the header. For a delivery with neither, find the already-recorded tenant through the order's persisted claim. Never invent a tenant or accept a replacement store from another input.

Attributes contain string values with a maximum length of 2,048 characters each. Only the plugin that prepared the checkout receives its attributes. Other recipients receive {}. Core-owned attributes are excluded.

CheckoutExpired

Payload: { "storeId": "<uuid>", "preparedCheckoutId": "<uuid>", "attributes": {} }. All fields are required. Novinzo announces expiry after none of the prepared checkout's checkouts remains in payment processing. Only the preparing plugin receives its attributes. Other recipients receive an empty object. Key expiry processing by store and prepared checkout. Keep completed fulfillment intact if a later payment arrives.

StoreProfileChanged

Payload: { "storeId": "<uuid>" }. Novinzo sends it when the store's name, currency or storefront URL may have changed, and once when the plugin is installed, so a plugin catches up on changes made while it was not installed. The payload names only the store. Read the profile again with GetStoreProfile rather than trusting the order of deliveries: a retried older delivery can arrive after a newer one. Store-private plugins cannot subscribe to it.

SellerAction

Novinzo announces every dashboard call the store's owner or a member of its team makes on the store: reads and writes, succeeded or failed. A member's call refused because the action is owner-only, or belongs to a part of the dashboard a plugin denied them, is announced as Failed with errorTag PermissionDenied. A plugin's own calls and the storefront's are not announced, nor is a call refused before Novinzo knows the seller and that the store is theirs, such as one without a valid session or naming a store they are not on. Neither is a member's crypto call refused for lack of the crypto permission.

Payload: { "storeId": "<uuid>", "actions": [ … ] }, with 1 to 100 actions, oldest first. Each action has these fields:

FieldJSON typeMeaning
idUUID stringThe action's id, the same on every retry. Deduplicate by it.
sellerIdUUID stringWho called
roleowner or memberWhether they owned the store or were on its team when they called
rpcStringThe call's name, such as ProductUpdate
partStringThe dashboard area it belongs to: account, catalog, themes, integrations, sales or search
kindread or writeWhether the call only answers, or may change something: a record, a session, a secret, an email or message sent
outcomeObject{ "_tag": "Succeeded" }, or { "_tag": "Failed", "errorTag": "…" } with the error the call failed with; Defect for an unexpected failure, Interrupted for a call cut off
occurredAtISO 8601 stringWhen the call ended

An action carries neither the call's payload nor its answer, so it never holds secrets, prices or buyers' details, and it names the seller by id only. Novinzo reads the store's subscriptions as each call starts, in the same query that finds the seller's stores, so a plugin subscribed before a call starts is told of it. Once the call ends, its action is recorded in one write for all subscribed plugins before the call answers. A store without a subscribed plugin is written nothing. If the action cannot be recorded, the call still answers as it ended and Novinzo logs the action; the action is not announced. The relay delivers actions every five minutes, in batches of up to 100 per store and plugin. A plugin that is down has its actions retried behind those already owed, so it does not stop other plugins' deliveries, though a large backlog of its retries can delay them by a few runs.

HourlyTick

Payload: { "storeId": "<uuid>", "hour": "2026-10-30T14:00:00.000Z" }. Novinzo sends it once an hour to each subscribed plugin installed on the store, so a plugin can run timed work without cron triggers of its own. Store-private plugins can subscribe to it, and it is the only way they get scheduled work: Novinzo does not deploy their cron triggers. hour is the UTC hour the tick is for, not the time of delivery. The first relay run of the hour, at the start of the hour or within five minutes of it, queues the tick, and it is usually delivered on that run.

  • A retry, or a backlog when many stores are due at once, can deliver it later in the hour or after it.
  • A delivery whose response was lost can arrive twice. Deduplicate by (storeId, hour).
  • An hour no relay run reached, such as during an outage, is not sent afterwards, and neither is an hour that began while the store's last tick was still waiting in a backlog, or while a tick from more than an hour before was still being retried. The next tick carries the hour it is queued in.
  • A failing tick is retried for about one hour. By then the next one is due.

Keep the last hour handled per store, and on each tick run whatever came due up to hour. Never count ticks to measure time.

Make every handler idempotent

Idempotency means repeated processing produces no additional effect. Use persistent constraints rather than an in-memory set.

  • Include storeId in every purchase key and query.
  • Enforce (storeId, orderId, variantId) uniqueness in storage.
  • Commit durable writes before acknowledging delivery.
  • Make state transitions conditional on their prior state.
  • Keep confirmed states intact when outcomes arrive out of order.
  • Return 500 for transient database or platform failures.

The standalone quickstart supplies a complete D1 schema and Worker. Its purchase insert uses ON CONFLICT DO NOTHING. Its deletion tombstone prevents late purchases from restoring deleted variants. It returns 204 only after D1 completes, and returns 500 on database failures.

Run that example with npm run db:local and npm run dev. Send the same purchase fixture twice, then read the tenant-scoped admin and storefront routes. The fixture token is deliberately fake. These requests test local protocol behavior, not live token authentication or Novinzo delivery retries.

If a handler triggers an external side effect, use a durable operation identifier with the destination's idempotency mechanism. A successful database insert alone does not make an external side effect exactly once. See Testing plugins for concurrency, failure, and staging acceptance exercises.

On this page