Launch a preorder offer from a product list
Worked recipe: check the plan and app embed, create a preorder offer, enrol a list of variants (from a CSV or a spreadsheet), set the ship date, and turn it on. Every call, response and error code.
Last updated
For: agencies and developers who set up a preorder drop for a client, from a list of products the client sends.
Goal: a live preorder offer with the client’s variants on it, showing a ship date under the Preorder button, and sold out variants taking preorders.
Before you start
Section titled “Before you start”- Credentials: the store’s API key for REST (
X-Auth-Token, from STOQ Settings → Integrations → API Key; see API Key), or an MCP client signed in to the store with OAuth (see MCP). - Plan: a basic offer (enrol variants, ship date, enable) works on every plan. Deposits, payment schedules, offer start and end dates, fulfillment holds and collection or tag product selections are paid features. On the free plan, writing them fails with
plan_required. - Theme: STOQ’s app embed must be on for the Preorder button to show on a theme. Headless stores use the Storefront SDK instead.
- Your list: Shopify variant ids (
gid://shopify/ProductVariant/…or the numeric id). If the client’s CSV only has SKUs, look the variants up first in the Shopify Admin GraphQL API (productVariants(query: "sku:ABC-1")).
1. Check the plan and the app embed (first, before any write)
Section titled “1. Check the plan and the app embed (first, before any write)”Make these two reads your first calls, before you create anything, and tell the merchant what they show.
curl "https://app.stoqapp.com/api/v2/external/account/plan_usage" \ -H "X-Auth-Token: $STOQ_API_KEY"
curl "https://app.stoqapp.com/api/v2/external/account/setup" \ -H "X-Auth-Token: $STOQ_API_KEY"{ "tool": "execute_read", "arguments": { "method": "GET", "path": "/account/plan_usage" } }{ "tool": "execute_read", "arguments": { "method": "GET", "path": "/account/setup" } }What comes back:
{ "plan": { "name": "…", "friendly_name": "Plus" }, "period": { "month": "2026-11", "is_current": true }, "limits": { "usage_type": "per_month", "unlimited_notifications": false, "notification_limit": 1000, "email_limit": null, "sms_limit": null, "preorder_limit": 500 }, "usage": { "email_alerts": 120, "sms_alerts": 4, "sms_segments": 6, "total_alerts": 124, "alerts_over_limit": 0, "preorders": 37, "by_template": ["…"] }}{ "app_embed": { "enabled": false, "status": "disabled", "theme_editor_url": "https://admin.shopify.com/store/…/themes/current/editor?context=apps…" } }limits.preorder_limitagainstusage.preorderstells you how many more preorders the plan includes this month (nullmeans no limit).- If
app_embed.enabledisfalse, give the merchanttheme_editor_urlto turn the embed on.status: "unknown"means STOQ could not read the theme, which is not a confirmed off. - This recipe sets no deposit, schedule or fulfillment hold. A new offer’s shipping reads
fulfillment.handling: "none", which means no hold: don’t tell the merchant fulfillments are held. Report only settings the responses show, and leave paid-only settings alone unless the merchant asks for them.
2. Create the offer
Section titled “2. Create the offer”curl -X POST "https://app.stoqapp.com/api/v2/external/preorders/offers" \ -H "X-Auth-Token: $STOQ_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "name": "Winter Drop", "internal_name": "winter-drop-2026" }'{ "tool": "execute_write", "arguments": { "method": "POST", "path": "/preorders/offers", "params": { "name": "Winter Drop", "internal_name": "winter-drop-2026" }, "idempotency_key": "<new uuid>" } }202 Accepted with the whole offer, in the same shape as GET /preorders/offers/:id. Keep the id:
{ "id": "6f1c0c0e-2f0a-4c57-9d0f-6a1d5a3a1b11", "name": "Winter Drop", "internal_name": "winter-drop-2026", "products": { "…": "…" }, "shipping": { "…": "…" }, "payments": { "options_offered": "full", "…": "…" }, "availability": { "schedule": "…", "starts_at": null, "ends_at": null, "current_status": "live", "time_zone": "…" }, "…": "…"}A new offer is live as soon as it’s created and takes full payment, as the dashboard’s Create offer makes it. It covers no products yet, so the storefront doesn’t change, but pause it now so the variants don’t take preorders before the ship date is set. Step 5 turns it on again; enable on an offer that is already live fails with conflict.
curl -X POST "https://app.stoqapp.com/api/v2/external/preorders/offers/$OFFER_ID/disable" \ -H "X-Auth-Token: $STOQ_API_KEY" -H "Idempotency-Key: $(uuidgen)"{ "tool": "execute_write", "arguments": { "method": "POST", "path": "/preorders/offers/<offer_id>/disable", "idempotency_key": "<new uuid>" } }202 Accepted with the offer; availability.current_status is now off. The settings come next, one capability at a time.
3. Enrol the variants
Section titled “3. Enrol the variants”Send the list in chunks of up to 250 variant ids. Each call adds them during the call; a larger selection runs as a job.
curl -X POST "https://app.stoqapp.com/api/v2/external/preorders/offers/$OFFER_ID/products/add_variants" \ -H "X-Auth-Token: $STOQ_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "shopify_variant_ids": ["gid://shopify/ProductVariant/43900910010503", "gid://shopify/ProductVariant/43900910043271"] }'{ "tool": "execute_write", "arguments": { "method": "POST", "path": "/preorders/offers/<offer_id>/products/add_variants", "params": { "shopify_variant_ids": ["gid://shopify/ProductVariant/43900910010503", "gid://shopify/ProductVariant/43900910043271"] }, "idempotency_key": "<new uuid>" } }shopify_product_ids (every variant of each product) or shopify_collection_id (every product in the collection) work in place of shopify_variant_ids.
202 Accepted with the offer’s product selection, what happened to each id, and the job that attaches them:
{ "selection": "custom", "shopify_collection_id": null, "tags": [], "eligible_inventory_policy": "all", "excluded_shopify_variant_ids": [], "exclusion_tag": null, "variant_count": 0, "variants_added": ["gid://shopify/ProductVariant/43900910010503", "gid://shopify/ProductVariant/43900910043271"], "products_added": [], "already_present": [], "deleted_in_shopify": [], "job": { "job_id": "…", "status": "queued", "status_url": "/api/v2/external/preorders/product_variants/jobs/…" }}variant_count is read when the call starts, so it doesn’t count the variants still being attached. If every id is already on the offer, the answer is 200 with variants_added: [], the ids under already_present and no job. Otherwise poll the job’s status_url until status is completed (or failed, with error):
curl "https://app.stoqapp.com/api/v2/external/preorders/product_variants/jobs/$JOB_ID" \ -H "X-Auth-Token: $STOQ_API_KEY"{ "tool": "execute_read", "arguments": { "method": "GET", "path": "/preorders/product_variants/jobs/<job_id>" } }{ "job_id": "…", "status": "running", "progress": 40, "total": 250, "processed": 100 }Wait for one chunk’s job to finish before sending the next chunk to the same offer.
The pre-flight check. If some variants are already on another offer, have “Continue selling when out of stock” off where STOQ won’t turn it on, or are on a sales channel that can’t sell preorders, nothing is added. The answer is 409 with code: "preflight_issues", the issues under preflight and the fixes still needed under unresolved. Ask the merchant which fix they want, then resend the same ids with those resolve keys:
curl -X POST "https://app.stoqapp.com/api/v2/external/preorders/offers/$OFFER_ID/products/add_variants" \ -H "X-Auth-Token: $STOQ_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "shopify_variant_ids": ["gid://shopify/ProductVariant/43900910010503"], "resolve": { "remove_from_conflicting_offers": true, "enable_continue_selling": true } }'The answer lists what each fix did under resolved. skip_preflight: true adds the variants without the check.
4. Set the ship date and the line under the button
Section titled “4. Set the ship date and the line under the button”curl -X PATCH "https://app.stoqapp.com/api/v2/external/preorders/offers/$OFFER_ID/shipping" \ -H "X-Auth-Token: $STOQ_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "ships_at": "2026-12-01", "timeline": { "show_shipping_text": true, "shipping_text": "Ships in early December" } }'{ "tool": "execute_write", "arguments": { "method": "PATCH", "path": "/preorders/offers/<offer_id>/shipping", "params": { "ships_at": "2026-12-01", "timeline": { "show_shipping_text": true, "shipping_text": "Ships in early December" } }, "idempotency_key": "<new uuid>" } }ships_at is a date in the shop’s time zone (or an exact ISO 8601 time). Sending it makes delivery_timing exact_time. 202 Accepted with the offer’s shipping settings, as GET /preorders/offers/:id/shipping returns them:
{ "timeline": { "scope": "same", "show_shipping_text": true, "shipping_text": "Ships in early December", "variant_shipping_text": "01 Dec 2026" }, "delivery_timing": "exact_time", "ships_at": "2026-12-01T00:00:00Z", "days_after_checkout": null, "fulfillment": { "…": "…" }, "also_changed": [ { "field_path": "shipping.timeline.variant_shipping_text", "setting": "timeline.variant_shipping_text", "from": "ASAP", "to": "01 Dec 2026", "reason": "…" } ], "…": "…"}Settings the save changed on its own are listed under also_changed. Shipping is a deep partial: send only the fields you change. To take a deposit, see Change the deposit or ship date across an offer.
5. Turn the offer on
Section titled “5. Turn the offer on”curl -X POST "https://app.stoqapp.com/api/v2/external/preorders/offers/$OFFER_ID/enable" \ -H "X-Auth-Token: $STOQ_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "update_inventory_policy": true }'{ "tool": "execute_write", "arguments": { "method": "POST", "path": "/preorders/offers/<offer_id>/enable", "params": { "update_inventory_policy": true }, "idempotency_key": "<new uuid>" } }update_inventory_policy: true turns on “Continue selling when out of stock” for the offer’s variants, so sold-out variants can take preorders. Leave it out to keep each variant’s current policy. Add shopify_variant_ids to limit it to some variants. 202 Accepted with the offer; availability.current_status is now live.
If it fails
Section titled “If it fails”| Code | What happened | What to do |
|---|---|---|
auth_, auth_ |
No API key, or not a current one | Send the store’s key in X-Auth-Token, or reconnect the MCP client |
not_ |
The offer id is wrong or from another store | GET /preorders/offers and take the id from the list |
invalid_ |
A field failed the schema, such as an id that is not a variant gid | Fix the field named in details[]. and resend |
validation_ |
The offer wasn’t saved, for example another offer already has that internal_ |
Pick another internal_, or find the existing offer with GET /preorders/offers?search= |
preflight_ |
Some variants can’t be added as they are | Resend with the resolve keys listed under unresolved, after the merchant agrees |
conflict |
A variant job is still running on this offer, or the offer’s state doesn’t allow the change (enable on an offer that is already live) | Poll the job named in the message, then retry. For enable, read the offer: live means there is nothing to do |
plan_ |
The change uses a paid-only feature; nothing was saved | Ask the merchant to upgrade, or leave the paid-only fields out |
shopify_ |
A Shopify call failed partway | Read the offer before you retry: part of the change may have run |
rate_ |
The key used its points for this minute | Wait retry_ seconds. Writes cost 2 points, reads 1 |
idempotency_ |
The key was used for a different request | Send a new key for each new write |
Check it worked
Section titled “Check it worked”-
Read the offer:
availability.current_statusislive, andshipping.ships_atis the date you set.curl "https://app.stoqapp.com/api/v2/external/preorders/offers/$OFFER_ID" \-H "X-Auth-Token: $STOQ_API_KEY" -
List the offer’s variants and compare
meta.total_countwith the length of the client’s list:{ "tool": "execute_read", "arguments": { "method": "GET", "path": "/preorders/offers/<offer_id>/products/variants", "params": { "per_page": 100, "include_inventory": true } } }With
include_inventory, each row hasinventory_policy; sold-out variants should beCONTINUE. -
Ask how a shopper in the store’s main country sees two of the variants.
status: "live"means the offer applies and its limit isn’t reached:curl "https://app.stoqapp.com/api/v2/external/preorders/product_variants/availability?country=US&shopify_variant_ids=43900910010503,43900910043271" \-H "X-Auth-Token: $STOQ_API_KEY" -
On the storefront, open a sold-out variant from the list: the Preorder button shows, with “Ships in early December” under it. STOQ publishes the offer to Shopify in the background, so allow a minute.
Thanks for letting us know.
Still stuck? Ask Quinn or chat with support