Calling the platform
Call Novinzo through service-binding HTTP requests for products, orders, customers, email, discounts, stock and storefront caches.
Core-for-plugins (c4p) is Novinzo's HTTP API for plugin Workers. It accepts JSON over a Cloudflare service binding. No private client package is required.
Reaching core-for-plugins
Coordinate registration and service-binding provisioning with Novinzo. Novinzo supplies the service name for your environment. There is no public self-service provisioning API.
Replace the service placeholder with the name Novinzo supplies. The binding name stays CORE_FOR_PLUGINS in every environment.
{
"name": "acme-plugin",
"main": "src/index.js",
"compatibility_date": "2026-10-01",
"workers_dev": false,
"preview_urls": false,
"services": [{ "binding": "CORE_FOR_PLUGINS", "service": "<supplied by Novinzo>" }],
}The hostname https://core-for-plugins.internal is a placeholder. The binding receives the request instead of public DNS.
Binding props do not authenticate callers. Neither c4p nor backend RPC uses x-novinzo-plugin-name for identity, including in development.
Authentication
Novinzo attaches x-novinzo-plugin-invocation to plugin requests. This signed invocation token identifies your plugin and store. Tokens expire after 15 minutes.
Only Novinzo holds the signing secret. Forward the inbound token unchanged during the current invocation. Never mint tokens or cache them across requests.
Store-scoped endpoints require a current installation and the endpoint's permission, listed under Endpoints. A missing grant fails with reason PluginPermissionNotGranted. Background and cron jobs have no store access without a current platform invocation.
Order-viewer endpoints require an order-viewer invocation, which also names an authorized order. A store-only token does not grant access to them.
Authentication failures return c4p/UnexpectedError without revealing whether a store exists:
{ "_tag": "c4p/UnexpectedError", "reason": { "_tag": "PluginStoreNotAuthorized" } }reason._tag | Cause |
|---|---|
PluginInvocationMissing | No invocation header. |
PluginInvocationRejected | Invalid or expired invocation. |
OrderViewerInvocationRequired | The endpoint requires an order-viewer invocation. |
PluginStoreNotAuthorized | No current installation on the invocation store. |
PluginPermissionNotGranted | The installation lacks the required permission. |
PluginStoreLookupFailed | Installation lookup failed. |
ApiAccessCredentialLookupFailed | Credential lookup failed. |
Read the reason from the body, not the status. These failures answer 500 today. A later release answers 401 for the first two reasons and 403 for the next three, with the same body.
VerifyApiAccessCredential also requires an invocation. A credential from another store or plugin returns 401 c4p/ApiAccessCredentialRejected.
The client
Use the binding's Fetch API directly. This complete Worker reads product names for a platform-dispatched admin request.
It narrows both request data and the response fields it consumes. It does not decode fields it does not use.
const uuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
const record = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
export default {
async fetch(request, env) {
if (new URL(request.url).pathname !== "/admin/product-names") {
return new Response("Not found", { status: 404 });
}
if (request.method !== "POST") return new Response("Method not allowed", { status: 405 });
const invocation = request.headers.get("x-novinzo-plugin-invocation");
if (!invocation) return new Response("Missing invocation", { status: 401 });
let ids;
try {
ids = await request.json();
} catch {
return new Response("Invalid JSON", { status: 400 });
}
if (
!Array.isArray(ids) ||
ids.length > 100 ||
!ids.every((id) => typeof id === "string" && uuid.test(id))
) {
return new Response("Expected up to 100 product UUIDs", { status: 400 });
}
try {
const response = await env.CORE_FOR_PLUGINS.fetch(
"https://core-for-plugins.internal/api/storefront/products/by-id",
{
method: "POST",
headers: {
"content-type": "application/json",
accept: "application/json",
"x-novinzo-plugin-invocation": invocation,
},
body: JSON.stringify(ids),
},
);
if (!response.ok) return new Response("Product lookup failed", { status: 502 });
const products = await response.json();
if (
!Array.isArray(products) ||
!products.every(
(product) =>
record(product) &&
typeof product.id === "string" &&
uuid.test(product.id) &&
typeof product.name === "string",
)
) {
return new Response("Invalid product response", { status: 502 });
}
return Response.json(products.map((product) => ({ id: product.id, name: product.name })));
} catch {
return new Response("Product lookup unavailable", { status: 502 });
}
},
};The example's 100-item limit is a local request bound, not a platform limit. The API reference documents complete response schemas and errors.
Credential lookup needs separate rejection and outage handling. See API keys for a complete example.
GET /health requires no authentication. It does not grant store access.
Endpoints
| Endpoint | Method and path | Scope and required permission |
|---|---|---|
| ProductsById | POST /api/storefront/products/by-id | Store |
| CompletedByVisitorIds | POST /api/storefront/orders/completed-by-visitor-ids | Store, orders:read |
| List | GET /api/storefront/orders | Store, orders:list |
| OrderById | GET /api/storefront/orders/:orderId | Store, orders:read |
| AddNote | POST /api/storefront/orders/:orderId/notes | Store, orders:annotate |
| Viewed | GET /api/storefront/orders/viewed | Order viewer |
| Current | GET /api/storefront/customer | Store, customers:read |
| UpdatePlan | POST /api/price-adjustment | Store |
| VerifyApiAccessCredential | POST /api/api-access-credentials/verify | Store |
| DeliverVariant | PUT /api/product-deliveries/variants/:variantId | Store |
| StopDeliveringVariant | DELETE /api/product-deliveries/variants/:variantId | Store |
| SetVariantStock | PUT /api/product-deliveries/variants/:variantId/stock | Store |
| AnnounceChange | POST /api/store-content/changed | Store |
| GetStoreProfile | GET /api/store-profile | Store |
| CustomerById | GET /api/customers/:customerId | Store, customers:read |
| CustomerByEmail | GET /api/customers/by-email | Store, customers:read |
| List | GET /api/customers | Store, customers:list |
| List | GET /api/payment-connections | Store, payments:read |
| SendEmail | POST /api/emails | Store, emails:send |
| SendEmailToSellers | POST /api/emails/sellers | Store, emails:send |
| ListVariants | GET /api/catalog/variants | Store, products:read |
| CreateProduct | POST /api/catalog/products | Store, products:write |
| PublishProduct | POST /api/catalog/products/:productId/publish | Store, products:write |
| RecordSales | POST /api/sales/entries | Store, sales:write |
| RecordOrders | POST /api/sales/orders | Store, sales:write |
| RecordPrepaidCreditLines | POST /api/sales/prepaid-credit-lines | Store, sales:write |
| SetInjections | PUT /api/storefront/injection | Store, storefront:inject |
| ClearInjections | DELETE /api/storefront/injection | Store, storefront:inject |
| SaveRecords | PUT /api/search/records | Store |
| RemoveRecords | POST /api/search/records/remove | Store |
| SyncRecords | POST /api/search/records/sync | Store |
For permission-gated backend calls, see Backend RPC.
Products
ProductsById takes a JSON array of product UUIDs. It returns products with variants, images and SEO metadata. Products from other stores are omitted.
Orders by visitor ids
CompletedByVisitorIds returns charged orders with status paid, shipped or completed, oldest charge first.
This endpoint requires a current orders:read grant.
Send this JSON body with the invocation header:
{
"visitorIds": ["e6552c52-0337-4d65-8bc3-36cb8c87e2fd"],
"completedBetween": { "from": "2026-01-01T00:00:00.000Z", "to": "2026-02-01T00:00:00.000Z" }
}Each result contains orderId, visitorId, charged and completedAt. Money uses { "amountMinorUnits": "1999", "currency": "USD" }.
charged is the amount paid after discounts. Limit each call to 1000 unique visitor UUIDs and a window of 400 days.
Checkout accepts x-novinzo-visitor-id and stores it as the visitor_id order attribute. Join it to your attribution records.
Order list
GET /api/storefront/orders returns the store's orders, newest first. It requires orders:list; orders:read does not grant it.
Each order contains orderId, status, customer (id and email), total, createdAt, paidAt, lines and adjustments. total is what the buyer was charged, or the sum of the lines while no payment has charged the order. paidAt is null until a payment completes. Each line contains productId, productVariantId, productName, variantName, quantity and total, its unit price times its quantity.
adjustments lists the order's price adjustments, ordered by type (charge, discount, included_tax, shipping, surcharge, tax), each with type, description (or null), amount and productVariantId: a discount, on the line of productVariantId when it was taken off one, a charge line a plugin added to the line of productVariantId, the payment method's surcharge, or the shipping, tax and included_tax a plugin quoted for the order. productVariantId is null for one on the whole order. A charged total is the lines' totals plus the charge lines, shipping, tax and surcharges, less the discounts. included_tax is tax already inside the prices and adds nothing.
Every query parameter is optional:
| Parameter | Meaning |
|---|---|
createdAfter | Keep orders placed at or after this ISO time. |
createdBefore | Keep orders placed before this ISO time. |
status | Keep orders with this status: draft, paid, shipped, completed or cancelled. |
limit | Orders per page, 1 through 100. The default is 50. |
cursor | The nextCursor of the previous page. |
The response is { "items": [...], "nextCursor": "..." }. Pass nextCursor back as cursor, with the same filters, for the next page. Only a null nextCursor means the last page: a page can hold fewer orders than limit. Orders placed while you page are newer than the first page, so later pages never repeat or skip an order. Start again without a cursor to see them.
Orders the store removed are left out. 503 OrdersUnavailable means the orders could not be read.
Order by id
GET /api/storefront/orders/:orderId reads one of the store's orders by its id. It requires orders:read.
It returns orderId, paid, customer (id and email) and lines, oldest first. paid is true for an order with status paid, shipped or completed. Each line contains orderItemId, productId, productVariantId, productName, variantName and quantity. productName and variantName are the product's and variant's current names in the store, not the names at the time of purchase.
An order of another store, a removed order and an id no order has all return 404 OrderNotInStore. 503 OrdersUnavailable means the order could not be read.
Order notes
POST /api/storefront/orders/:orderId/notes adds a note in your plugin's name to one of the store's orders. It requires orders:annotate, which does not let the plugin read the order.
{ "level": "warning", "message": "Refund requested by the buyer:\nkey never arrived" }level is info, warning, success or error, and colours the note. message is plain text of 1 through 500 characters, not blank, whose only control characters are line breaks. The dashboard shows it as text, never as markup.
The seller reads the note in the order's timeline under your plugin's name. The buyer never sees it. The response contains the note's noteId and createdAt.
Your plugin can add at most 100 notes to one order; notes of other plugins do not count. Past that, the call returns 429 OrderNotesLimitReached with the orderId and the limit, and writes nothing.
An order of another store, a removed order and an id no order has all return 404 OrderNotInStore. 503 OrdersUnavailable means the note was not written.
Viewed order
GET /api/storefront/orders/viewed reads only the order named by the current order-viewer invocation. Send no request body.
It returns orderId, paid, customer and items. Items contain order-item, product and variant identifiers, names and quantities.
customer.email is null unless the seller grants customers:email, customers:read, customers:list, orders:read or orders:list. The customer id remains available.
A store-only invocation fails with reason OrderViewerInvocationRequired. Do not substitute backend order lookup for shopper-facing authorization.
Signed-in customer
GET /api/storefront/customer answers the customer the storefront visitor whose request you handle is signed in as: { "customer": { "id", "email", "emailVerified" } }, or { "customer": null } for a guest. It requires customers:read.
The customer comes from the invocation the storefront minted for a request to your public routes, never from your request. Every other invocation, such as a webhook's or a theme render's, names no visitor and answers null, as does a customer the store has since removed. 503 CustomersUnavailable means the customer could not be read.
Price adjustment plans
A price adjustment plan is a signed token of discounts and charge lines for one cart. Checkout binds it to the cart and asks issuing plugins to VerifyPriceAdjustment.
UpdatePlan takes currentPriceAdjustmentPlan, cart, instructions and, optionally, buyerInputs. Send big integers as decimal strings, not JSON numbers.
This complete wire payload adds one discount to one cart:
{
"currentPriceAdjustmentPlan": null,
"cart": {
"items": [
{
"variantId": "e6552c52-0337-4d65-8bc3-36cb8c87e2fd",
"productName": "Example product",
"variantName": "Standard",
"pricePerUnitWhenAdded": { "amountMinorUnits": "1999", "currency": "USD" },
"pricePerUnit": { "amountMinorUnits": "1999", "currency": "USD" },
"quantity": 1,
"imageUrl": "https://example.com/product.png",
"addedAt": "2026-10-01T00:00:00.000Z"
}
]
},
"instructions": [
{
"type": "discount",
"actorAdjustmentId": "d09f5b85-7496-4a27-b5a5-e5f661d8d070",
"description": "Coupon discount",
"metadata": { "couponCode": "WELCOME" },
"amountInMinorUnits": "100",
"orderItemId": null
}
]
}Use your actual cart and authorized discount records. Never trust a shopper's requested discount amount.
Charge lines
A charge line adds to what the buyer pays for one cart line: an extended warranty, an add-on, a gift-wrap fee or a pay-what-you-want top-up the buyer chose in your storefront block. Send it as an instruction of type charge:
{
"type": "charge",
"actorAdjustmentId": "5c0e7f2a-3b9d-4e1c-8a6f-2d4b9e7c1a35",
"description": "Extended warranty (2 years)",
"metadata": { "years": 2 },
"amountInMinorUnits": "499",
"variantId": "e6552c52-0337-4d65-8bc3-36cb8c87e2fd"
}variantIdnames the cart line. A checkout holds each variant on one line, and the order records the charge against the order line it creates for it.amountInMinorUnitsis a positive integer in the line's currency, at most the highest price the store can sell at in that currency (999,999.99 for most currencies).descriptionis 1 to 100 characters. The buyer reads it beside the amount on the checkout summary, and the seller beside the line on the order.- A cart line carries at most 5 charge lines, whichever plugins add them.
- One plugin cannot name the same
actorAdjustmentIdtwice in a plan.
Core refuses a plan that breaks one of these rules with c4p/UnexpectedError, its reason._tag naming the rule: ChargeForMissingLine, DiscountForMissingLine, ChargeAboveMaxPrice, TooManyChargesForLine or AdjustmentRepeated. Checkout refuses the same plan with CheckoutError code PRICE_ADJUSTMENTS_OUTDATED.
The buyer pays the subtotal plus every charge line, less every discount, plus the payment method's surcharge, which is priced on the goods with their charge lines. A discount can cover the goods and leave the charge lines to pay; checkout refuses only a cart that leaves nothing to charge. A charge line is part of the goods: a refund of the goods returns it, with its share of the surcharge.
Handing the plan to checkout
The checkout page's nz-checkout-form pays with one plan. Your storefront block hands it the plan UpdatePlan answered with as a window event:
const form = document.querySelector("nz-checkout-form");
// The cart the page pays for, as the server priced it: the `cart` UpdatePlan takes.
const cart = form?.pricedCart ?? null;
// Build on the form's plan, so the coupon's and other plugins' items stay in it.
const currentPriceAdjustmentPlan = form?.priceAdjustmentPlan ?? null;
const plan = await updatePlanThroughYourWorker({ currentPriceAdjustmentPlan, cart, instructions });
window.dispatchEvent(new CustomEvent("nz:price-adjustment-plan", { detail: plan }));pricedCartis null until the server has priced the cart, whichever the page pays for: the stored cart, a Buy Now line, a checkout link or a prepared checkout. The form announces each pricing, on load and after each line edit, with the window eventnz:checkout-cart-priced, itsdetailthe same cart. Each pricing hands over a new object, so compare it by identity after your request returns: a plan signed for a cart the page no longer holds is refused at checkout, so do not hand it over.- The form pays with the last plan handed to it, so a plan built on an older one drops what was added since. Read
priceAdjustmentPlanjust before callingUpdatePlan. - The summary, each payment method's surcharge and the card form price the plan's charge lines and discounts at once. Checkout prices the plan again, so what the form shows is a preview.
- The form ignores a plan handed over while it reprices an edited cart, applies or removes a coupon, or takes a payment. It says nothing when it does, so read
priceAdjustmentPlanafterwards and hand the plan over again if it is not the one in hand. - A plan the form already pays with changes nothing when handed over again: what the buyer was last told, such as why Pay was refused, stays on screen.
- When the buyer presses Pay, the form announces it with the window event
nz:checkout-startingbefore it starts the checkout. A block that still has a plan to hand over, such as one that sends what the buyer types after a pause, callsevent.detail.waitUntil(promise)while the event is dispatched, with a promise that settles once the form'spriceAdjustmentPlanis the plan to pay with. The form shows Pay as busy, takes plans handed over meanwhile, and starts the checkout once every such promise has settled, fulfilled or rejected, or after 5 seconds, with the plan it then holds. If your block could not put what the buyer gave it on the plan, tell the buyer and fulfil the promise withfalse: the checkout then does not start, and the buyer presses Pay again. The buyer can still edit the cart during the wait; the form drops a press whose cart is being repriced when the wait ends, and tells the buyer to pay again. - Whenever its plan changes, the form announces it with the window event
nz:price-adjustment-plan-applied, itsdetailthe plan. A cart edit drops the plan, as it was signed for the old cart:detailis thennull. AskUpdatePlanagain for the new cart, withcurrentPriceAdjustmentPlannull, and hand that plan over.
Deliver what a charge line pays for from your own record of the checkout claim, never from what the storefront tells you. Core asks you to verify the line for the order before payment opens, and announces the order paid with CheckoutCompleted or cancelled with CheckoutCancelled.
Buyer inputs
Your storefront block can ask the buyer something for a cart line, such as a Discord username, a gift message or a custom-field answer, and record it on the order through the plan:
{
"buyerInputs": [
{
"variantId": "e6552c52-0337-4d65-8bc3-36cb8c87e2fd",
"label": "Discord username",
"value": "buyer#0001"
}
]
}labelis 1 to 80 characters andvalue1 to 500. Core stores them as text; validate kinds such as numbers, emails or links in your block before sending them.variantIdnames the cart line. A cart line carries at most 10 buyer inputs, whichever plugins collect them. A plan breaking either rule fails with reasonInputForMissingLineorTooManyInputsForLine.- Buyer inputs replace your plugin's earlier ones, as instructions do. Omit the field, or send an empty array, to record none.
- The order records each input on its line. The seller sees it under the line on the order page, and your plugin, and only yours, receives it in VariantPurchased and CheckoutCompleted.
- A plan carrying your buyer inputs makes checkout ask you to verify them, even when your plugin added no adjustment.
- Checkout asks you to verify only a plan that holds something of yours, so a buyer who skips your block is never verified. To require an answer, subscribe to AdmitCheckout: every checkout asks it, its
buyerInputslists what your block collected, and you refuse the checkout when a required answer is missing.
The protocol has these rules:
- Instructions replace all previous items from your plugin. An empty array removes them. Other plugins' items remain.
- The actor is always
plugin/<your code>. You cannot write another plugin's adjustments. - The plan binds to the invocation store and cart hash. A mismatch fails with
PriceAdjustmentPlanNotForCartinsidec4p/UnexpectedError.reason. - An undecodable plan fails with reason
unexpected. Success returns the re-signed plan as a JSON string. actorAdjustmentIdandmetadatareturn unchanged inVerifyPriceAdjustment. Re-evaluate the adjustment against your records.
On a discount, description and orderItemId accept null or omission. amountInMinorUnits is a positive integer encoded as a string.
A discount taken off one cart line, such as a volume discount, names that line with an optional variantId. The order records it against the line, and checkout shows it on that line. Leave variantId out for a discount on the whole cart, such as a coupon. A variantId the cart has no line for fails with reason DiscountForMissingLine.
Product deliveries and plugin-owned stock
A delivery record identifies a variant's delivering plugin. Core calls CheckVariantStock before payment and ResolveDeliveredKeys when rendering orders.
Core freezes delivery details onto order lines at payment. Later configuration changes do not rewrite order history.
| Endpoint | Behavior |
|---|---|
DeliverVariant | Creates your delivery record idempotently. No request body. Success is 204. |
StopDeliveringVariant | Removes only your record and releases your stock ownership transactionally. Other plugins' deliveries of the variant stay. No request body. Success is 204. |
SetVariantStock | Reports absolute stock and claims ownership. JSON request body. Success is 204. |
All three return 404 VariantNotInStore for variants outside the invocation store or deleted variants.
Record failures return 503 ProductDeliveriesUnavailable. DeliverVariant also returns 409 VariantDeliveredByWebhook when an existing webhook delivers the variant.
Create the delivery record before saving enabled settings. Remove it after disabling settings. Missing settings then refuse checkout instead of bypassing delivery.
Owning a variant's stock
Send this JSON body to PUT /api/product-deliveries/variants/:variantId/stock:
{
"stockOnHand": 42,
"revision": 17,
"deliveredOrderId": "d09f5b85-7496-4a27-b5a5-e5f661d8d070"
}stockOnHand accepts integers from 0 through 2147483647, or null for unlimited stock. revision accepts integers from 1 through 2147483647.
Omit deliveredOrderId for reports unrelated to an order. Include it after delivering a paid order's variant.
Stock ownership follows these rules:
- A live delivery record is required. Another plugin's ownership causes
409 VariantStockNotOwned. - The first accepted report claims ownership. Sellers cannot edit stock while your plugin owns it.
- Core applies only increasing revisions. Older reports leave the count unchanged but still settle
deliveredOrderId. - Revisions survive ownership changes. Persist the counter and continue increasing it after reclaiming ownership.
- Counts are absolute. Core subtracts open checkout reservations and paid orders still awaiting delivery.
- Ownership, revision, settlement and stock updates run in one transaction under the variant lock.
The awaiting_delivery lifecycle has four steps:
Payment moves those units to awaiting_delivery. They remain held because your count still
includes them.
Handle VariantPurchased, commit delivery, then report
the new count with deliveredOrderId. Report separately for each delivered variant.
Stopping delivery releases ownership. Undelivered paid orders become ordinary sales against your last count, and the seller manages stock again.
Persist issued deliverables so webhook redelivery does not issue them twice. Report after your own transaction commits.
Fail the webhook if a transient stock report fails. Redelivery then repeats the report without repeating delivery.
After a completed sale, VariantNotInStore and VariantStockNotOwned are terminal refusals. They indicate removed variants or ownership, not a transient outage.
Store content
Call POST /api/store-content/changed after committing data used by storefront pages. Send no request body. Success is 204.
An announcement before commit can cache old data as current. 503 StoreContentUnavailable means Novinzo neither announced the change nor recorded it for later.
Choose failure handling explicitly for your feature. If stale pages are acceptable until cache expiry, preserve the committed write and report the announcement failure.
Store profile
GET /api/store-profile returns the invocation store's public identity. It needs no permission, because nothing in it is private to the seller.
| Field | Meaning |
|---|---|
storeId | The store's UUID. |
name | The store's name. |
currency | The currency of every price and amount in the store, as an ISO code. |
storefrontUrl | The storefront origin on the store's platform subdomain, without a trailing slash. It serves the store even when a custom domain is set. |
currencyChanges | Every change of the store's currency, oldest first. See below. |
Each currency change contains id, from, to, rate and changedAt. Novinzo moved the store and its prices from from to to at changedAt. rate is how many units of to one unit of from was worth that day, as an exact decimal string: the rate the seller confirmed when prices were converted, or the day's market rate when they kept their amounts. Carry what your plugin holds in from, such as balances, over to to at rate. A store that never changed currency answers an empty list.
503 StoreProfileUnavailable means the profile could not be read.
Customers
GET /api/customers/:customerId returns one of the store's customers. It requires customers:read.
The response contains id, email and emailVerified. emailVerified is true once the customer proved ownership of the address with a code sent to it.
A customer of another store returns 404 CustomerNotInStore, exactly as for an id that does not exist. 503 CustomersUnavailable means the lookup failed.
GET /api/customers/by-email?email= returns the store's customer with that email address, compared without regard to case. It requires customers:read and answers the same fields. An address that is not a customer of the store returns 404 CustomerEmailNotInStore, whether or not another store has it.
GET /api/customers returns the store's customers, newest first. It requires customers:list; customers:read does not grant it. Each customer contains id, email, emailVerified, createdAt and paidOrderCount, the number of their orders with status paid, shipped or completed. Customers the store removed are left out.
It pages like the order list: createdAfter, createdBefore, limit and cursor work the same way, and 503 CustomersUnavailable means the list could not be read.
Payment connections
GET /api/payment-connections returns the payment methods the store has connected and enabled, oldest first. It requires payments:read.
Each connection contains connectionId, provider and label. connectionId is the id QuotePaymentSurcharges names the connection by. provider is the provider's id, such as stripe, paypal or crypto, and plugin for a method a plugin runs; treat a value you do not know as another provider. label is the name the seller knows the method by.
A connection the seller disabled or removed is left out. So is store credit, which never carries a payment method surcharge. The response holds no credential or account detail.
503 PaymentConnectionsUnavailable means the list could not be read.
Emails
POST /api/emails and POST /api/emails/sellers queue plain transactional email in the store's name. Both require emails:send; read Sending email before requesting it.
Both endpoints take the same content fields. Novinzo strips control characters, trims each field and escapes it into its own template:
| Field | Rule |
|---|---|
subject | Required, 1 through 150 characters. |
preheader | Optional inbox preview line, at most 200 characters. |
heading | Required, 1 through 150 characters. |
paragraphs | Required, 1 through 20 paragraphs of at most 2000 characters each. |
action | Optional button: label of at most 60 characters and an absolute https: url without credentials. |
footer | Optional, at most 500 characters. |
SendEmail also takes to, a single address, and an optional reason of invite or account-notice. Without a reason, to must be one of the store's customers or team members. It returns { "emailId": "<id>" }.
SendEmailToSellers takes an optional audience of team, the default, or owner. The team is the owner and the members who may open your app: a member the owner keeps out of it, or out of an area your granted permissions reach, such as orders, gets nothing. Novinzo resolves the verified addresses itself and returns emailIds and the recipients count, never the addresses.
Both accept an optional idempotencyKey of 1 through 128 characters from A-Z, a-z, 0-9, ., _, : and -. A retry with the same key and email returns the first send's id without sending again. The same key with different content fails.
| Status | Error | Meaning |
|---|---|---|
403 | EmailRecipientNotAllowed | SendEmail without a reason to an address that is not the store's customer or team member. |
409 | EmailIdempotencyKeyReused | The key was used for a different email. The earlier email stands. |
429 | EmailRateLimited | The store's budget is spent. retryAfterSeconds says when to try again. |
503 | EmailsUnavailable | Nothing was queued. |
Each store can queue 200 plugin emails per hour, shared by all its plugins. At most 50 of them can go to addresses the store does not know, which covers sends with a reason and refused sends.
Novinzo delivers accepted email from its outbox, normally within minutes.
These emails always go from Novinzo's sender in Novinzo's template. A plugin that writes the store's order confirmation email whole does it through RenderOrderEmail, only once the store sends from its own domain, which the plugin sets up through the sending domain RPCs with emails:customize.
Catalog
The catalog endpoints let a plugin read the store's live variants and add new products. A plugin never changes or removes an existing product through them.
GET /api/catalog/variants requires products:read. It lists the store's live variants, without archived or deleted ones, ordered by product name and then the seller's variant order. It returns at most 100 variants. Each variant has deliveredByPluginCode: the plugin whose delivery hands it to a buyer, or null when a file, text, the seller's server, a shipped item or nothing delivers it first. Pass deliveredBy=<plugin code> to list only the variants that plugin delivers.
Pass an optional search query of at most 63 characters to keep only variants whose product or variant name contains it, ignoring case. Each result contains variantId, variantName, productId, productName and unitPriceMinor, the price in the store currency's minor units.
POST /api/catalog/products requires products:write. Send a product with 1 through 10 variants:
{
"name": "Reseller credit",
"description": "Credit for resellers",
"variants": [{ "name": "100 credits", "unitPriceMinor": 1000 }]
}Product and variant names hold 1 through 63 characters and cannot be blank. description is optional, at most 2000 characters. unitPriceMinor is a positive integer in the store currency's minor units.
The product is created archived, with unlimited stock and no images. Its URL slug comes from its name. The response lists the new variants in the order you sent them.
A price above the most one payment can take, or finer than the currency's smallest charge, fails with 422 VariantPriceNotChargeable. Its reason is above-max-charge or finer-than-step, and variantName names the variant.
An archived product is hidden from the storefront, so set up what selling it needs, such as its delivery, first. Then call POST /api/catalog/products/:productId/publish, which also requires products:write.
Publishing makes the product live and announces a storefront content change. Only the first call publishes. After that the product is the seller's: a product they archive stays archived, and later calls change nothing.
A product your plugin did not create, another store's product, or a deleted product returns 404 ProductNotInStore. 503 CatalogUnavailable on any catalog endpoint means the store's products could not be read or written.
Sales
The sales endpoints let a plugin add sales and orders it makes for the store outside the storefront's checkout to the store's revenue and orders on the dashboard. The resellers plugin reports what resellers are charged for keys, and the purchases they place, this way. Every sales endpoint requires sales:write.
POST /api/sales/entries records 1 through 100 sales:
{
"sales": [
{
"ref": "entry:1f2c",
"occurredAt": "2026-10-01T12:00:00.000Z",
"amountMinor": 2500,
"currency": "USD"
}
]
}ref is your plugin's own id for the sale, 1 through 255 characters with no control characters. occurredAt may be at most a day ahead of core's clock. amountMinor is a non-zero integer in currency's minor units. Report money you give back as a sale of its own with a negative amount. The dashboard counts each sale on the day of its occurredAt. A sale in another currency than the store's is kept but not added, as with orders paid before the store changed currency.
Recording is idempotent per ref, so you can retry a whole report. A report is recorded whole or not at all: 409 SaleRefReused names a sale whose ref is already recorded with another date, amount or currency, and 422 SaleDatedAhead one dated more than a day ahead. A plugin that sells credit buyers spend through it, such as reseller balance, should record the order lines that bought it with POST /api/sales/prepaid-credit-lines, 1 through 100 a call, each as the order and the variant it bought:
{
"lines": [{ "orderId": "6f1e…", "variantId": "2b9c…" }]
}The dashboard then leaves those lines out of revenue, orders and products sold, because the sales and orders the credit pays for are reported instead. A checkout order of credit alone still counts towards the conversion rate, which measures the checkout. Only a line your plugin delivered, as its order recorded when it was paid, is taken; lines of another store's order, or that your plugin did not deliver, come back in unmatched. A recorded line stays recorded, so the revenue already shown does not change when your plugin later stops delivering the variant. Recording is idempotent.
POST /api/sales/orders records 1 through 100 orders as they stand now:
{
"orders": [
{
"ref": "purchase:9a41",
"placedAt": "2026-10-01T12:00:00.000Z",
"asOf": "2026-10-01T12:05:00.000Z",
"status": "completed",
"title": "Netflix 1 Month",
"products": [{ "ref": "netflix", "name": "Netflix", "units": 3, "amountMinor": 7500 }],
"units": 3,
"amountMinor": 7500,
"currency": "USD"
}
]
}The dashboard counts open and completed orders among the store's orders on the day of their placedAt, as it does paid and completed orders of the checkout, their units as products sold, and their amountMinor in the average order value. A cancelled order is not counted. Report an order again whenever it changes: core keeps each ref at the report with the latest asOf, the time your plugin read the order, and ignores an older one, so reports from concurrent requests cannot move an order back and a whole report can be retried. The amount is not added to revenue: report the money with POST /api/sales/entries. placedAt may be at most a day ahead of core's clock and asOf at most five minutes, since a report read ahead would hold the order against your later reports (422 SaleDatedAhead). A report whose asOf is equal to the one core holds replaces it; an older one is ignored and still answers success.
The optional title, up to 200 characters, names what the order sold, such as the product bought. The dashboard lists the order by it among the store's recent orders, or by your plugin's name when the latest report has none.
The optional products, at most 100, are the units of each product of your plugin's own catalogue the order sold: ref is your id for the product, the same in every order that sold it (1 through 255 characters with no control characters), and name, up to 200 characters, is what the dashboard calls it, renamed by the latest report naming it. List each ref once. A product's optional amountMinor is the part of the order's amount its units were charged, in the order's currency, so the parts should add up to no more than the order's amount. The dashboard's per product comparison draws your products beside the store's own by this revenue, and a product reported without one as having made nothing; an order whose latest report lists none still counts its units among the products sold, under no product.
503 SalesUnavailable on any sales endpoint means the store's sales could not be read or written.
Storefront injections
A plugin granted storefront:inject adds its own HTML to the store's storefront pages, such as a chat widget, an analytics tag or an announcement bar. Each plugin has one injection per store. PUT /api/storefront/injection replaces it whole:
{
"head": "<script async src=\"/plugins/acme/assets/gtag-init.js?v=1\" data-measurement-id=\"G-XXXX\"></script><script async src=\"https://www.googletagmanager.com/gtag/js?id=G-XXXX\"></script>",
"body": "",
"scriptOrigins": ["https://www.googletagmanager.com"],
"connectOrigins": [
"https://www.googletagmanager.com",
"https://*.google-analytics.com",
"https://*.google.com"
]
}Pages run no inline <script>, so Google Analytics' gtag('config', …) bootstrap goes in a file among your plugin's static assets, which the pages load from their own origin. The tag passes it the store's measurement ID, since an asset holds nothing per store:
const { measurementId } = document.currentScript.dataset;
window.dataLayer = window.dataLayer || [];
window.gtag = function gtag() {
window.dataLayer.push(arguments);
};
window.gtag("js", new Date());
window.gtag("config", measurementId);gtag.js replays what dataLayer holds when it loads, so the two tags may run in either order.
head is placed right before each page's </head> and body right before its </body>, each at most 16 KB of UTF-8, as given and unescaped. Each origin list holds at most 16 https: origins, such as https://cdn.example.com or https://*.example.com, which those pages' Content Security Policy then admits under one directive: scriptOrigins under script-src, connectOrigins (which also takes wss: origins) under connect-src, and the optional styleOrigins, fontOrigins, imgOrigins and frameOrigins under style-src, font-src, img-src and frame-src. DELETE /api/storefront/injection removes the injection. See Page injections for the pages that get it and how it is trusted.
Both calls announce the change to the storefront, so pages show it at once. Both are idempotent: 503 StorefrontInjectionsUnavailable means the injection could not be saved or announced, and calling again finishes it. Uninstalling your plugin, or the seller withdrawing storefront:inject, removes the injection from the pages; after a reinstall, set it again.
Search
The dashboard's search (Cmd+K) finds the store's records as the seller types, within 300 ms on stores with a million records, so it never calls your plugin: your plugin writes what should be searchable, and core searches that. Any plugin installed on the store can write its own records; no permission is needed. They are listed under your plugin's name, and they leave search when the store uninstalls it.
PUT /api/search/records writes or updates 1 through 500 records:
{
"records": [
{
"id": "6b1f…",
"title": "SUMMER10",
"subtitle": "10% off every order",
"archived": false,
"target": { "type": "view", "view": "coupon/6b1f…" }
}
]
}id is your plugin's own id for the record, 1 through 100 characters with no control characters, unique among your records of the store. The seller finds a record by any word of its title and subtitle, without regard to case or accents, with typos corrected and the last word completed. Both show as one line of plain text: whitespace runs collapse to one space, control and direction-override characters are dropped, and text past 120 characters (title) or 160 (subtitle) is cut with "…". An archived record is listed after your live ones and marked archived.
target is what the result opens:
target | Opens |
|---|---|
{ "type": "page" } | Your plugin's page. |
{ "type": "view", "view": "coupon/6b1f" } | Your plugin's page at that view (its ?view=). |
{ "type": "product", "productId": "…" } | A product of the store, such as the one a review is about. |
{ "type": "order", "orderId": "…" } | An order of the store, such as the one a key was delivered in. |
A product or order the store does not have, or has deleted, is refused with 422 SearchTargetNotInStore, naming the record, and nothing of the call is written. Write a record whenever it is created or changes: core keeps what you wrote last, so a call can be retried whole.
POST /api/search/records/remove removes 1 through 500 records by ids. An id that is not searchable is skipped.
POST /api/search/records/sync replaces all your records of the store, a page of up to 500 at a time:
{ "generation": "0c6d…", "records": [ … ], "done": false }Send every page of one resync with the same generation UUID, and done: true with the last, which may be empty. Records written since the resync's first page, by it or by PUT /api/search/records, stay; the rest are removed once it is done. A page can be retried, a resync abandoned midway removes nothing, and a new generation starts over. Answer SyncSearchRecords with it, so records written before your plugin wrote them as they change become searchable, or use it to repair search.
503 SearchUnavailable on any search endpoint means nothing of the call was written; retry it. Write after your own data is committed, and keep your write when the search call fails: search catches up at the next write or resync.
