Skip to content

Worked recipes

End-to-end builds for agencies, theme developers and AI agents. Each recipe gives the goal, what you need first, every call in order, the expected answers, what to do when a call fails, and how to check the result.

Last updated

Each recipe is a complete build that you can hand to an agent or follow yourself. A recipe gives:

  • Who it’s for and the goal: what you end up with.
  • Before you start: credentials, plan and store setup.
  • Steps: every API call or MCP tool call in order, with real action paths and parameter names, and the theme or SDK code.
  • What comes back: the response shape for each step.
  • If it fails: the error codes you can get and what to do about each one.
  • Check it worked: a read that proves the change landed.
Recipe For Surfaces
Launch a preorder offer from a product list Agencies setting up a drop for a client API v2 or MCP
Change the deposit or ship date across an offer Agencies and merchants moving a launch API v2 or MCP
Export back-in-stock demand for inventory planning Agencies, ops and buying teams API v2 or MCP
Sync back-in-stock signups to a CRM or Klaviyo Agencies running a client’s email and SMS API v2, MCP, storefront events
Add a notify-me form to a custom theme section Theme developers Settings API + theme JavaScript
Build a preorder offer from a description Merchants and agencies describing an offer in words MCP (plan_offer, when enabled)
Design a custom preorder widget with Claude Merchants and agencies restyling the preorder widget MCP (design_preorder, when enabled)
Preorder badge, button and notify-me on a headless storefront Hydrogen and headless developers Storefront SDK + metafields

REST calls go to https://app.stoqapp.com/api/v2/external with the store’s API key in X-Auth-Token (see Getting Started). Run them server-side only. Never put the API key in theme or storefront code.

MCP calls are shown as the tool name and its arguments:

{ "tool": "execute_read", "arguments": { "method": "GET", "path": "/account/plan_usage" } }

An agent connected to the MCP server makes these through search, execute_read and execute_write. Each path is the same action path as the REST call. params is the REST query string or JSON body. Replace every <placeholder> with a real id from an earlier step.

Writes: send a fresh Idempotency-Key header (REST) or idempotency_key argument (MCP) with every write, such as a new UUID. A retry with the same key and the same request within an hour returns the first answer instead of writing twice. Read the current state before a write, and confirm the change with the merchant before you make it.

Responses: a REST read answers 200 and a write answers 202, with the action’s data at the top level. An MCP tool result wraps the same data as { "success": true, "data": … }. Responses shown here are cut down to the keys the recipe uses; "…" marks keys left out.

Failures: every error carries a stable code. Branch on code and details[].path, never on message text. Each code links to its own page under Error codes.

Was this page helpful?

Still stuck? Ask Quinn or chat with support