Storefront data contract
The STOQ metafields and metaobjects you can build on without STOQ's JavaScript, which fields are stable, and how to read a variant's preorder offer from Liquid or the Storefront API.
Last updated
STOQ publishes each preorder offer to Shopify as a metaobject, and points every variant in the offer at it. A theme, a headless storefront, another app or an AI agent can read them to build its own preorder UI, without loading STOQ’s widget.
This page is the contract for that data:
- Stable fields keep their name, type and meaning. A change to one ships only as a new contract version, announced in the Changelog below.
- Internal fields are published for STOQ’s own widget. They may change or disappear without notice. Don’t build on them.
- New fields and new enum values can be added at any time without a new version. Ignore keys you don’t know, and treat an unknown enum value as “not supported”.
Namespaces
Section titled “Namespaces”STOQ’s metafields and metaobjects are app-owned: only STOQ can write them, and merchants and other apps can read them. Outside STOQ’s own code, use the full namespace, which includes STOQ’s app ID (5940125):
| Where you read it | Variant offer metafield | Offer metaobject type |
|---|---|---|
| Theme Liquid (your theme code) | variant. |
app--5940125--offer |
| Storefront API (headless, Hydrogen, other apps) | metafield(namespace: "app--5940125", key: "offer") |
app--5940125--offer |
| STOQ’s own code | $app. |
$app:offer |
Read a variant’s preorder offer
Section titled “Read a variant’s preorder offer”A variant has one offer metafield: a list of references to the offers it belongs to. An empty list means the variant isn’t in any preorder offer. Being in an offer isn’t the same as being on preorder right now: check current_status (live), and the offer’s inventory.stock_condition against the variant’s stock.
Liquid
Section titled “Liquid”Inside a product form:
{%- assign variant = product.selected_or_first_available_variant -%}{%- assign market_gid = 'gid://shopify/Market/' | append: localization.market.id -%}{%- assign offers = variant.metafields['app--5940125'].offer.value -%}{%- for offer in offers -%} {%- assign stock = offer.inventory.value.stock_condition -%} {%- assign in_stock = false -%} {%- if variant.inventory_management == blank or variant.inventory_quantity > 0 -%}{%- assign in_stock = true -%}{%- endif -%} {%- assign eligible = false -%} {%- if stock == 'any_stock_level' -%}{%- assign eligible = true -%} {%- elsif stock == 'out_of_stock' and in_stock == false -%}{%- assign eligible = true -%} {%- elsif stock == 'in_stock' and in_stock -%}{%- assign eligible = true -%} {%- endif -%} {%- assign markets = offer.markets.value -%} {%- if markets.scope == 'selected' -%} {%- unless markets.shopify_market_ids contains market_gid -%}{%- assign eligible = false -%}{%- endunless -%} {%- endif -%} {%- if offer.current_status.value == 'live' and eligible -%} {%- assign widget = offer.widget.value -%} {%- assign shipping = offer.shipping.value -%} {%- assign payments = offer.payments.value -%} {%- assign plan_gid = payments[payments.default_option].selling_plan_id -%} {%- if offer.advanced.value.checkout_method == 'selling_plan' and plan_gid -%} <input type="hidden" name="selling_plan" value="{{ plan_gid | split: '/' | last }}"> {%- endif -%} <button type="submit" name="add">{{ widget.button.button_text | default: 'Preorder' | escape }}</button> {%- if shipping.timeline.show_shipping_text -%} <p>{{ shipping.timeline.shipping_text | escape }}</p> {%- endif -%} {%- break -%} {%- endif -%}{%- endfor -%}The example skips an offer whose markets.scope is selected and does not list the shopper’s current market, so a Canada-only offer listed first doesn’t win for a US shopper. It takes the first eligible offer. If a variant has both a market-specific offer and an unrestricted one, check the market-specific offer first, as STOQ’s own widget does.
Liquid renders once, when the page loads. If your theme changes the selected variant without reloading the page, recompute the offer and the selling_plan input on each variant change (for example by re-rendering this block through the Section Rendering API), or use this example only on forms with a fixed variant. Keep the variant id and the selling_plan value in step before the form submits: a plan from one variant sent with another variant’s ID doesn’t apply.
The selling_plan input adds the variant on the offer’s payment terms: the plan of payments.default_option, sent as the number at the end of its GID. An offer whose advanced.checkout_method is line_item_property has no plan to send: that mode depends on STOQ’s own widget adding line item properties, so build custom UI on selling_plan offers.
Show the deposit and ship date
Section titled “Show the deposit and ship date”Inside the same {%- if offer.current_status.value == 'live' and eligible -%} block, after payments and shipping are assigned:
{%- assign deposit = payments.partial.checkout_charge -%}{%- if deposit and payments.partial.selling_plan_id -%} {%- if deposit.charge_type == 'percentage' -%} <p>{{ deposit.charge_amount }}% due today</p> {%- else -%} <p>{{ deposit.charge_amount }} {{ payments.currency_code | escape }} due today</p> {%- endif -%}{%- endif -%}{%- if shipping.delivery_timing == 'exact_time' and shipping.ships_at -%} <p>Ships {{ shipping.ships_at | date: '%B %-d, %Y' }}</p>{%- elsif shipping.days_after_checkout -%} <p>Ships {{ shipping.days_after_checkout }} days after checkout</p>{%- elsif shipping.timeline.show_shipping_text -%} <p>{{ shipping.timeline.shipping_text | escape }}</p>{%- endif -%}payments.partial is missing on an offer that only takes full payment, so the deposit lines are skipped there. A full-payment offer has no deposit: the shopper pays everything at checkout. charge_amount is a plain number, not formatted money.
Storefront API
Section titled “Storefront API”query VariantPreorderOffer($variantId: ID!) { node(id: $variantId) { ... on ProductVariant { offers: metafield(namespace: "app--5940125", key: "offer") { references(first: 5) { nodes { ... on Metaobject { offerId: field(key: "offer_id") { value } name: field(key: "name") { value } status: field(key: "current_status") { value } widget: field(key: "widget") { value } shipping: field(key: "shipping") { value } payments: field(key: "payments") { value } } } } } } }}The json fields come back as JSON strings: parse widget.value, shipping.value and the rest before reading their keys.
Every selling plan an offer owns also points at the offer metaobject, so you can read the offer from a cart line or a selling plan allocation too:
query PlanOffer($variantId: ID!) { node(id: $variantId) { ... on ProductVariant { sellingPlanAllocations(first: 5) { nodes { sellingPlan { id offer: metafield(namespace: "app--5940125", key: "offer") { reference { ... on Metaobject { status: field(key: "current_status") { value } } } } } } } } }}List every offer
Section titled “List every offer”query Offers { metaobjects(type: "app--5940125--offer", first: 50) { nodes { handle name: field(key: "name") { value } status: field(key: "current_status") { value } } }}When the data updates
Section titled “When the data updates”- The offer metaobject is rewritten shortly after the offer is saved in STOQ (dashboard, API or MCP). An unchanged offer isn’t rewritten.
- A scheduled offer is checked every 5 minutes: when it goes live or ends,
current_statusandavailabilityare rewritten. - Variant
offerreferences are rewritten when variants join or leave the offer. Large offers are written in batches, so the last variants can take a few minutes. - A deleted offer’s selling plans and variants stop pointing at it first; its metaobject is deleted after that.
$app:offer metaobject
Section titled “$app:offer metaobject”Handle: offer-<offer_id>. One entry for each offer that hasn’t been deleted.
| Field | Type | Meaning | Stability |
|---|---|---|---|
offer_ |
single_ |
STOQ’s offer ID (a UUID). The ID the STOQ API and MCP use. | Stable |
name |
single_ |
The offer name shoppers see. | Stable |
current_ |
single_ |
live, off, scheduled or deleted. Same as availability.. A deleted offer’s entry is removed, so deleted is rarely seen. |
Stable |
widget |
json |
Button, disclaimer and badge display settings. | Stable |
inventory |
json |
When a variant in the offer can be preordered. | Stable |
shipping |
json |
Shipping text and delivery timing. | Stable |
payments |
json |
Payment options and their selling plans. | Stable |
availability |
json |
Schedule and current status. | Stable |
limits |
json |
Quantity limits, terms and cart rules. | Stable |
countdown |
json |
Countdown timer settings. | Stable |
markets |
json |
Which markets the offer sells in. | Stable |
advanced |
json |
Checkout method and cart attributes. | Stable |
integrations |
json |
B2B. | Stable |
batches |
json |
Batch (wave) settings and the batches. | Stable |
translations |
json |
Translated text by locale. | Stable |
Keys inside the json fields
Section titled “Keys inside the json fields”Types: string, boolean, integer, number, timestamp (ISO 8601, UTC), gid(Type) (a Shopify GID) and enum(a\|b). A trailing ? means the value can be null. <option> is full or partial; [] is each item of a list.
widget
| Key | Type | Meaning | Stability |
|---|---|---|---|
widget. |
string? |
Preorder button label. | Stable |
widget. |
boolean? |
Use the colors below instead of the theme’s. | Stable |
widget. |
string? |
Button text color (hex). | Stable |
widget. |
string? |
Button background color (hex). | Stable |
widget. |
boolean |
Show the message under the button. | Stable |
widget. |
string? |
That message. | Stable |
widget. |
string? |
Its text color. | Stable |
widget. |
string? |
Its background color. | Stable |
widget. |
integer? |
Its corner radius, in px. | Stable |
widget. |
boolean? |
Show a preorder badge on the product. | Stable |
widget. |
string? |
Badge text. | Stable |
widget. |
string? |
Badge text color. | Stable |
widget. |
string? |
Badge background color. | Stable |
inventory
| Key | Type | Meaning | Stability |
|---|---|---|---|
inventory. |
enum(out_ |
When a variant in the offer is sold as a preorder: only when out of stock, only while in stock, or at any stock level. | Stable |
shipping
| Key | Type | Meaning | Stability |
|---|---|---|---|
shipping. |
enum(same|per_ |
One shipping text for every variant, or a text per variant. | Stable |
shipping. |
boolean? |
Show the shipping text with the button. | Stable |
shipping. |
string? |
The offer’s shipping text. | Stable |
shipping. |
string? |
A variant’s text when it has none of its own. | Stable |
shipping. |
enum(asap|exact_ |
How the ship date is set. | Stable |
shipping. |
timestamp? |
Fixed ship date, when there is one. | Stable |
shipping. |
integer? |
Ships this many days after checkout, when set. | Stable |
payments
| Key | Type | Meaning | Stability |
|---|---|---|---|
payments. |
enum(full|partial|full_ |
Which payment options shoppers can choose. | Stable |
payments. |
enum(full|partial) |
The option selected first. | Stable |
payments. |
gid(SellingPlan)? |
The selling plan to add to the cart for this option. | Stable |
payments. |
enum(percentage|price) |
How the amount paid at checkout is set. | Stable |
payments. |
number? |
The percentage or amount paid at checkout (full is always 100%). |
Stable |
payments. |
enum(percentage|price|fixed_ |
Discount type, or null for no discount. |
Stable |
payments. |
number? |
Discount value. | Stable |
payments. |
string? |
Option label in the payment picker. | Stable |
payments. |
string? |
Option description. | Stable |
payments. |
string? |
Discount label. | Stable |
payments. |
boolean? |
Show the payment option picker. | Stable |
payments. |
boolean? |
Show the discounted price on the product page. | Stable |
payments. |
string? |
Shop currency for the amounts above. | Stable |
payments.full and payments.partial are present only for an option the offer offers (see payments.options_offered), and selling_plan_id is null until STOQ has created the plan. checkout_charge is what the shopper pays at checkout: a deposit is partial with charge_type percentage (charge_amount is the percent) or price (the amount, in payments.currency_code). The balance is charged later.
availability
| Key | Type | Meaning | Stability |
|---|---|---|---|
availability. |
enum(enabled|disabled|date_ |
Whether the offer is switched on by hand or follows dates. | Stable |
availability. |
timestamp? |
Scheduled start. | Stable |
availability. |
timestamp? |
Scheduled end. | Stable |
availability. |
enum(live|off|scheduled|deleted) |
Status when last published. | Stable |
limits
| Key | Type | Meaning | Stability |
|---|---|---|---|
limits. |
enum(progress_ |
How a quantity limit is shown. | Stable |
limits. |
string? |
Limit message. | Stable |
limits. |
boolean? |
Show icons in the disclaimer. | Stable |
limits. |
string? |
Progress bar text. | Stable |
limits. |
string? |
Bar fill color. | Stable |
limits. |
string? |
Bar background color. | Stable |
limits. |
string? |
Box background color. | Stable |
limits. |
string? |
Text color. | Stable |
limits. |
integer? |
Corner radius, in px. | Stable |
limits. |
boolean? |
Show the percentage sold. | Stable |
limits. |
boolean? |
Shoppers must accept terms before buying. | Stable |
limits. |
string? |
The terms. | Stable |
limits. |
boolean? |
Keep the button disabled until they accept. | Stable |
limits. |
boolean |
Save the acceptance as a line item property. | Stable |
limits. |
string? |
That property’s name. | Stable |
limits. |
enum(mixed|preorder_ |
Whether preorder and in-stock items can share a cart. | Stable |
limits. |
string? |
Message when they can’t. | Stable |
limits. |
integer? |
Minimum quantity per order. | Stable |
limits. |
integer? |
Maximum quantity per order. | Stable |
countdown
| Key | Type | Meaning | Stability |
|---|---|---|---|
countdown. |
enum(disabled|before_ |
When the timer shows. | Stable |
countdown. |
enum(schedule|custom) |
Count to the offer’s schedule or to the dates below. | Stable |
countdown. |
timestamp? |
Custom start. | Stable |
countdown. |
timestamp? |
Custom end. | Stable |
countdown. |
string? |
Heading before launch. | Stable |
countdown. |
string? |
Heading while the preorder runs. | Stable |
countdown. |
string? |
Unit label. | Stable |
countdown. |
string? |
Unit label. | Stable |
countdown. |
string? |
Unit label. | Stable |
countdown. |
string? |
Unit label. | Stable |
countdown. |
string? |
Timer text color. | Stable |
countdown. |
string? |
Timer background color. | Stable |
countdown. |
integer? |
Corner radius, in px. | Stable |
countdown. |
enum(days|hours|minutes|seconds) |
The units shown. | Stable |
countdown. |
enum(hidden|before_ |
The phase when last published. Can be minutes stale: work it out from the keys above. | Internal |
countdown. |
timestamp? |
Same, the time counted to. | Internal |
countdown. |
string? |
Same, the heading. | Internal |
countdown. |
timestamp? |
Same, the start date the timer uses. | Internal |
countdown. |
timestamp? |
Same, the end date the timer uses. | Internal |
markets, advanced, integrations
| Key | Type | Meaning | Stability |
|---|---|---|---|
markets. |
enum(all|selected) |
Sold in every market, or only those listed. | Stable |
markets. |
gid(Market) |
The markets, when scope is selected. |
Stable |
advanced. |
enum(selling_ |
Checked out as a Shopify selling plan, or as a line item property. | Stable |
advanced. |
boolean? |
Add the payment terms as a line item property. | Stable |
advanced. |
boolean? |
Add the shipping text as a line item property. | Stable |
advanced. |
string? |
A custom line item property. | Stable |
integrations. |
boolean |
The offer applies to B2B buyers. | Stable |
batches
| Key | Type | Meaning | Stability |
|---|---|---|---|
batches. |
enum(sequential|all_ |
Sell batches one after another, or all at once. | Stable |
batches. |
string? |
Label for a sold-out batch. | Stable |
batches. |
string? |
Label for the batch on sale. | Stable |
batches. |
string? |
Label for a later batch. | Stable |
batches. |
string |
Batch widget layout (roadmap by default). |
Stable |
batches. |
enum(counts|percent) |
Show progress as counts or a percentage. | Stable |
batches. |
boolean |
Show the other batches’ ship dates. | Stable |
batches. |
boolean |
Show batch names. | Stable |
batches. |
integer |
Order of the batch, from 1. | Stable |
batches. |
integer? |
Units in the batch. | Stable |
batches. |
string? |
The batch’s shipping text. | Stable |
batches. |
string |
The batch’s name, such as “Batch 2”. | Stable |
translations
| Key | Type | Meaning | Stability |
|---|---|---|---|
translations. |
json |
The translated text for one locale, under the same keys as above (for example widget.). Only keys with a translation are there; use the base value for the rest. |
Stable |
Variant and selling plan metafields
Section titled “Variant and selling plan metafields”| Owner | Namespace and key | Type | Meaning | Storefront | Stability |
|---|---|---|---|---|---|
| Product variant | $app · offer |
list. to $app:offer |
The offers the variant belongs to. | Public read | Stable |
| Selling plan | $app · offer |
metaobject_ to $app:offer |
The offer that owns this selling plan. | Public read | Stable |
| Product, product variant, order | restockrocket_ · tracked |
single_ |
"1" when STOQ tracks the resource; absent otherwise. Admin API only; filter with metafields. on products and orders. |
None | Stable |
Back-in-stock settings are not in this contract
Section titled “Back-in-stock settings are not in this contract”A variant’s back-in-stock settings (button visibility, restock message, widget template) are not variant metafields today, and nothing STOQ publishes for them is covered here. STOQ keeps them in shop-level restockrocket_production metafields, keyed by variant ID: enabled_notify_me_variant_ids, disabled_notify_me_variant_ids, restock_notes and back_in_stock_templates. They are written only for shops that use per-variant notify-me settings, and their shape can change without notice. Don’t build on them.
To read a variant’s back-in-stock settings, use the JavaScript API in the browser, or the API v2 from your server. App-owned back-in-stock fields on the variant are planned. They join this page, with a new contract version, only when they are published.
Changelog
Section titled “Changelog”2026-10-30 — version 1
Section titled “2026-10-30 — version 1”First published contract: the $app:offer metaobject and its json keys, the variant and selling plan offer references, and the tracked markers.
Thanks for letting us know.
Still stuck? Ask Quinn or chat with support