Reference plugins
Learn delivery, checkout, storefront, partner and payment integration patterns from Novinzo's first-party plugins.
Novinzo's licenses, coupons and categories plugins use the public HTTP plugin contract. These examples explain their behavior without requiring their implementation source.
Other first-party plugins cover attribution, reviews, resellers, shipping, tax, headless checkout, Discord, fraud protection, sale alerts, payment fees and checkout questions.
Use the quickstart to build your own standalone Worker. You do not need a published Novinzo SDK.
Comparison
| Capability | Licenses | Coupons | Categories |
|---|---|---|---|
| Purpose | Deliver and activate license keys. | Apply coupons and volume discounts. | Group products for storefront navigation. |
| Webhooks | variant-purchased, variant-refunded, variant-deleted, subscription-started, subscription-renewed, subscription-past-due, subscription-ended | checkout-completed, checkout-cancelled | None |
| Functions | ResolveDeliveredKeys, CheckVariantStock, IssueKeys | VerifyPriceAdjustment, SyncSearchRecords | SyncSearchRecords |
| Admin integration | Product-variant settings and an issued-keys page. | Coupon and volume discount management page. | Category management page and product editor slot. |
| Liquid routes | activate-license-key | volume-tiers | all, one, byProduct |
| Storefront public routes | Credential-protected license activation. | Apply and remove coupons; price the cart. | None |
| Platform calls | Delivery ownership, stock reports, credential verification and customer lookup. | Plan updates, product lookup, announcements. | Product lookup and content-change announcements. |
| Additional resources | Persistent license settings, keys and stock. | Coupons, claims, tiers and static assets. | Persistent categories, product assignments and static assets. |
Storefront public routes run through the store's proxy, not a public plugin Worker URL.
All platform callbacks require the inbound invocation token. Binding props and plugin-name headers do not identify the calling plugin.
Licenses
The licenses plugin delivers generated or seller-supplied keys. Each key supports a validity period and usage limit.
Delivery and stock
The plugin handles POST /webhooks/variant-purchased and issues keys for the purchased units. Redelivery reuses previously issued keys rather than generating another delivery.
POST /webhooks/variant-deleted removes the variant's license settings and unsold stock.
POST /webhooks/variant-refunded revokes the keys of an order refunded in full, except a subscription's. A refund that arrives before its purchase is recorded, and the purchase then issues no key.
The subscription events decide whether a subscription's key is valid. It stays valid through each paid period. Once a period is announced past due, the variant's grace access keeps it valid or suspends it until grace ends, and it expires after that. It is never valid again once the subscription has ended.
A revoked key answers activation with the Revoked outcome and shows as revoked on its order, whether its order was refunded or the seller revoked or replaced it from the plugin's page. The page lists issued keys and finds them by key, order id or customer email, which it resolves with CustomerByEmail under customers:read.
The plugin registers delivery ownership with core-for-plugins and reports available stock. A fulfilled purchase reports stock with deliveredOrderId.
A failed required stock report fails the webhook, allowing another delivery attempt. The next attempt reuses the stored keys.
The plugin answers these synchronous calls:
POST /functions/check-variant-stockreturns shortages for requested variants.POST /functions/resolve-delivered-keysreturns an order's delivered keys and statuses.POST /functions/issue-keysreturns keys for a sale another plugin, holdingkeys:issue, made outside the checkout; core passes them to that plugin. See IssueKeys.POST /storefront/activate-license-keyprovides license activation through Liquid PluginBridge.
Use Functions and Calling the platform for the standard payloads.
External activation
An external publisher calls the store's proxy with a store-issued bearer credential. Replace the variables with your store origin, credential and license key:
curl --fail-with-body \
"$STORE_ORIGIN/plugins/licenses/storefront-public/activate-license-key" \
-H "Authorization: Bearer $NOVINZO_API_CREDENTIAL" \
-H 'Content-Type: application/json' \
--data "$(jq -n --arg key "$LICENSE_KEY" '{licenseKey: $key}')"This example uses public curl and jq tools. The store needs the licenses plugin installed and the requested license key already issued.
The storefront forwards the request to /storefront-public/activate-license-key and attaches a platform invocation.
The plugin sends the bearer credential to core-for-plugins:
POST /api/api-access-credentials/verify HTTP/1.1
Host: core-for-plugins.internal
Content-Type: application/json
x-novinzo-plugin-invocation: <unchanged inbound platform token>
{"token":"<store-issued bearer credential>"}The hostname is a placeholder for env.CORE_FOR_PLUGINS.fetch, not a public endpoint.
A successful response contains { "storeId": "<store UUID>" }. The credential belongs to the invocation's plugin and store.
A credential from another store or plugin returns 401 with c4p/ApiAccessCredentialRejected. This is not a storeless credential lookup.
Outages and malformed responses are server failures, not bad credentials. Fail closed and never log the bearer token.
See API keys for this authorization pattern.
Coupons
The coupons plugin creates price adjustments for checkout. A price-adjustment plan is a signed set of cart changes.
Applying a coupon
The storefront sends POST /plugins/coupons/storefront-public/coupon on the store's domain. Novinzo forwards it to POST /storefront-public/coupon.
The JSON body contains code, cart and an optional currentPriceAdjustmentPlan. The cart follows the platform's documented cart contract.
The response includes the new priceAdjustmentPlan, a coupon summary and discountAmount in minor currency units.
The plugin computes the adjustment and calls POST /api/price-adjustment through CORE_FOR_PLUGINS. It forwards the invocation token unchanged.
A coupon for the whole cart is one discount, named by the coupon's id. A coupon limited to chosen products and variants is one discount per cart line it covers. Each names the line's variantId, has an id derived from the coupon and the variant, and carries both in its metadata. A fixed amount is shared between the covered lines in proportion to their totals, and no line's discount is more than the line costs. A cart that holds none of the chosen products is refused with a 422 ApplyCouponError whose reason is NotForThisCart.
Removing a coupon uses DELETE /plugins/coupons/storefront-public/<couponCode> with cart and an optional currentPriceAdjustmentPlan. Novinzo forwards it to DELETE /storefront-public/<couponCode>.
The plugin updates the plan with no coupon instructions and returns the replacement plan. See Storefront for proxy routing.
Checkout admission and outcomes
Core calls POST /functions/verify-price-adjustment to make sure that a discount remains valid.
On cart-changed, the plugin compares current coupon terms and availability. On checkout, it claims usage for the order. A coupon with a discount on several lines is checked and claimed once.
checkout-completed confirms the claim. checkout-cancelled releases an unconfirmed claim.
Both outcome handlers support repeated delivery. A cancellation does not release an already-confirmed claim.
Checkout outcome payloads have an optional storeId. Do not assume every event contains that field.
Other plugins use the documented checkout-expired event to handle expiration. It is separate from the coupons plugin's current subscriptions.
Volume discounts
A volume discount takes a percentage off a cart line once its quantity reaches a tier, with no code. Tiers can be set for every product, one product or one variant; a line takes its variant's, else its product's, else the store's.
Checkout asks for them through POST /storefront-public/cart, which prices them into the plan the same way a coupon does.
The plugin serves the coupons/volume-tiers@1 theme block. It reads GET /storefront/volume-tiers through the coupons.volume-tiers Liquid route, which looks the product up through core for its variants' prices. Setting or removing tiers announces a storefront content change, so cached product pages show the new tiers.
Categories
The categories plugin stores category records and product assignments. It reads product details from core-for-plugins instead of duplicating the product catalog.
Liquid routes
The plugin exposes POST /storefront/all, POST /storefront/one and POST /storefront/byProduct to Liquid PluginBridge.
List categories in a store theme:
{% plugin "categories.all" as nz_categories %}
{% for category in nz_categories %}
<p>{{ category.name | escape }}</p>
{% endfor %}The all payload is {}. The response contains category records with productIds.
The one payload is { "slug": "<category slug>" }. Its response contains category and hydrated products.
The byProduct payload is { "productId": "<product UUID>" }. Its response lists that product's categories.
These are server-rendered plugin calls, not public browser endpoints. See Storefront for Liquid arguments and response handling.
Assets and content changes
The plugin serves static JavaScript and Liquid theme blocks through its asset routes. Assets are tenant-independent and do not contain store secrets.
After an admin write commits, the plugin calls POST /api/store-content/changed. This announcement invalidates cached storefront content.
The categories integration logs a failed announcement without undoing the committed write. Cached pages then refresh when they expire.
Its admin page manages categories. Its product slot manages assignments in the product editor.
Other first-party plugins
Novinzo runs eleven more plugins on the same contract. Each one demonstrates a capability the plugins above do not use.
| Plugin | Code | Permissions | Demonstrates |
|---|---|---|---|
| Affiliates | affiliates | orders:read | Order attribution by visitor id. |
| Reviews | reviews | customers:email, orders:read | Order-viewer routes, theme blocks, review migration and reviews by order id. |
| Resellers | resellers | customers:read, emails:send, products:read, products:write, sales:write, products:deliver, keys:issue | Partner screens, plugin email, catalog writes and reported sales and orders. |
| Physical goods | physical-goods | orders:read, deliveries:write, emails:send, replacements:write, returns:write, refunds:write, products:deliver | Shipping quotes, parcel reports, and swaps, returns and refunds of shipped order lines. |
| Tax | tax | None | Tax quotes for checkout from the store's VAT settings. |
| Headless checkout | headless-checkout | checkout:write, orders:read | Prepared checkouts and plugin-owned webhook events. |
| Discord | discord | products:read, orders:read | An OAuth flow finished through the platform's callback, and alerts on order and stock events. |
| Fraud protection | antifraud | orders:read | Refusing a checkout with AdmitCheckout, and learning from payment events and the hourly tick. |
| Sale alerts | notifications | emails:send, orders:read, push:send | A notice to the store's own sellers, on their phones and by email, for each paid order. |
| Payment fees | payment-fees | payments:read | A surcharge per payment method with QuotePaymentSurcharges. |
| Checkout questions | checkout-questions | prices:adjust | Buyer inputs from a checkout block, verified on the plan, and a required answer enforced by AdmitCheckout. |
A seller creating a store chooses which of Novinzo's plugins it starts with. Unless they choose, it starts with licenses, categories, coupons, affiliates, reviews and resellers. The others start off, and a seller can install any of them later from Settings > Apps.
Affiliates
The storefront's /r/<code> referral redirect reports each arrival to the plugin's POST /storefront/clicks route over PluginBridge. The plugin records which visitor arrived on which link.
Its admin screen manages affiliates and links. Link statistics call CompletedByVisitorIds to learn which of the store's completed orders carry those visitor ids.
Reviews
Shoppers review what they bought through /storefront-order/reviews, reached only through the order-viewer route. The plugin reads the order back from Viewed order instead of trusting the browser. See Storefront for order-viewer routing.
It serves the reviews/product-reviews@1 and reviews/order-reviews@1 theme blocks and announces storefront content changes after moderation. Its admin screen also fills the overview slot, so sellers can add a reviews widget to their store overview.
Its admin API publishes a buyer's review of a line of an order the store's own server names, at POST /admin/reviews/orders/:orderId. The plugin reads the order back from Order by id, so only a paid order of the store is reviewed, and a line keeps one review whichever surface sent it.
It also answers ImportMigratedReviews during store migration, keeping one review per key so a retried step adds nothing. Its admin API imports such reviews from the store's own server too, at POST /admin/reviews/import, under the same keys; there the plugin checks each product and variant through ProductsById and skips one that is not the store's.
Resellers
The resellers plugin sells keys through resellers. Sellers configure it on its admin screen, and resellers work in its partner screen at /dashboard/reselling.
Partner routes check the account's reseller membership in the store named by x-novinzo-partner-store-id before acting for it. The plugin emails invites, statements and account notices with SendEmail, and can create a credit product with CreateProduct.
It subscribes to variant-purchased, variant-refunded, variant-deleted and store-profile-changed. Resellers' own servers call its reseller API on the store domain under /storefront-public. See Resellers.
Physical goods
The seller turns the plugin on for the variants it ships, in the product-variant-delivery slot, and it records that it delivers them with DeliverVariant. It answers QuoteShipping with the rate the seller set for the buyer's destination.
A variant-purchased for a variant it ships puts the line on its list of orders to ship, and a variant-deleted stops shipping the variant. The seller marks parcels sent from that list or the order's order slot. The plugin reports each one with OrderLineDeliveryReport and emails the buyer when it leaves.
Buyers ask for swaps and returns on the order page, through the physical-goods/order-returns@1 theme block and the plugin's /storefront-order routes. The seller handles them on the plugin's page. The plugin holds and sends replacements, puts returned units back in stock and refunds them through the order line replacement, return and refund RPCs.
Tax
The plugin keeps each store's VAT settings and answers QuoteTax from them, taxing shipping and the payment method's surcharge at the rate of the goods. A store without saved settings is charged no tax, and a buyer outside the EU VAT area pays none. It asks for no permission, since the quote carries everything it prices.
Headless checkout
A merchant's server calls /storefront-public/v1/checkout-sessions with a store-issued API key; see Checkout from your own site. The plugin prepares checkouts with PreparedCheckoutCreate.
It subscribes to checkout-completed and checkout-expired. It publishes CheckoutSessionCompleted and CheckoutSessionExpired with WebhookEventPublish, so the store's own webhook endpoints receive them.
Its admin screen explains which events to subscribe the store's webhooks to. The plugin keeps no settings.
Discord
The plugin connects a store to its Discord server through the store's own bot: the seller creates a Discord application, saves its bot token and client credentials on the plugin's page, and connects a server the bot is in.
A buyer links their Discord account on the order page, through the plugin's /storefront-order routes. Discord returns the browser to the backend's /plugin-oauth/discord/callback, which hands only the query to the plugin's GET /oauth-callback; see the security checklist for that surface.
It subscribes to checkout-completed, order-refunded, payment-disputed and variant-stock-changed. A paid order gives the linked buyer the roles the seller set for what they bought, and a full refund or a dispute takes them back. When the seller picked a channel, the bot also posts there for each paid order and each product back in stock, as each alert is switched on. Giving and taking roles are idempotent, so a redelivery changes nothing.
Fraud protection
The plugin scores each checkout paid in a way that can be charged back, PayPal and payment plugins included, through AdmitCheckout. Every store starts in shadow mode, where it only scores. Once the seller turns refusing on, it refuses buyers whose cards keep being declined, and the riskiest checkouts once its model has proven it can. The seller's block list refuses even in shadow mode. Any failure of its own admits the checkout, so the plugin is never why a buyer cannot pay.
It learns what became of each scored order from checkout-completed, payment-disputed, payment-fraud-warned and payment-attempted, and keeps each store's rate of bad orders on hourly-tick. Each event changes what it keeps only the first time it is applied.
Sale alerts
The plugin subscribes to checkout-completed. Unless the seller turned its phone alert off, it tells the store's team about the order on their phones with SellerOrderPushSend. Core writes that notification and sends it at most once per order. When the seller has turned its email alert on, it also reads the paid order with OrderDetails and emails the store's team with SendEmailToSellers.
The order id is the email's idempotencyKey, so a redelivered webhook sends no second email. Core resolves the team's addresses; the plugin never sees them. The alert lists the items, the total and the payment method, and does not name the buyer.
Its admin screen holds the two settings. A store that withheld push:send gets no phone alert, and one that withheld orders:read or emails:send gets no email; the webhook is still accepted.
Payment fees
The seller sets a fee on each of the store's payment methods, which the plugin's page lists with PaymentConnections.List under payments:read. The plugin answers QuotePaymentSurcharges from the saved fees alone, and a payment method without a saved fee carries none.
Checkout questions
The seller writes up to 10 questions per product in the plugin's product slot, each optional or required. The plugin serves the checkout-questions/checkout-questions@1 theme block for the checkout page; the starter theme places it, and a custom theme adds it to templates/checkout.liquid inside <nz-checkout-form>, which shows the questions in its card among its own fields.
The block reads the cart the form priced (pricedCart), asks the plugin which questions its lines carry, and sends the buyer's answers to the plugin's public route. The plugin keeps only answers to questions the line's product asks, records them as buyer inputs with UpdatePlan, and the block hands the plan to checkout. It sends them again after a cart edit drops the plan. Core stores each answer on its order line, where the seller reads it.
Core asks it to verify each plan that carries its answers (VerifyPriceAdjustment). It refuses answers to questions the line's product no longer asks, and a line that answers something but not a required question.
It also subscribes to admit-checkout, because a buyer who answered nothing has nothing on the plan to verify. AdmitCheckout tells it the buyer inputs it collected, and it refuses the checkout with a message naming the first required question that has no answer. A payload without buyerInputs is admitted: core leaves the field out when there is nothing to judge, such as for a prepared checkout, which takes no plan.
