{
  "openapi": "3.1.0",
  "info": {
    "title": "STOQ API v2 (Beta)",
    "version": "2.0.0-beta",
    "description": "STOQ's action-driven, AI-native external API. Every action is self-describing (`description`, `aliases`, `notes`, JSON request schema) and also reachable via the `/help` manifest, `skill.md`, `llms.txt`, and the MCP server. **Public beta** — actions and schemas may change before GA. All endpoints require the `X-Auth-Token` API key.",
    "contact": {
      "name": "STOQ Support",
      "email": "support@stoqapp.com",
      "url": "https://app.stoqapp.com"
    }
  },
  "servers": [
    {
      "url": "https://app.stoqapp.com/api/v2/external",
      "description": "Production"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Account · Help Docs",
      "description": "Search STOQ's help centre and developer docs, or read one page in full."
    },
    {
      "name": "Account · Integrations",
      "description": "Third-party integrations such as Klaviyo, Omnisend, Mailchimp, Shopify Flow, Judge.me and Gorgias: which are connected, their settings, and the Klaviyo flow setup steps."
    },
    {
      "name": "Account · Languages",
      "description": "The languages the shop's storefront text is translated into, and whether multi-language support is on."
    },
    {
      "name": "Account · Locations",
      "description": "The shop's Shopify locations, for naming the locations whose stock STOQ counts."
    },
    {
      "name": "Account · Markets",
      "description": "The shop's Shopify Markets and how STOQ routes stock by market, for back in stock and preorders."
    },
    {
      "name": "Account · Plan Usage",
      "description": "The shop's current STOQ plan, its limits, and a month's usage against them."
    },
    {
      "name": "Account · Sending",
      "description": "Who sends customer notifications: email and SMS provider, sender name and the merchant's own sending address, including domain verification."
    },
    {
      "name": "Account · Settings",
      "description": "App settings read one section at a time, as the Settings pages group them."
    },
    {
      "name": "Account · Setup",
      "description": "Whether STOQ's app embed is on in the published theme."
    },
    {
      "name": "Account · Setup Guide",
      "description": "The setup guide on the dashboard's Home page, for back in stock and preorders, with progress and a skip action."
    },
    {
      "name": "Account · Templates",
      "description": "Email styling, the logo, and per-language translations of notification templates."
    },
    {
      "name": "Account · Theme Integrations",
      "description": "Theme integrations (Quick Buy, Featured products) the merchant requested from the page editors, and their setup status."
    },
    {
      "name": "Account · Translations",
      "description": "Translation overrides for the notify-me button, signup form and preorder button and modal text."
    },
    {
      "name": "Account · Web Pixel",
      "description": "The Shopify web pixel that records storefront views, add-to-carts and purchases for STOQ reports."
    },
    {
      "name": "Back In Stock · App Proxy",
      "description": "Checks that the storefront app proxy (the route the signup form talks to) is reachable and correctly signed."
    },
    {
      "name": "Back In Stock · Customers",
      "description": "Everyone who signed up for an alert or placed a preorder, with subscribe, unsubscribe and delete."
    },
    {
      "name": "Back In Stock · Notification Settings",
      "description": "Per-notification-type settings, such as whether it sends and on which channels."
    },
    {
      "name": "Back In Stock · Notifications",
      "description": "The back-in-stock send log: one entry per notification sent."
    },
    {
      "name": "Back In Stock · Orders",
      "description": "Orders placed after a back-in-stock alert."
    },
    {
      "name": "Back In Stock · Products",
      "description": "Per-product back-in-stock configuration, such as when the notify-me button shows."
    },
    {
      "name": "Back In Stock · Reports",
      "description": "Back-in-stock analytics: signups, notifications, engagement, conversions and revenue."
    },
    {
      "name": "Back In Stock · Sending History",
      "description": "Back-in-stock sends, newest first: each restock or manual send working through a variant's waitlist, with progress."
    },
    {
      "name": "Back In Stock · Settings",
      "description": "Back-in-stock behavior: the signup form the app provides, channels, delivery, compliance and tagging."
    },
    {
      "name": "Back In Stock · Signups",
      "description": "Individual back-in-stock signups (a customer waiting on a variant), with history and manual notify."
    },
    {
      "name": "Back In Stock · Templates",
      "description": "The back-in-stock email and SMS templates, with test sends and translations."
    },
    {
      "name": "Back In Stock · Widget Templates",
      "description": "Saved designs for the storefront signup widget."
    },
    {
      "name": "Customers · Status",
      "description": "One customer's preorder and back-in-stock status, looked up by exact email."
    },
    {
      "name": "Preorders · Notification Settings",
      "description": "Settings for preorder notifications, such as confirmation emails and SMS."
    },
    {
      "name": "Preorders · Offer Lookup",
      "description": "Find one preorder offer by exact id or fuzzy name match."
    },
    {
      "name": "Preorders · Offers",
      "description": "Preorder offers: what is sold as a preorder, how it is paid for and shipped, and how it looks on the storefront. Create, schedule and enable offers, and edit each capability group."
    },
    {
      "name": "Preorders · Orders",
      "description": "Orders containing preorder items, with payment collection, fulfillment holds and customer notifications."
    },
    {
      "name": "Preorders · Product Variants",
      "description": "Per-variant preorder state: the offers a variant is in, its preorder count and metafields, and detaching it from all offers."
    },
    {
      "name": "Preorders · Products",
      "description": "The store-wide Preorders > Products tab: link variants to offers, and bulk add, remove or change inventory policy."
    },
    {
      "name": "Preorders · Reports",
      "description": "Preorder analytics: sales, revenue, engagement and fulfillments by date and product."
    },
    {
      "name": "Preorders · Settings",
      "description": "Store-wide preorder settings: storefront text, pages, reports and developer options."
    },
    {
      "name": "Preorders · Templates",
      "description": "The preorder email templates (confirmation, payment failed, shipping update), with test sends."
    }
  ],
  "paths": {
    "/account/help_docs": {
      "get": {
        "operationId": "get_account_help_docs",
        "summary": "Read",
        "description": "Search STOQ's docs, or read one page in full: the help centre (help.stoqapp.com, audience merchant) and the developer docs (docs.stoqapp.com, audience developer). Use for how-to and explanation questions — how a feature works, how to set something up, what a setting means, how to call the API. Search first, then read the page that matches by its url before relaying step-by-step instructions; the snippets are previews.",
        "tags": [
          "Account · Help Docs"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "help docs",
          "help center",
          "search docs",
          "how do I",
          "documentation",
          "developer docs"
        ],
        "parameters": [
          {
            "name": "audience",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "merchant",
                "developer",
                "all"
              ]
            },
            "example": "merchant"
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "https://example.com"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {},
            "example": 5
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/account/integrations": {
      "get": {
        "operationId": "get_account_integrations",
        "summary": "Read",
        "description": "Every third-party integration (Klaviyo, Postscript, Shopify Flow, Judge.me, Smile.io, Gorgias, Omnisend, Mailchimp, Meta Pixel, SplitOrder, Shopify customer sync) with its status: not_connected, off, setup_incomplete, needs_attention or connected, and a reason {code, message} unless connected. Each entry has the connection (method oauth, api_key or switch; never a key, only key_hint), selected_for (the channels it sends on, from /account/sending), plan, the setup steps with the endpoint that runs each, its non-secret settings, and links to the dashboard panel and the help article.\n\n**Note:** Filter with category (marketing, shopify or other: the Integrations page sections) or status. GET /account/integrations/:id reads one. Who sends each notification right now is GET /account/sending. Klaviyo settings.flows is the flow setup mode per campaign type and channel ({ restock: { email, sms }, ... }): automatic, manual, or null before the merchant chose.",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "integrations",
          "integration status",
          "klaviyo connection",
          "postscript connection",
          "omnisend",
          "mailchimp",
          "customer sync",
          "is klaviyo connected",
          "which integrations are set up"
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "marketing",
                "shopify",
                "other"
              ]
            },
            "example": "marketing"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "not_connected",
                "off",
                "setup_incomplete",
                "needs_attention",
                "connected"
              ]
            },
            "example": "not_connected"
          }
        ]
      },
      "patch": {
        "operationId": "patch_account_integrations",
        "summary": "Update",
        "description": "Update the shop's integrations: sync signups to Klaviyo, Omnisend, Mailchimp or Shopify customers (with the customer tag), the Omnisend and Mailchimp API keys and Mailchimp audience, the Meta Pixel, Shopify Flow triggers and the SplitOrder app switch. API keys are write only; reads return connected flags.\n\n**Note:** Deep partial: absent fields are unchanged. omnisend.api_key and mailchimp.api_key are never returned by any read; \"\" or null removes the saved key. A Mailchimp key is checked by fetching the account's audiences and is not saved when Mailchimp refuses it; mailchimp.list_id must be one of those audiences. Klaviyo connects with OAuth from the Integrations page; disconnect with POST /account/integrations/:provider/disconnect. flow_triggers.triggers replaces the stored list. Over MCP or the in-app assistant an API key is refused with code use_key_link and key_url: the merchant enters it in STOQ.",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "connect omnisend",
          "set omnisend api key",
          "connect mailchimp",
          "set mailchimp api key",
          "pick mailchimp audience",
          "sync signups to klaviyo",
          "sync customers to shopify",
          "customer sync tag",
          "turn on meta pixel",
          "set meta pixel id",
          "enable shopify flow triggers",
          "enable splitorder",
          "set Postscript keyword"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "klaviyo": {},
                  "omnisend": {},
                  "mailchimp": {},
                  "shopify": {},
                  "sync_customers_tag": {},
                  "meta_pixel": {},
                  "flow_triggers": {},
                  "split_order_app": {},
                  "postscript": {}
                }
              },
              "example": {
                "klaviyo": "string",
                "omnisend": "string",
                "mailchimp": "string",
                "shopify": "string",
                "sync_customers_tag": "string",
                "meta_pixel": "string",
                "flow_triggers": "string",
                "split_order_app": "string",
                "postscript": "string"
              }
            }
          }
        }
      }
    },
    "/account/integrations/{channel}/flows/auto_setup": {
      "post": {
        "operationId": "post_account_integrations_channel_flows_auto_setup",
        "summary": "Flows Auto Setup",
        "description": "Create the Klaviyo flows that send STOQ alerts for a campaign type, as the template editor's automatic setup does (klaviyo_email or klaviyo_sms).\n\n**Note:** campaign_type is \"restock\" (default) or \"preorder\". Fails with Klaviyo's error when it refuses; nothing is marked set up then.",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "set up klaviyo flows automatically",
          "auto setup klaviyo",
          "create klaviyo flows"
        ],
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "campaign_type": {},
                  "template_id": {}
                }
              },
              "example": {
                "campaign_type": "string",
                "template_id": "string"
              }
            }
          }
        }
      }
    },
    "/account/integrations/{channel}/flows/confirm": {
      "post": {
        "operationId": "post_account_integrations_channel_flows_confirm",
        "summary": "Flows Confirm",
        "description": "Record that the merchant set the flows up themselves: for Klaviyo (klaviyo_email, klaviyo_sms) the campaign type is switched to manual setup; for Postscript the template's flow is marked verified. Changes nothing in the provider.\n\n**Note:** Klaviyo takes campaign_type (\"restock\" default, or \"preorder\"); postscript takes template_id.",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "i set up the klaviyo flow manually",
          "manual klaviyo setup",
          "confirm postscript flow"
        ],
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "campaign_type": {},
                  "template_id": {}
                }
              },
              "example": {
                "campaign_type": "string",
                "template_id": "string"
              }
            }
          }
        }
      }
    },
    "/account/integrations/{channel}/flows/reset": {
      "post": {
        "operationId": "post_account_integrations_channel_flows_reset",
        "summary": "Flows Reset",
        "description": "Forget the Klaviyo flow setup choice for a campaign type (klaviyo_email or klaviyo_sms), so the template editor asks again, and mark its templates' flows unverified.\n\n**Note:** Changes nothing in Klaviyo: the flows stay there. campaign_type is \"restock\" (default) or \"preorder\".",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "reset klaviyo setup",
          "start klaviyo setup over"
        ],
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "campaign_type": {}
                }
              },
              "example": {
                "campaign_type": "string"
              }
            }
          }
        }
      }
    },
    "/account/integrations/{channel}/flows/send_test_event": {
      "post": {
        "operationId": "post_account_integrations_channel_flows_send_test_event",
        "summary": "Flows Send Test Event",
        "description": "Send a test event to Klaviyo (klaviyo_email, klaviyo_sms) or Postscript (postscript), so the merchant can build or test the flow that sends STOQ alerts. The event carries a sample product and customer, not real store data.\n\n**Note:** sent is the provider's answer; when false, error_message says why (e.g. not connected).",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "send klaviyo test event",
          "send dummy events",
          "send postscript test event"
        ],
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "template_id": {},
                  "metric_name": {}
                }
              },
              "example": {
                "template_id": "string",
                "metric_name": "Summer Sneaker Drop"
              }
            }
          }
        }
      }
    },
    "/account/integrations/{channel}/flows/verify": {
      "post": {
        "operationId": "post_account_integrations_channel_flows_verify",
        "summary": "Flows Verify",
        "description": "Check with the provider that the flows sending STOQ alerts are set up: Klaviyo email (klaviyo_email), Klaviyo SMS (klaviyo_sms) or Postscript (postscript). Returns verified and, when not, the provider's reason.\n\n**Note:** template_id checks one template's flow (needed for klaviyo_sms); without it klaviyo_email checks every back-in-stock template's flow. setting_flow true with flow_name and flow_type checks a settings flow (klaviyo_email). verified false is a real answer, not an error.",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "verify klaviyo flow",
          "check klaviyo flow",
          "verify postscript setup",
          "is my klaviyo flow working"
        ],
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "template_id": {},
                  "flow_name": {},
                  "flow_type": {},
                  "setting_flow": {}
                }
              },
              "example": {
                "template_id": "string",
                "flow_name": "Summer Sneaker Drop",
                "flow_type": "string",
                "setting_flow": "string"
              }
            }
          }
        }
      }
    },
    "/account/integrations/{id}": {
      "get": {
        "operationId": "get_account_integrations_id",
        "summary": "Show",
        "description": "One integration's status, as in GET /account/integrations. id is one of: klaviyo, postscript, shopify_flow, judgeme, smile, gorgias, omnisend, mailchimp, meta_pixel, split_order, shopify_customers.\n\n**Note:** A step with an action names the endpoint that runs it. After the merchant connects or saves a key in the dashboard, read this again to see the result.",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "klaviyo status",
          "postscript status",
          "gorgias status",
          "why is klaviyo not sending",
          "finish klaviyo setup"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/account/integrations/{id}/connect": {
      "post": {
        "operationId": "post_account_integrations_id_connect",
        "summary": "Connect",
        "description": "Connect an integration. OAuth integrations (klaviyo, judgeme, smile, gorgias) return 201 with connect_url, a one-use link (15 minutes) to the dashboard panel where the merchant presses Connect and approves in the provider. Show it to the user; do not open or fetch it. API-key integrations (postscript, omnisend, mailchimp) take api_key, check it with the provider where STOQ can (Postscript, Mailchimp) and save it. Over MCP or the in-app assistant they take no key and return 201 with key_url instead: API keys are entered by the merchant in STOQ. Show key_url to the user; do not ask for the key.\n\n**Note:** Read GET /account/integrations/:id afterwards for the result. Switch integrations (shopify_flow, meta_pixel, split_order, shopify_customers) have nothing to connect: turn them on with PATCH /account/integrations. reconnect true replaces a connection or key that is already there. A new link replaces the last one; 5 links per integration an hour.",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "connect klaviyo",
          "connect postscript",
          "set postscript api key",
          "connect omnisend",
          "connect mailchimp",
          "connect gorgias",
          "connect judge.me",
          "connect smile"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "api_key": {},
                  "list_id": {},
                  "reconnect": {},
                  "account": {}
                }
              },
              "example": {
                "api_key": "string",
                "list_id": "string",
                "reconnect": "string",
                "account": 5
              }
            }
          }
        }
      }
    },
    "/account/integrations/{id}/events": {
      "get": {
        "operationId": "get_account_integrations_id_events",
        "summary": "Events",
        "description": "What happened to one integration, newest first: connect links and key links issued, connects, disconnects (auto_disconnected when the provider revoked STOQ's access), keys set, cleared or refused, and settings changed (field names only). Each event says which surface did it: dashboard, quinn, mcp, api or system.\n\n**Note:** limit is 1 to 100 (default 20). Pass next_cursor back as before for the next page. Changes saved in the dashboard are recorded too.",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "integration history",
          "klaviyo history",
          "who disconnected klaviyo",
          "integration events"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {},
            "example": 5
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/account/integrations/{provider}/disconnect": {
      "post": {
        "operationId": "post_account_integrations_provider_disconnect",
        "summary": "Disconnect",
        "description": "Disconnect an integration. OAuth (klaviyo, judgeme, gorgias, smile): revokes the connection with the provider and forgets its tokens, as the card's Disconnect does; a legacy Klaviyo private key is removed instead. API key (postscript, omnisend, mailchimp): removes the key and turns off its sync. Switch (shopify_flow, meta_pixel, split_order, shopify_customers): turns it off.\n\n**Note:** Connect with POST /account/integrations/:id/connect. Fails with the provider's error when it refuses; the tokens are kept then. Already disconnected is a 200 with changed false. Removing the Postscript key while it is the SMS provider sends SMS from STOQ, or blocks it when the shop is not verified for restricted content; /account/sending shows which.",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "disconnect klaviyo",
          "disconnect judge.me",
          "disconnect gorgias",
          "disconnect smile",
          "remove postscript key",
          "disconnect omnisend",
          "disconnect mailchimp",
          "turn off shopify flow"
        ],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/account/integrations/mailchimp/audiences": {
      "get": {
        "operationId": "get_account_integrations_mailchimp_audiences",
        "summary": "Mailchimp Audiences",
        "description": "The Mailchimp audiences (lists) the saved Mailchimp API key can see, to pick mailchimp.list_id for PATCH /account/integrations.",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "mailchimp audiences",
          "mailchimp lists"
        ]
      }
    },
    "/account/integrations/postscript/keywords": {
      "get": {
        "operationId": "get_account_integrations_postscript_keywords",
        "summary": "Postscript Keywords",
        "description": "The Postscript keywords on the saved Postscript account, to pick postscript.keyword and postscript.keyword_id for PATCH /account/integrations.",
        "tags": [
          "Account · Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "postscript keywords"
        ]
      }
    },
    "/account/languages": {
      "get": {
        "operationId": "get_account_languages",
        "summary": "Read",
        "description": "The shop's languages: default_locale (the language alerts and the signup widget use), app_locale (the dashboard language), whether multi-language support and translated product titles are on, and, when multi-language is on, the locales published in Shopify.",
        "tags": [
          "Account · Languages"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "languages",
          "alert language",
          "default language",
          "dashboard language",
          "multi language",
          "store locales"
        ]
      },
      "patch": {
        "operationId": "patch_account_languages",
        "summary": "Update",
        "description": "Update the shop's language settings: the dashboard language (app_locale), multi-language alerts and widget, and translated product titles in alerts.\n\n**Note:** Deep partial: absent fields are unchanged. app_locale only changes the merchant dashboard. multi_language_enabled false also turns product_translations_enabled off. product_translations_enabled true needs the read_translations access the Settings page asks for; the call fails until it is granted. To change the alert language (default_locale), use POST /account/languages/reset_locale, which also resets that language's copy, as the dashboard does.",
        "tags": [
          "Account · Languages"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "change dashboard language",
          "use stoq in french",
          "turn on multi language",
          "send alerts in the customer's language",
          "use translated product titles",
          "translate product titles"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "app_locale": {},
                  "multi_language_enabled": {},
                  "product_translations_enabled": {}
                }
              },
              "example": {
                "app_locale": "fr",
                "multi_language_enabled": true,
                "product_translations_enabled": true
              }
            }
          }
        }
      }
    },
    "/account/languages/reset_locale": {
      "post": {
        "operationId": "post_account_languages_reset_locale",
        "summary": "Reset Locale",
        "description": "Replace one language's widget and alert copy with STOQ's default text in that language, as the translation pages' reset does. With default_locale, first make that the language customers get alerts and the widget in, as the Settings page's language picker does.\n\n**Note:** Overwrites the copy the merchant wrote in that language. Other languages are left alone. locale is the language reset; omitted, it is default_locale when sent, else the shop's default language.",
        "tags": [
          "Account · Languages"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "default alert language",
          "change alert language",
          "change customer language",
          "reset translations",
          "restore default text"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "default_locale": {},
                  "locale": {}
                }
              },
              "example": {
                "default_locale": "fr",
                "locale": "fr"
              }
            }
          }
        }
      }
    },
    "/account/locations": {
      "get": {
        "operationId": "get_account_locations",
        "summary": "Read",
        "description": "The store's Shopify locations: shopify_location_id (a gid), name, and whether each is active. Use it to name the locations in back-in-stock delivery settings and in markets.",
        "tags": [
          "Account · Locations"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "locations",
          "shopify locations",
          "store locations",
          "warehouses"
        ]
      }
    },
    "/account/markets": {
      "get": {
        "operationId": "get_account_markets",
        "summary": "Read",
        "description": "The store's Shopify Markets (international selling) and how STOQ routes stock by market: active markets with their countries, the market setup, the market-to-location links, market URLs in alerts, and the single-market preorder location filter. Distinct from an offer's market availability or restock-alert locations. Only active markets are returned by default.\n\n**Note:** links count only while market_setup_type is \"multiple_markets\" and market_locations_enabled is true; they are kept when either is off.",
        "tags": [
          "Account · Markets"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "markets",
          "shopify markets",
          "international selling",
          "which markets",
          "sell internationally"
        ],
        "parameters": [
          {
            "name": "include_drafts",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      },
      "patch": {
        "operationId": "patch_account_markets",
        "summary": "Update",
        "description": "Update how the store routes stock by market, for back in stock and preorders alike: the market setup, the market-to-location links and whether they are used, market URLs, and the single-market location filter.\n\n**Note:** Deep partial: absent fields are unchanged. links and preorder_location_filter.shopify_location_ids replace the stored list when present. Market and location ids are checked against Shopify.",
        "tags": [
          "Account · Markets"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "market_setup_type": "multiple_markets",
                  "market_locations_enabled": true,
                  "market_urls_enabled": false,
                  "preorder_location_filter": {
                    "enabled": false,
                    "shopify_location_ids": []
                  },
                  "links": [
                    {
                      "shopify_market_id": "gid://shopify/Market/12345",
                      "shopify_location_id": "gid://shopify/Location/67890"
                    }
                  ],
                  "also_changed": [
                    "preorder_location_filter.enabled"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "link market to inventory location",
          "market based locations",
          "sell in multiple markets",
          "preorder market setup",
          "count stock at specific locations",
          "preorder location filter",
          "filter preorder locations",
          "use market urls in alerts"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "market_setup_type": {},
                  "market_locations_enabled": {},
                  "market_urls_enabled": {},
                  "preorder_location_filter": {},
                  "links": {}
                }
              },
              "example": {
                "market_setup_type": "multiple_markets",
                "market_locations_enabled": true,
                "links": [
                  {
                    "shopify_market_id": "gid://shopify/Market/12345",
                    "shopify_location_id": "gid://shopify/Location/67890"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/account/plan_usage": {
      "get": {
        "operationId": "get_account_plan_usage",
        "summary": "Read",
        "description": "The shop's current STOQ plan, the limits it includes, and a calendar month's usage against them (back-in-stock email and SMS alerts, SMS segments, preorders).\n\n**Note:** usage.by_template splits the month's back-in-stock email and SMS alerts by notification template, as the usage card's breakdown does: template_position 0 is the back-in-stock alert, 1 the first reminder.",
        "tags": [
          "Account · Plan Usage"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "plan and usage",
          "what plan am I on",
          "how much have I used",
          "usage this month",
          "plan limits"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/account/sending": {
      "get": {
        "operationId": "get_account_sending",
        "summary": "Read",
        "description": "Who sends each customer notification, and STOQ's own sending settings. `notifications` nests each channel under its notification: back_in_stock (signup_thank_you, restock_alert, reminder) and preorders (confirmation, shipping_update, payment_failed), each channel with `sender` (who sends it right now, worked out by the same code the sender runs; null means it is not sent) and `fallback_reason` (why the sender is not the chosen email_provider or sms_provider: credentials_missing, flow_unverified, flow_trigger_disabled, flow_not_supported, custom_html_template). stoq is STOQ's own email and SMS. Also returns the sender name and address, reply-to, the custom sending domain and its DKIM check, and whether STOQ lets the shop send: email_allowed (false when STOQ has blocked the shop's email), sms_allowed (SMS approved) and sms_restricted_content_verified (staff reviewed the SMS content). STOQ sets these three; they cannot be written. sending_paused, present only when STOQ blocks a channel, says alerts on it will not go out. custom_address_status says where sending from the merchant's own address stands: not_set (use_custom_email_address is off or no address of their own), pending (DKIM for the address's domain is not verified yet, so mail goes from STOQ's address) or verified (mail goes from the merchant's address). The DNS records to add while pending come from POST /account/sending/verify_domain, which asks Amazon SES.",
        "tags": [
          "Account · Sending"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "email provider",
          "sms provider",
          "sender address",
          "from address",
          "custom sending domain",
          "sending settings",
          "who sends my notifications",
          "is klaviyo sending my alerts",
          "why did stoq send instead of klaviyo",
          "is my sender address verified",
          "why are emails not sent from my address"
        ]
      },
      "patch": {
        "operationId": "patch_account_sending",
        "summary": "Update",
        "description": "Update who sends the shop's customer notifications: email and SMS provider, sender name, the merchant's own sending address, store domain in SMS links, Klaviyo marketing consent and the Postscript API key (write only). The email font, text sizes and logo size are PATCH /account/templates/email_style.\n\n**Note:** Deep partial: absent fields are unchanged. Applies to back-in-stock and preorder notifications. use_custom_email_address true needs email_reply_to_address on a domain that is not a free mail provider, and DKIM set up for it (POST /account/sending/verify_domain) before mail goes out from it. postscript_api_key is never returned by any read; it is checked with Postscript before anything is saved, and nothing is saved when Postscript refuses it; \"\" removes it.",
        "tags": [
          "Account · Sending"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "switch email provider",
          "send emails with klaviyo",
          "send emails from stoq",
          "switch sms provider",
          "use postscript",
          "set postscript api key",
          "change sender name",
          "send from my own email address",
          "use store domain in sms links",
          "change preorder notification provider"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email_provider": {},
                  "sms_provider": {},
                  "email_from_name": {},
                  "use_custom_email_address": {},
                  "email_reply_to_address": {},
                  "sms_custom_domain_enabled": {},
                  "klaviyo_skip_auto_subscribe": {},
                  "postscript_api_key": {}
                }
              },
              "example": {
                "email_provider": "string",
                "sms_provider": "string",
                "email_from_name": "Summer Sneaker Drop",
                "use_custom_email_address": "string",
                "email_reply_to_address": "string",
                "sms_custom_domain_enabled": true,
                "klaviyo_skip_auto_subscribe": "string",
                "postscript_api_key": "string"
              }
            }
          }
        }
      }
    },
    "/account/sending/verify_domain": {
      "post": {
        "operationId": "post_account_sending_verify_domain",
        "summary": "Verify Domain",
        "description": "Check with Amazon SES whether the domain of the merchant's own sending address (email_reply_to_address) is verified for sending, and return the DKIM DNS records to add when it is not, as the email settings' domain check does.\n\n**Note:** Registers the domain with SES the first time, as the dashboard does, so the DNS records exist. dkim_verified is what SES reports now; DNS changes can take up to 72 hours to show. dns_records lists the CNAME records ({ name, type, value }) to add, empty once DKIM is on: the records for a pending custom_address_status on GET /account/sending, as the Address drawer's Download records gives them. A pass is saved, so custom_address_status turns verified and mail goes from the address at once.",
        "tags": [
          "Account · Sending"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "verify sending domain",
          "check dkim",
          "dkim records",
          "is my email domain verified"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/account/settings/{section_id}": {
      "get": {
        "operationId": "get_account_settings_section_id",
        "summary": "Read",
        "description": "One settings section: label, description, `settings` (the output of the read actions behind it, keyed by block, e.g. settings.widget is GET /back_in_stock/settings/widget), `columns` (field path => model column) and `raw` (field path => stored value). Sections: delivery_settings, signup_widget, notification_channels, notification_templates, preorder_notifications, preorder_pages, preorder_storefront_text, integrations, languages.",
        "tags": [
          "Account · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "app settings",
          "current settings",
          "settings section",
          "notification settings",
          "delivery settings",
          "signup widget settings"
        ],
        "parameters": [
          {
            "name": "section_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/account/setup": {
      "get": {
        "operationId": "get_account_setup",
        "summary": "Read",
        "description": "Whether STOQ's app embed is on in the published theme: status enabled, disabled, or unknown when the theme could not be read, with the theme editor link that turns it on when it is not on. The embed adds the Preorder and Notify me buttons to the storefront.",
        "tags": [
          "Account · Setup"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "is the app embed on",
          "app embed",
          "app embed status",
          "theme app extension",
          "buttons not showing on storefront"
        ]
      }
    },
    "/account/setup_guide": {
      "get": {
        "operationId": "get_account_setup_guide",
        "summary": "Read",
        "description": "The setup guide on the dashboard's Home page, for back_in_stock and preorders: whether the merchant chose that product on the welcome page (chosen), each step in order with done, steps_done, next_step (null once the guide is complete) and completed_at (set when every step is done or the guide was skipped). Back in stock: app_embed, design_widget, first_signup, first_alert_sent, with first_signup_id while the guide is open. Preorders: app_embed, first_offer, first_product, first_order.\n\n**Note:** Same steps and rules as the Home page guide. Reading it marks a guide complete once all its steps are done, as the dashboard does. The app embed itself (status and the theme editor link) is GET /account/setup. Home shows a guide only when chosen and not completed more than a day ago (shown_on_home); a completed guide leaves Home by itself, so it needs no skip. Dismiss on Home is remembered by that browser only, so it is not here. If the merchant still sees a guide that shown_on_home says is hidden, ask what the card says and where it shows; never guess a cause such as a cache, and never name a card title or button this read does not give.",
        "tags": [
          "Account · Setup Guide"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "setup guide",
          "onboarding",
          "onboarding steps",
          "getting started",
          "setup progress",
          "what is left to set up",
          "is stoq set up"
        ]
      }
    },
    "/account/setup_guide/skip": {
      "post": {
        "operationId": "post_account_setup_guide_skip",
        "summary": "Skip",
        "description": "Skip the Home page setup guide, as its Skip setup button does: the guide is marked done and hidden for good. flow is back_in_stock or preorders; leave it out to skip both.\n\n**Note:** Cannot be undone, as in the dashboard. Returns the setup guide.",
        "tags": [
          "Account · Setup Guide"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "skip setup guide",
          "skip onboarding",
          "hide setup guide",
          "hide getting started"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "flow": {}
                }
              },
              "example": {
                "flow": "string"
              }
            }
          }
        }
      }
    },
    "/account/templates/{campaign_type}/translations": {
      "get": {
        "operationId": "get_account_templates_campaign_type_translations",
        "summary": "Translations",
        "description": "Read every translation override on the preorder confirmation template, plus the full enumeration of translatable field paths, each field's default-locale source text, and every locale the shop has actually published. campaign_type is \"preorder\"; back-in-stock notifications are GET /back_in_stock/templates/:key/translations.",
        "tags": [
          "Account · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get notification translations",
          "template translations",
          "email translations",
          "sms translations"
        ],
        "parameters": [
          {
            "name": "campaign_type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "position",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/account/templates/email_style": {
      "get": {
        "operationId": "get_account_templates_email_style",
        "summary": "Email Style",
        "description": "The look every STOQ email shares, back-in-stock and preorder alike: font, header and description text sizes, logo size, and logo_url (the uploaded logo, null when there is none). The template editor sets these for every template at once.",
        "tags": [
          "Account · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "email style",
          "email font",
          "email text size",
          "email logo size",
          "email logo"
        ]
      },
      "patch": {
        "operationId": "patch_account_templates_email_style",
        "summary": "Email Style",
        "description": "Update the look every STOQ email shares, back-in-stock and preorder alike: font, header and description text sizes, and logo size.\n\n**Note:** Deep partial: absent fields are unchanged. Applies to every notification template at once, as the template editor does. Sizes are whole pixels above 0.",
        "tags": [
          "Account · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "change email font",
          "change email text size",
          "change email logo size",
          "email style"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "font_family": {},
                  "header_font_size": {},
                  "description_font_size": {},
                  "logo_size": {}
                }
              },
              "example": {
                "font_family": "string",
                "header_font_size": "string",
                "description_font_size": "string",
                "logo_size": "string"
              }
            }
          }
        }
      }
    },
    "/account/templates/email_style/logo": {
      "post": {
        "operationId": "post_account_templates_email_style_logo",
        "summary": "Email Style Logo",
        "description": "Upload the logo every STOQ email shows, back-in-stock and preorder alike, as the template editor's logo drop zone does. Replaces the current logo.\n\n**Note:** Send the image as multipart/form-data in the `file` field: a PNG, JPEG, GIF or WebP file of 2 MB or less, checked from the file's bytes, not the type it is sent as. There is no URL upload, as there is none in the dashboard. Returns the email style with the new logo_url; logo_size sets its width.",
        "tags": [
          "Account · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "upload email logo",
          "change email logo",
          "add logo to emails"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {}
                }
              },
              "example": {
                "file": "string"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_account_templates_email_style_logo",
        "summary": "Email Style Logo",
        "description": "Remove the logo from every STOQ email, as the template editor's Remove logo link does.",
        "tags": [
          "Account · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "remove email logo",
          "delete email logo"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/account/theme_integrations": {
      "post": {
        "operationId": "post_account_theme_integrations",
        "summary": "Create",
        "description": "Request a theme integration, as the page editors' Request setup button does: Quick Buy (the 'Notify me'/'Preorder' button inside the theme's quick add popup) on the home, collection or search page, or Featured products (the button on featured product sections) on the home page. Our team sets it up for the theme, usually within 12-24 hours, and tells the merchant by email or chat. Paid plans only.\n\n**Note:** type is quick_buy or featured_product. page is home, collection or search for quick_buy and home for featured_product. Returns the new row with enabled null; read it back with GET /account/theme_integrations/:id. A page that already has one is 409.",
        "tags": [
          "Account · Theme Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "request quick buy",
          "set up quick buy",
          "request quick add integration",
          "request featured product integration",
          "set up featured products",
          "request setup"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "minLength": 1,
                    "enum": [
                      "quick_buy",
                      "featured_product"
                    ]
                  },
                  "page": {
                    "type": "string",
                    "minLength": 1,
                    "enum": [
                      "collection",
                      "home",
                      "search"
                    ]
                  }
                },
                "required": [
                  "type",
                  "page"
                ]
              },
              "example": {
                "type": "quick_buy",
                "page": "collection"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "get_account_theme_integrations",
        "summary": "List",
        "description": "The theme integrations the merchant requested from the page editors (Back in stock > Customize and Preorders > Settings > Pages): Quick Buy on the home, collection or search page, and Featured products on the home page. enabled is null while our team sets one up, then true or false. A page with no row has not been requested.",
        "tags": [
          "Account · Theme Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "theme integrations",
          "quick buy",
          "quick add",
          "featured product integration",
          "integration request status",
          "requested integrations"
        ]
      }
    },
    "/account/theme_integrations/{id}": {
      "get": {
        "operationId": "get_account_theme_integrations_id",
        "summary": "Read",
        "description": "One theme integration (Quick Buy or Featured products) by id. enabled is null while our team sets it up, then true or false.",
        "tags": [
          "Account · Theme Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "theme integration status",
          "quick buy status",
          "featured product status"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch_account_theme_integrations_id",
        "summary": "Update",
        "description": "Turn a theme integration (Quick Buy or Featured products) on or off, as the page editors' checkbox does once our team has set it up. Paid plans only.\n\n**Note:** One field, enabled. A row whose enabled is still null is being set up and is 409 until our team finishes.",
        "tags": [
          "Account · Theme Integrations"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "turn on quick buy",
          "turn off quick buy",
          "enable quick buy",
          "disable quick buy",
          "enable featured product integration",
          "disable featured product integration"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ]
              },
              "example": {
                "enabled": true
              }
            }
          }
        }
      }
    },
    "/account/translations": {
      "get": {
        "operationId": "get_account_translations",
        "summary": "Read",
        "description": "Read every translation override on the shop's notify-me button, signup form, and preorder button/modal text, plus the full enumeration of translatable field paths, each field's default-locale source text, and every locale the shop has actually published.",
        "tags": [
          "Account · Translations"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get widget translations",
          "signup form translations",
          "notify me translations",
          "shop translations"
        ]
      }
    },
    "/account/web_pixel/enable": {
      "post": {
        "operationId": "post_account_web_pixel_enable",
        "summary": "Enable",
        "description": "Turn on the STOQ web pixel, the dashboard's \"Set up tracking\" button on the Products > Engagement view. It records storefront button impressions, clicks and add-to-carts for the back-in-stock and preorder engagement reports.\n\n**Note:** Registers the pixel with Shopify once; calling it again when it is on changes nothing and returns already_installed true. Engagement reads say whether it is on in pixel_active. Data starts from the moment it is on.",
        "tags": [
          "Account · Web Pixel"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "set up tracking",
          "enable tracking",
          "turn on the web pixel",
          "install the pixel",
          "enable engagement tracking"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/back_in_stock/app_proxy/detect": {
      "get": {
        "operationId": "get_back_in_stock_app_proxy_detect",
        "summary": "Detect",
        "description": "Find which app proxy path the storefront answers, from the paths STOQ installs with. detected is that path, or null when none answers (or the storefront password hides it).",
        "tags": [
          "Back In Stock · App Proxy"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "detect app proxy",
          "find app proxy path"
        ]
      }
    },
    "/back_in_stock/app_proxy/verify": {
      "get": {
        "operationId": "get_back_in_stock_app_proxy_verify",
        "summary": "Verify",
        "description": "Check that the storefront answers the app proxy path the store-domain opt-in link uses. valid is true or false; it is null with password_protected true while the storefront password hides the answer.",
        "tags": [
          "Back In Stock · App Proxy"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "verify app proxy",
          "check app proxy path",
          "test the app proxy"
        ],
        "parameters": [
          {
            "name": "path_prefix",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/customers": {
      "get": {
        "operationId": "get_back_in_stock_customers",
        "summary": "List",
        "description": "List the shop's customers (everyone who signed up for an alert or placed a preorder), newest first, as the Reports page's Customers tab does.\n\n**Note:** query matches part of the customer's email or phone, like the tab's search. unsubscribed_at is set when the customer is unsubscribed from back-in-stock notifications. accepts_marketing is the marketing consent they gave.",
        "tags": [
          "Back In Stock · Customers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "list customers",
          "customers tab",
          "back in stock customers",
          "who signed up",
          "search customers",
          "unsubscribed customers"
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/customers/{id}": {
      "delete": {
        "operationId": "delete_back_in_stock_customers_id",
        "summary": "Delete",
        "description": "Delete a customer, as the customer page's Delete customer does: their signups, notifications, preorders and analytics go with them.\n\n**Note:** Cannot be undone.",
        "tags": [
          "Back In Stock · Customers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "delete customer",
          "remove customer",
          "erase customer data",
          "forget this customer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "get": {
        "operationId": "get_back_in_stock_customers_id",
        "summary": "Read",
        "description": "Read one customer, as the header of their page under the Customers tab shows it.\n\n**Note:** Their signups are GET /back_in_stock/signups?customer_id=.",
        "tags": [
          "Back In Stock · Customers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "show customer",
          "customer details",
          "is this customer subscribed"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/back_in_stock/customers/{id}/subscribe": {
      "post": {
        "operationId": "post_back_in_stock_customers_id_subscribe",
        "summary": "Subscribe",
        "description": "Subscribe a customer to back-in-stock notifications again, with all their signups, as the customer page's Subscribe does.\n\n**Note:** Clears unsubscribed_at on the customer and their signups. Already subscribed is a no-op.",
        "tags": [
          "Back In Stock · Customers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "resubscribe customer",
          "subscribe customer",
          "turn notifications back on for customer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/back_in_stock/customers/{id}/unsubscribe": {
      "post": {
        "operationId": "post_back_in_stock_customers_id_unsubscribe",
        "summary": "Unsubscribe",
        "description": "Unsubscribe a customer from ALL back-in-stock notifications, every product and future signups, as the customer page's Unsubscribe does. To take them off one product's list, delete that signup instead; use this only when they ask to stop everything. An unsubscribe that names a product (\"unsubscribe jo@x.com from the Blue Tee\") means delete that one signup, not this.\n\n**Note:** Sets unsubscribed_at on the customer and their signups; they get no more alerts until subscribed again.",
        "tags": [
          "Back In Stock · Customers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "unsubscribe customer",
          "stop notifications for customer",
          "opt customer out"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/back_in_stock/customers/bulk_delete": {
      "post": {
        "operationId": "post_back_in_stock_customers_bulk_delete",
        "summary": "Bulk Delete",
        "description": "Delete up to 100 customers in one request, as the Customers tab's Delete customers bulk action does: their signups, notifications, preorders and analytics go with them.\n\n**Note:** All or nothing: when any id is unknown, nothing is deleted and the 422 lists each one under failed[]. Cannot be undone.",
        "tags": [
          "Back In Stock · Customers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk delete customers",
          "delete these customers",
          "remove customers in bulk"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "customer_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "customer_ids"
                ]
              },
              "example": {
                "customer_ids": [
                  "string"
                ]
              }
            }
          }
        }
      }
    },
    "/back_in_stock/notification_settings": {
      "get": {
        "operationId": "get_back_in_stock_notification_settings",
        "summary": "List",
        "description": "List the back-in-stock notifications in send order (signup_thank_you, restock_alert, reminder): whether each one sends (`enabled`) and, for the reminder, how many days after the restock alert it sends (`after_n_days`).\n\n**Note:** Each notification's copy is GET /back_in_stock/templates/:key, with the same key.",
        "tags": [
          "Back In Stock · Notification Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "list back in stock notifications",
          "show the alert sequence",
          "when does the reminder send",
          "is the signup thank you email on",
          "are back in stock alerts on",
          "notification settings"
        ]
      }
    },
    "/back_in_stock/notification_settings/{key}": {
      "get": {
        "operationId": "get_back_in_stock_notification_settings_key",
        "summary": "Read",
        "description": "Read whether one back-in-stock notification sends and, for the reminder, when. key is \"signup_thank_you\", \"restock_alert\" or \"reminder\".",
        "tags": [
          "Back In Stock · Notification Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "is the reminder on",
          "is the restock alert on",
          "reminder timing"
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch_back_in_stock_notification_settings_key",
        "summary": "Update",
        "description": "Turn a back-in-stock notification on or off, or change when the reminder sends. key is \"signup_thank_you\", \"restock_alert\" or \"reminder\". `enabled` (true/false) works on every key; for \"restock_alert\" it is the Notifications card's \"Send automatic notification\" switch, so false stops automatic back-in-stock alerts. `after_n_days` (1 or more) is the reminder's wait after the restock alert.\n\n**Note:** Partial. after_n_days is only accepted for the reminder. Errors are 422 keyed \"notification_setting.<field>\".",
        "tags": [
          "Back In Stock · Notification Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "change reminder timing",
          "send the reminder after 3 days",
          "turn on the restock reminder",
          "turn off the restock reminder",
          "turn off automatic back in stock alerts",
          "stop sending restock alerts",
          "enable signup thank you email",
          "turn off signup thank you email"
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {},
                  "after_n_days": {}
                }
              },
              "example": {
                "enabled": true,
                "after_n_days": "string"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/notifications": {
      "get": {
        "operationId": "get_back_in_stock_notifications",
        "summary": "List",
        "description": "List back-in-stock notifications (the send log) in this shop, paginated.\n\n**Note:** status=blocked surfaces sends that did not go out, with blocked_reason (the stored text), blocked_reason_code and blocked_reason_label. Every response has a summary (total, sent, blocked, blocked_by_reason) that counts every row matching the filters, not only this page. group_by=product returns counts per product (sent, blocked, and blocked by reason code) instead of rows, paginated by product. A bare from/to date is that whole day in the shop's time zone.",
        "tags": [
          "Back In Stock · Notifications"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "list notifications",
          "back in stock send log",
          "restock notifications sent",
          "who got notified",
          "notification history",
          "show sent restock alerts"
        ],
        "parameters": [
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "email",
                "sms"
              ]
            },
            "example": "email"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "sent",
                "blocked"
              ]
            },
            "example": "sent"
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "product"
              ]
            },
            "example": "product"
          },
          {
            "name": "shopify_variant_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "45000000001"
          },
          {
            "name": "shopify_product_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "78000000001"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/notifications/{id}": {
      "get": {
        "operationId": "get_back_in_stock_notifications_id",
        "summary": "Read",
        "description": "Read one back-in-stock notification (a single send-log entry).",
        "tags": [
          "Back In Stock · Notifications"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "show notification",
          "get notification",
          "look up sent restock alert",
          "notification details"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/back_in_stock/orders": {
      "get": {
        "operationId": "get_back_in_stock_orders",
        "summary": "List",
        "description": "List orders placed after a back-in-stock alert, paginated. search matches order number/name, customer name, email, a Shopify order id (10+ digits), an order gid (gid://shopify/Order/<id>), or a Shopify admin order URL.\n\n**Note:** Filters match Reports > Back in stock > Sales recovered and combine with AND. product_match_type same_as_notification keeps orders where the customer bought the exact variant they were alerted about (the dashboard's Order matching: Exact variant match only). shopify_variant_id and shopify_product_id (gids) keep orders containing that variant or product, like a product's Orders tab. A bare from/to date is that whole day in the shop's time zone.",
        "tags": [
          "Back In Stock · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "list back in stock orders",
          "restock alert orders",
          "notification orders",
          "orders from restock alerts",
          "sales recovered"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "product_match_type",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "shopify_variant_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "45000000001"
          },
          {
            "name": "shopify_product_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "78000000001"
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/products": {
      "get": {
        "operationId": "get_back_in_stock_products",
        "summary": "Read",
        "description": "Read per-product back-in-stock configuration: notify-me button visibility (always_show / when_out_of_stock / never_show), restock message and assigned widget template (widget_template_id, from GET /back_in_stock/widget_templates) for each variant, plus whether the shop-level per-product customization toggle is on. Each row also has the variant's pending and total signups (count_by as on the dashboard) and its lifetime back-in-stock units sold and revenue. Without search, rows are the variants STOQ has activity for (signups, per-product settings, offers), sorted by pending signups, most first. search (product name, variant title, SKU, product URL or id) also looks the term up in the Shopify catalog: matching variants STOQ has no row for come after the STOQ rows, with default settings and zero counts. Every row has has_stoq_activity; a search response has catalog_searched (false when the catalog was skipped or could not be reached). Filter with shopify_product_id, shopify_variant_id, overrides_only=true or has_waitlist=true; the last two only match STOQ rows, so they skip the catalog. Shopify ids are gids both ways, e.g. \"gid://shopify/ProductVariant/123\".\n\n**Note:** Any of sort, group_by, after, product_status, button_visibility, restock_message or restock_message_query lists the dashboard's Products tab instead: the whole Shopify catalog, sorted by sort (title_asc, the default, title_desc, created_desc, created_asc), limit rows per page (default 20, max 100), search matching title or SKU. product_status is a comma list of active, draft, archived, unlisted. button_visibility (comma list of the three values) and restock_message (has or none) with restock_message_query (text the message contains) only match variants STOQ has a row for, as on the tab; with them product_status_filter_skipped is true when product statuses could not be checked and the status filter was left out. group_by=product returns products, each with its variants. Pass the response's end_cursor as after for the next page while has_next_page is true. shopify_product_id, shopify_variant_id, overrides_only and has_waitlist cannot be combined with these.",
        "tags": [
          "Back In Stock · Products"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "which products have custom notify me settings",
          "per product back in stock config",
          "product button visibility",
          "products tab settings"
        ],
        "parameters": [
          {
            "name": "count_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "customers",
                "signups"
              ]
            },
            "example": "customers"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "title_asc",
                "title_desc",
                "created_desc",
                "created_asc"
              ]
            },
            "example": "title_asc"
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "variant",
                "product"
              ]
            },
            "example": "variant"
          },
          {
            "name": "restock_message",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "has",
                "none"
              ]
            },
            "example": "has"
          },
          {
            "name": "shopify_product_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "78000000001"
          },
          {
            "name": "shopify_variant_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "45000000001"
          },
          {
            "name": "overrides_only",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "has_waitlist",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {},
            "example": 5
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "product_status",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "button_visibility",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "restock_message_query",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      },
      "patch": {
        "operationId": "patch_back_in_stock_products",
        "summary": "Update",
        "description": "Update per-product back-in-stock configuration for one or more products or variants (the \"Back in stock alerts -> Products\" tab). `targets` is a list; a target with shopify_variant_id changes just that VARIANT, a target with only shopify_product_id changes EVERY variant of that product. The same field values are applied to every target, so send one call per distinct set of values. button_visibility is one of \"always_show\" (notify-me button shown even while the item is IN stock -- WARNING: this also DISABLES automatic back-in-stock alerts for that variant, so the merchant has to notify signups manually), \"when_out_of_stock\" (the default: button appears only when out of stock and alerts send automatically) or \"never_show\" (button hidden on the storefront). restock_message is the free-text note shown under the button (e.g. \"Back in stock March 15\"); send an empty string to clear it. widget_template_id is a widget template id from GET /back_in_stock/widget_templates, or null to fall back to the global widget design. Target ids are Shopify gids. automatic_alerts_disabled (true/false) directly turns this variant's automatic back-in-stock alert on restock off (true) or on (false) -- the same control as the variant's own \"Enable/Disable alerts\" button, independent of button_visibility, and the field GET /back_in_stock/products reads back. Send false to fix a variant showing \"Disabled\" for automatic alerts, not button_visibility. If both button_visibility: \"always_show\" and automatic_alerts_disabled are sent in the same call, automatic_alerts_disabled wins. Per-product visibility/message/template values only take effect while the shop-level toggle configure_notify_me_enabled is on; when it is off this action refuses rather than store values that would not apply, unless enable_customization: true is passed, which turns the toggle on as part of this change (a no-op when already on). automatic_alerts_disabled is NOT gated by configure_notify_me_enabled -- it applies regardless. per_product_customization_enabled (true/false), sent on its own with no targets, turns that shop-level toggle on or off (off = the tab's \"Disable per-product overrides\").\n\n**Note:** Bulk-safe: a single call may address up to 100 targets and writes them in one transaction with the Shopify metafield syncs fired once for the whole batch. A target STOQ has no product_variants row for is looked up in the shop's Shopify catalog; when it is there, its rows are created (one per variant for a product target) and the change is applied to them. Ids in neither are reported in `unmatched`. Deleting a back-in-stock template clears it from every product/variant it was assigned to (they fall back to the global design); template CRUD lives on the templates capability. automatic_alerts_enabled is the deprecated, inverted name for automatic_alerts_disabled: it is still applied, and the response carries a warning.",
        "tags": [
          "Back In Stock · Products"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "hide the notify me button on these products",
          "always show the notify me button",
          "show the notify me button even when in stock",
          "hide notify me on discontinued products",
          "add a restock message to a product",
          "set a back in stock date on a product",
          "clear the restock note",
          "use a custom back in stock template on this product",
          "assign a template to a product",
          "per product notify me settings",
          "per product back in stock settings",
          "button visibility for a product",
          "disable per product overrides",
          "turn off per product customization"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "widget_template_id": {
                    "type": [
                      "null",
                      "integer"
                    ]
                  },
                  "targets": {},
                  "button_visibility": {},
                  "restock_message": {},
                  "enable_customization": {},
                  "automatic_alerts_disabled": {},
                  "per_product_customization_enabled": {}
                }
              },
              "example": {
                "widget_template_id": "string",
                "targets": "string",
                "button_visibility": "string",
                "restock_message": "string",
                "enable_customization": "string",
                "automatic_alerts_disabled": "string",
                "per_product_customization_enabled": true
              }
            }
          }
        }
      }
    },
    "/back_in_stock/reports": {
      "get": {
        "operationId": "get_back_in_stock_reports",
        "summary": "List",
        "description": "List every available back-in-stock report (name, description, aliases, url).",
        "tags": [
          "Back In Stock · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "reports",
          "list reports",
          "available reports",
          "what reports are there",
          "report catalog"
        ]
      }
    },
    "/back_in_stock/reports/conversions": {
      "get": {
        "operationId": "get_back_in_stock_reports_conversions",
        "summary": "Conversions",
        "description": "The Back in stock Overview orders chart: orders attributed to back-in-stock alerts and their revenue per day, week or month.\n\n**Note:** The same points as the dashboard chart, counted live: orders attributed at medium or high confidence. interval is daily up to 60 days, weekly up to 180, then monthly, and buckets are UTC days as on the chart. range=all_time is the dashboard's All time.",
        "tags": [
          "Back In Stock · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "did the alerts convert",
          "recovered revenue",
          "conversion trend",
          "orders from alerts",
          "revenue recovered over time"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/reports/engagement": {
      "get": {
        "operationId": "get_back_in_stock_reports_engagement",
        "summary": "Engagement",
        "description": "Back-in-stock \"Notify me\" button engagement: impressions, clicks, click rate, signups and signup rate, shop-wide and per variant — the merchant's Products > Engagement view.\n\n**Note:** Rates use unique shoppers; total_* fields count every event. from/to default to the shop's lifetime. variants is paged and sorted by sort_by (default impressions); shopify_variant_ids narrows it. This is button engagement, not conversion — orders from notified customers are in /back_in_stock/reports/summary. pixel_active is false until the STOQ web pixel is set up (POST /account/web_pixel/enable); the dashboard shows a set-up prompt instead of these numbers then. Each variant row's image_url is the variant's stored image, else the product's (null if none is stored).",
        "tags": [
          "Back In Stock · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "notify me engagement",
          "back in stock funnel",
          "click rate",
          "signup rate",
          "back in stock button engagement"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "shopify_market_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "gid://shopify/Market/12345"
          },
          {
            "name": "shopify_variant_ids",
            "in": "query",
            "required": false,
            "schema": {},
            "example": [
              "45000000001"
            ]
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/reports/notifications": {
      "get": {
        "operationId": "get_back_in_stock_reports_notifications",
        "summary": "Notifications",
        "description": "The Back in stock Overview notifications chart: emails and delivered SMS sent per day, week or month, with the orders attributed to them.\n\n**Note:** The same points as the dashboard chart, counted live. notifications_sent is emails_sent plus sms_sent. interval is daily up to 60 days, weekly up to 180, then monthly, and buckets are UTC days as on the chart. range=all_time is the dashboard's All time.",
        "tags": [
          "Back In Stock · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "notification trend",
          "alerts sent",
          "sends by channel",
          "how many alerts went out"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/reports/product_revenue": {
      "get": {
        "operationId": "get_back_in_stock_reports_product_revenue",
        "summary": "Product Revenue",
        "description": "Revenue, units and orders from back-in-stock alerts per variant (or product), as the dashboard's revenue table.\n\n**Note:** revenue is the line revenue of the alerted items only (not whole orders), so rows add up to the total without overlap. units_sold is item quantity; orders is distinct orders containing the item. image_url is the variant's stored image, else the product's (null if none is stored).",
        "tags": [
          "Back In Stock · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "revenue by product",
          "which products recovered revenue",
          "back in stock product revenue",
          "top selling restocked products",
          "units sold from alerts"
        ],
        "parameters": [
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "variant",
                "product"
              ]
            },
            "example": "variant"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/reports/products_in_demand": {
      "get": {
        "operationId": "get_back_in_stock_reports_products_in_demand",
        "summary": "Products In Demand",
        "description": "The Products in demand table: variants (or products) ranked by back-in-stock demand, with signups created in the window, how many of them are still waiting, and the last request.\n\n**Note:** The same rows as the dashboard table. total counts signups created in the window; pending counts those of them not yet notified. count_by=customers counts a shopper signed up on several channels once; omitted, it follows the dashboard default, and the response's count_by says which. group_by=product ranks products instead of variants. search matches product title or SKU; vendors, tags and shopify_market_ids are comma-separated lists, as the table's filters. Deleted variants are hidden when the shop's dashboard hides them. image_url is the variant's image, else the product's. Variant rows only: include_inventory=true adds inventory_available, the stock available in the locations the shop's market or location filter allows (summed, null when Shopify has no level), and include_prices=true adds price and compare_at_price in the shop's currency, as the table's Inventory and Price columns. Each asks Shopify once per page. include_totals=true adds totals { pending, total }, the pending and total columns summed over every row the filters keep, not just this page.",
        "tags": [
          "Back In Stock · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "window": {
                    "from": "2026-05-26T00:00:00Z",
                    "to": "2026-06-25T23:59:59Z"
                  },
                  "group_by": "variant",
                  "sort_by": "pending",
                  "direction": "desc",
                  "count_by": "customers",
                  "rows": [
                    {
                      "shopify_variant_id": "gid://shopify/ProductVariant/47284734423096",
                      "shopify_product_id": "gid://shopify/Product/8784906035384",
                      "variant_title": "Blue / Medium",
                      "product_title": "Classic Sneaker",
                      "sku": "CS-BLU-M",
                      "pending": 47,
                      "total": 89,
                      "last_requested_at": "2026-06-25T11:30:00Z"
                    },
                    {
                      "shopify_variant_id": "gid://shopify/ProductVariant/47284734455864",
                      "shopify_product_id": "gid://shopify/Product/8784906035384",
                      "variant_title": "Red / Large",
                      "product_title": "Classic Sneaker",
                      "sku": "CS-RED-L",
                      "pending": 23,
                      "total": 56,
                      "last_requested_at": "2026-06-25T09:15:00Z"
                    }
                  ],
                  "meta": {
                    "total_count": 287,
                    "page": 1,
                    "per_page": 50,
                    "total_pages": 6
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "demand report",
          "what should I restock",
          "most wanted products",
          "top requested variants",
          "products in demand",
          "restock priorities"
        ],
        "parameters": [
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "variant",
                "product"
              ]
            },
            "example": "variant"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "pending",
                "total",
                "last_requested_at"
              ]
            },
            "example": "pending"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ]
            },
            "example": "asc"
          },
          {
            "name": "count_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "customers",
                "signups"
              ]
            },
            "example": "customers"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "shopify_market_ids",
            "in": "query",
            "required": false,
            "schema": {},
            "example": [
              "gid://shopify/Market/12345"
            ]
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "vendors",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "tags",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "include_inventory",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "include_prices",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "include_totals",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/reports/signups": {
      "get": {
        "operationId": "get_back_in_stock_reports_signups",
        "summary": "Signups",
        "description": "The Back in stock Overview signups chart: back-in-stock signups created per day, week or month.\n\n**Note:** The same points as the dashboard chart. One signup is one person waiting on one variant, so email and SMS for the same variant count once. interval is daily up to 60 days, weekly up to 180, then monthly, and buckets are UTC days as on the chart. range=all_time is the dashboard's All time.",
        "tags": [
          "Back In Stock · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "signup trend",
          "signups over time",
          "waitlist growth",
          "new signups",
          "daily signups"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/reports/summary": {
      "get": {
        "operationId": "get_back_in_stock_reports_summary",
        "summary": "Summary",
        "description": "The Back in stock Overview tiles over a date window: attributed orders and their revenue, average order value, distinct buyers, signups, and notifications sent by email and SMS.\n\n**Note:** The same numbers as the dashboard tiles and the Home analytics card, summed from the shop's daily totals. range=all_time reads revenue, orders, signups and notifications sent from the shop's lifetime totals, as Home's All time does. sms_sent counts every SMS sent, delivered or not, as plan usage does. Shop-wide only. For people still waiting use products_in_demand or wait_duration.",
        "tags": [
          "Back In Stock · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "summary",
          "overview",
          "how is back in stock doing",
          "dashboard stats",
          "recovered revenue",
          "notifications sent"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/reports/wait_duration": {
      "get": {
        "operationId": "get_back_in_stock_reports_wait_duration",
        "summary": "Wait Duration",
        "description": "How long back-in-stock shoppers have been waiting: median wait days, the longest wait, and a binned wait-time histogram (paid plans only).\n\n**Note:** shopify_market_ids is a comma-separated list, as the waitlist page's Markets filter.",
        "tags": [
          "Back In Stock · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "wait duration",
          "wait time",
          "how long are people waiting",
          "wait time histogram",
          "how long have customers waited"
        ],
        "parameters": [
          {
            "name": "shopify_variant_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "45000000001"
          },
          {
            "name": "shopify_product_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "78000000001"
          },
          {
            "name": "shopify_market_ids",
            "in": "query",
            "required": false,
            "schema": {},
            "example": [
              "gid://shopify/Market/12345"
            ]
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/sending_history": {
      "get": {
        "operationId": "get_back_in_stock_sending_history",
        "summary": "List",
        "description": "List back-in-stock sends, newest first: each restock or manual send working through a variant's waitlist, with its progress (the dashboard's Bulk requests page).\n\n**Note:** source is webhook (automatic restock alert), bulk_send (sent from the dashboard or API), bulk_resend, flow_action, events_inventory, events_products or reconciliation. status is active, waiting (between batches) or completed. sent_count of signups_count is the progress. source narrows to sends whose source contains it, as the page's source search. shopify_variant_id / shopify_product_id (gids) narrow to that variant's or product's sends; status=incomplete (active or waiting) with one of them answers whether a send is still running, as the waitlist page's banner shows.",
        "tags": [
          "Back In Stock · Sending History"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "sending history",
          "bulk requests",
          "bulk sends",
          "send jobs",
          "restock sends",
          "is the send finished",
          "notification send progress"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "incomplete",
                "active",
                "waiting",
                "completed"
              ]
            },
            "example": "incomplete"
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "shopify_variant_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "45000000001"
          },
          {
            "name": "shopify_product_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "78000000001"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/sending_history/{id}": {
      "get": {
        "operationId": "get_back_in_stock_sending_history_id",
        "summary": "Read",
        "description": "Read one back-in-stock send's progress by the id a notify endpoint returned.\n\n**Note:** 404 once a completed send that reached no signups has been cleaned up.",
        "tags": [
          "Back In Stock · Sending History"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "send status",
          "send progress",
          "check send job",
          "is the bulk send done"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/back_in_stock/settings": {
      "get": {
        "operationId": "get_back_in_stock_settings",
        "summary": "Read",
        "description": "Read all back-in-stock settings for the shop. ?locale= picks the language of the widget copy (omit it for the shop default).",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get settings",
          "show settings",
          "view settings",
          "back in stock settings",
          "notification settings",
          "settings"
        ],
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_back_in_stock_settings",
        "summary": "Update",
        "description": "Update back-in-stock settings for the shop: channels, delivery, compliance, tagging, merchant alerts and the signup widget, in one request.\n\n**Note:** Accepts any combination of section blobs: channels, delivery, compliance, tagging, alerts, widget — deep partial. Every section is validated first; any error rejects the whole request (422, keyed \"section.path\") and nothing is saved. Unknown keys are rejected. widget takes the PATCH /back_in_stock/settings/widget body, with widget.locale for its text. Turning each notification on or off is PATCH /back_in_stock/notification_settings/:key; the email sender and SMS number are PATCH /account/sending; market setup is PATCH /account/markets.",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit settings",
          "change settings",
          "modify settings",
          "update back in stock settings",
          "configure notifications"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channels": {},
                  "delivery": {},
                  "compliance": {},
                  "tagging": {},
                  "alerts": {},
                  "widget": {}
                }
              },
              "example": {
                "channels": "string",
                "delivery": "string",
                "compliance": "string",
                "tagging": "string",
                "alerts": "string",
                "widget": "string"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/settings/alerts": {
      "get": {
        "operationId": "get_back_in_stock_settings_alerts",
        "summary": "Alerts",
        "description": "Read back-in-stock merchant alert and scheduled report settings.",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get alert settings",
          "show alerts",
          "view signup threshold",
          "view scheduled reports",
          "alerts"
        ]
      },
      "patch": {
        "operationId": "patch_back_in_stock_settings_alerts",
        "summary": "Alerts",
        "description": "Update back-in-stock merchant alert and scheduled report settings.\n\n**Note:** Toggles set via this PATCH: signups_threshold.notify, signup_alerts.enabled, scheduled_reports.daily, scheduled_reports.weekly, scheduled_reports.monthly, notify_on_alert_sent — e.g. { scheduled_reports: { weekly: true } }. signups_threshold.count is the per-variant signup count that triggers the high-demand merchant alert email. signup_alerts.enabled turns on an immediate email to the merchant for every individual signup, sent to signup_alerts.email. scheduled_reports.email is the address that receives the daily/weekly/monthly summary reports. notify_on_alert_sent emails the merchant whenever back-in-stock alerts are sent to customers. merchant_emails.product_updates and merchant_emails.theme_published turn STOQ's own emails to the merchant on or off.",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit alert settings",
          "change alert settings",
          "set signup threshold",
          "notify me on high demand",
          "enable signup threshold alerts",
          "disable signup threshold alerts",
          "alert me when a product gets lots of signups",
          "enable daily report",
          "enable weekly report",
          "enable monthly report",
          "disable daily report",
          "disable weekly report",
          "disable monthly report",
          "schedule reports",
          "turn off report emails",
          "stop feature update emails",
          "notify me when a theme is published"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "signups_threshold": {},
                  "signup_alerts": {},
                  "scheduled_reports": {},
                  "notify_on_alert_sent": {},
                  "merchant_emails": {}
                }
              },
              "example": {
                "signups_threshold": "string",
                "signup_alerts": "string",
                "scheduled_reports": "string",
                "notify_on_alert_sent": "string",
                "merchant_emails": "string"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/settings/channels": {
      "get": {
        "operationId": "get_back_in_stock_settings_channels",
        "summary": "Channels",
        "description": "Read back-in-stock notification channel settings.",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get channels",
          "show channels",
          "view notification channels",
          "which channels are enabled",
          "channels"
        ]
      },
      "patch": {
        "operationId": "patch_back_in_stock_settings_channels",
        "summary": "Channels",
        "description": "Update the back-in-stock email and SMS channel switches. Turning automatic alerts on or off is PATCH /back_in_stock/notification_settings/restock_alert; the email sender and SMS number are PATCH /account/sending.\n\n**Note:** Channel toggles are set via this PATCH: email.enabled, sms.enabled — e.g. { sms: { enabled: true } }. Enabling SMS for the first time triggers a restricted-content verification check; sends may be held until the shop is verified.",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "alerts_enabled": true,
                  "email": {
                    "enabled": true
                  },
                  "sms": {
                    "enabled": true
                  }
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit channels",
          "change channels",
          "modify channels",
          "enable email notifications",
          "turn on email alerts",
          "disable email notifications",
          "turn off email alerts",
          "enable sms",
          "turn on SMS alerts",
          "enable text notifications",
          "disable sms",
          "turn off SMS alerts",
          "stop text notifications"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {},
                  "sms": {}
                }
              },
              "example": {
                "email": {
                  "enabled": true
                },
                "sms": {
                  "enabled": true
                }
              }
            }
          }
        }
      }
    },
    "/back_in_stock/settings/compliance": {
      "get": {
        "operationId": "get_back_in_stock_settings_compliance",
        "summary": "Compliance",
        "description": "Read back-in-stock compliance settings (double opt-in).",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get compliance settings",
          "show compliance",
          "view opt-in settings",
          "is double opt-in enabled",
          "compliance"
        ]
      },
      "patch": {
        "operationId": "patch_back_in_stock_settings_compliance",
        "summary": "Compliance",
        "description": "Update back-in-stock compliance settings (double opt-in).\n\n**Note:** The double-opt-in toggle is set via this PATCH: optin_required — e.g. { optin_required: true }. When enabled, signups must confirm via email before they are eligible for notifications (GDPR double opt-in).",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit compliance settings",
          "change compliance settings",
          "require double opt-in",
          "enable double opt-in",
          "turn on double opt-in",
          "require opt-in confirmation",
          "gdpr opt-in",
          "disable double opt-in",
          "turn off double opt-in",
          "remove opt-in confirmation"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "optin_required": {}
                }
              },
              "example": {
                "optin_required": "string"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/settings/delivery": {
      "get": {
        "operationId": "get_back_in_stock_settings_delivery",
        "summary": "Delivery",
        "description": "Read back-in-stock delivery settings (batching, stock threshold, locations, any-variant, password-protected sending, alerts on publish). any_variant.products names each of any_variant.shopify_product_ids by its Shopify title (products Shopify no longer has are left out). any_variant only decides which restocks alert a signup (any variant of those products, not just the one signed up for); it never limits where the Notify me button shows, and does nothing while any_variant.enabled is false.",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get delivery settings",
          "show delivery settings",
          "view batching",
          "view stock threshold",
          "view location filter",
          "delivery"
        ]
      },
      "patch": {
        "operationId": "patch_back_in_stock_settings_delivery",
        "summary": "Delivery",
        "description": "Update back-in-stock delivery settings (batching, stock threshold, locations, any-variant, password-protected sending, alerts on publish). Market setup and market-based alerts are PATCH /account/markets.\n\n**Note:** Deep partial. Toggles set via this PATCH: batching.enabled, locations.filter_enabled, any_variant.enabled — e.g. { batching: { enabled: true } }. batching.mode is an enum: 'multiplier' (batch size = restocked quantity x batching.multiplier) or 'fixed' (batch size = batching.batch_size); batching.wait_hours is the wait between batches. stock_threshold is the minimum restocked quantity before notifications send (>= 1). any_variant.all_products is a boolean: when true, any-variant alerts apply to every product and any_variant.product_ids is ignored; when false, only the listed products qualify. locations.shopify_location_ids and any_variant.shopify_product_ids are arrays of Shopify gids and are replaced wholesale when present. send_while_password_protected is a boolean: false (default) holds back-in-stock alerts while the storefront password is on (signups stay pending for the next restock); true sends anyway. alert_on_publish also alerts when a product is published.",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit delivery settings",
          "change delivery settings",
          "batch notifications",
          "enable batching",
          "turn on batching",
          "disable batching",
          "turn off batching",
          "send all at once",
          "set batch size",
          "set batching multiplier",
          "set batching mode",
          "set wait between batches",
          "set stock threshold",
          "set minimum stock to notify",
          "only notify when 5 in stock",
          "require minimum quantity before notifying",
          "filter by location",
          "enable location filter",
          "disable location filter",
          "set notification locations",
          "only count inventory at locations",
          "notify for any variant",
          "enable any variant notifications",
          "disable any variant notifications",
          "notify when any variant restocks",
          "send alerts while store is password protected",
          "hold alerts while store is password protected",
          "alert when a product is published",
          "notify customers when a product is published"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "batching": {},
                  "stock_threshold": {},
                  "locations": {},
                  "any_variant": {},
                  "send_while_password_protected": {},
                  "alert_on_publish": {}
                }
              },
              "example": {
                "batching": "string",
                "stock_threshold": "string",
                "locations": "string",
                "any_variant": "string",
                "send_while_password_protected": "string",
                "alert_on_publish": "string"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/settings/tagging": {
      "get": {
        "operationId": "get_back_in_stock_settings_tagging",
        "summary": "Tagging",
        "description": "Read back-in-stock order tagging settings.",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get tagging settings",
          "show order tagging",
          "view order tag",
          "what tag is applied to recovered orders",
          "tagging"
        ]
      },
      "patch": {
        "operationId": "patch_back_in_stock_settings_tagging",
        "summary": "Tagging",
        "description": "Update back-in-stock order tagging settings.\n\n**Note:** The toggle is set via this PATCH: order_tags.enabled — e.g. { order_tags: { enabled: true } }. order_tags.tag is the single tag applied to Shopify orders attributed to a back-in-stock notification (default 'STOQ-back-in-stock').",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit tagging settings",
          "change tagging settings",
          "tag recovered orders",
          "enable order tagging",
          "turn on order tagging",
          "disable order tagging",
          "turn off order tagging",
          "set back in stock order tag",
          "change order tag",
          "rename order tag"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "order_tags": {}
                }
              },
              "example": {
                "order_tags": "string"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/settings/widget": {
      "get": {
        "operationId": "get_back_in_stock_settings_widget",
        "summary": "Widget",
        "description": "Read the storefront back-in-stock signup widget configuration: the notify-me button, where it appears, and the signup form's copy, styling and inputs. ?locale= picks the language of the copy (omit it for the shop default).",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get widget",
          "show signup widget",
          "view notify me button",
          "notify me button settings",
          "signup form settings",
          "widget"
        ],
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_back_in_stock_settings_widget",
        "summary": "Widget",
        "description": "Update the storefront back-in-stock signup widget: the notify-me button (text, colors, corner radius, font, position), where the button appears (product, collection, home, search, preorder pages, and whether the whole widget is enabled), and the signup form's copy, success/error messages, colors, which inputs are collected and the double opt-in email text. button.position is \"auto\" (in-flow, directly below the sold-out add-to-cart button), \"float-right\" or \"float-left\" (a floating tab pinned to that edge of the page) or \"specific\" (after the element placement.selectors.product finds). placement.selectors holds the CSS selectors that place the button on product, collection, home and search pages; placement.hide_by_tag limits the widget by product tag; form.inline shows the form on the page instead of a popup; custom.css runs on every storefront page. form.fields.sms_first is a boolean: true shows the SMS field before email. form.fields.sms_default_country is a lowercase ISO 3166-1 alpha-2 code (e.g. \"us\", \"gb\", \"ca\", \"au\"). form.fields.sms_allowed_countries takes { add: [...], remove: [...] } of those same codes and edits the stored list in place — it never replaces it, so one country can be added or dropped without resending the rest; an empty allowed list means every country is allowed. Colors must be hex (#RRGGBB); radii are integers in pixels. Pass an optional top-level `locale` (e.g. \"fr\") to write the text fields for that language only.\n\n**Note:** Deep partial. Groups: button, placement (with selectors and hide_by_tag), form.copy, form.messages, form.style, form.fields, form.inline, optin, branding, custom. Selectors, the on-page form, custom CSS and the app proxy path change what every shopper sees; a wrong value can hide the widget. Channel enables (email/sms), optin_required and the merchant signup alert live on the other settings sections. custom.javascript is read-only: STOQ support sets it.",
        "tags": [
          "Back In Stock · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit signup widget",
          "change notify me button",
          "move the notify me button",
          "put the notify me button below the sold out button",
          "change button text",
          "rename the notify me button",
          "change button color",
          "change button colour",
          "round the button corners",
          "change the widget font",
          "show the notify me button on collection pages",
          "show button on search results",
          "hide the notify me button",
          "turn off the signup widget",
          "turn on the signup widget",
          "change the signup form heading",
          "change the signup form wording",
          "change the signup success message",
          "change the signup error message",
          "change form colors",
          "collect customer name",
          "ask for quantity",
          "ask for marketing consent",
          "show the channel selector",
          "restrict sms signups to certain countries",
          "allow sms from another country",
          "set the default phone country",
          "change double opt in email",
          "hide powered by",
          "translate the signup form"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "locale": {},
                  "button": {},
                  "placement": {},
                  "form": {},
                  "optin": {},
                  "branding": {},
                  "custom": {}
                }
              },
              "example": {
                "locale": "fr",
                "button": "string",
                "placement": "string",
                "form": "string",
                "optin": "string",
                "branding": "string",
                "custom": "string"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/signups": {
      "post": {
        "operationId": "post_back_in_stock_signups",
        "summary": "Create",
        "description": "Add a customer to a variant's back-in-stock waitlist, as the dashboard's Add signup page does.\n\n**Note:** Give email, phone or both: each one becomes its own signup (email channel, sms channel), and a channel that is turned off is skipped with a message in errors. shopify_product_id is read from the variant when omitted. 409 when a pending signup already exists for that contact and variant.",
        "tags": [
          "Back In Stock · Signups"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "signups": [
                    {
                      "id": "5f0c2a9e-3b1d-4c8e-9a51-2d7e6b1f0a42",
                      "channel": "email",
                      "contact": "john@example.com",
                      "quantity": 2,
                      "shopify_product_id": "gid://shopify/Product/8784906035384",
                      "shopify_variant_id": "gid://shopify/ProductVariant/47284734423096",
                      "product_title": "Trail Shoe",
                      "variant_title": "Blue / Medium",
                      "sku": "TS-BLU-M",
                      "shopify_market_id": null,
                      "customer_id": "8b6f1e2a-0c4d-4f7a-b1e3-9d2c5a7f6e10",
                      "customer_name": "John Doe",
                      "accepts_marketing": false,
                      "customer_unsubscribed_at": null,
                      "customer_bounce_count": 0,
                      "optin_confirmed": null,
                      "unsubscribed_at": null,
                      "notifications_count": 0,
                      "notified_at": null,
                      "created_at": "2026-06-25T13:45:30Z"
                    }
                  ],
                  "errors": {}
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "create signup",
          "add to waitlist",
          "add customer to the notify me list",
          "register a restock alert",
          "sign someone up for back in stock",
          "add signup"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopify_variant_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "accepts_marketing": {
                    "type": "boolean"
                  },
                  "shopify_product_id": {},
                  "email": {},
                  "phone": {},
                  "name": {},
                  "shopify_market_id": {}
                },
                "required": [
                  "shopify_variant_id"
                ]
              },
              "example": {
                "shopify_variant_id": "gid://shopify/ProductVariant/47284734423096",
                "email": "john@example.com",
                "quantity": 2,
                "name": "John Doe"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "get_back_in_stock_signups",
        "summary": "List",
        "description": "List back-in-stock signups (the waitlist), newest first, with the dashboard's waitlist filters.\n\n**Note:** status is pending (not notified yet) or notified; from/to are shop-local days matched against the signup date for pending and the notified date for notified. title and sku match the product title or SKU. without_orders keeps notified signups that led to no order. query matches part of the signup's or customer's email or phone, or the customer's name. Notified signups are ordered by notified date. source is where the signup came from (restock-rocket-extension is the storefront form; restock-rocket-extension-resubscribe is Quick Resubscribe). product_deleted and variant_deleted mark rows whose product or variant was deleted on Shopify.",
        "tags": [
          "Back In Stock · Signups"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "signups": [
                    {
                      "id": "5f0c2a9e-3b1d-4c8e-9a51-2d7e6b1f0a42",
                      "channel": "email",
                      "contact": "john@example.com",
                      "quantity": 2,
                      "shopify_product_id": "gid://shopify/Product/8784906035384",
                      "shopify_variant_id": "gid://shopify/ProductVariant/47284734423096",
                      "product_title": "Trail Shoe",
                      "variant_title": "Blue / Medium",
                      "sku": "TS-BLU-M",
                      "shopify_market_id": null,
                      "customer_id": "8b6f1e2a-0c4d-4f7a-b1e3-9d2c5a7f6e10",
                      "customer_name": "John Doe",
                      "accepts_marketing": false,
                      "customer_unsubscribed_at": null,
                      "customer_bounce_count": 0,
                      "optin_confirmed": null,
                      "unsubscribed_at": null,
                      "notifications_count": 0,
                      "notified_at": null,
                      "created_at": "2026-06-25T13:45:30Z"
                    }
                  ],
                  "meta": {
                    "total_count": 147,
                    "page": 1,
                    "per_page": 50,
                    "total_pages": 3
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "list signups",
          "waitlist",
          "show the waitlist",
          "notify me list",
          "who's waiting",
          "back in stock signups",
          "list waitlist entries",
          "restock signups",
          "customers waiting for restock"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "pending",
                "notified"
              ]
            },
            "example": "pending"
          },
          {
            "name": "shopify_market_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "example": [
              "gid://shopify/Market/12345"
            ]
          },
          {
            "name": "shopify_product_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "78000000001"
          },
          {
            "name": "shopify_variant_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "45000000001"
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "title",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "sku",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "without_orders",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/back_in_stock/signups/{id}": {
      "delete": {
        "operationId": "delete_back_in_stock_signups_id",
        "summary": "Delete",
        "description": "Delete a back-in-stock signup (remove the customer from the waitlist), as the Delete on a dashboard signup row does.\n\n**Note:** The customer will no longer be notified for this product. Works on pending and notified signups; it cannot be undone.",
        "tags": [
          "Back In Stock · Signups"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "delete signup",
          "remove from waitlist",
          "remove waitlist entry",
          "cancel restock alert",
          "take customer off the notify me list",
          "unsubscribe customer from one product"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "get": {
        "operationId": "get_back_in_stock_signups_id",
        "summary": "Read",
        "description": "Read one back-in-stock signup's full representation.",
        "tags": [
          "Back In Stock · Signups"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "show signup",
          "get signup",
          "look up waitlist entry",
          "view restock signup",
          "signup details"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/back_in_stock/signups/{id}/history": {
      "get": {
        "operationId": "get_back_in_stock_signups_id_history",
        "summary": "History",
        "description": "List every notification sent for one back-in-stock signup, oldest first, with each channel's delivery events (sent, delivered, opened, clicked, bounced).",
        "tags": [
          "Back In Stock · Signups"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "signup history",
          "notification history",
          "what was sent to this customer",
          "did this customer get the restock email"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/back_in_stock/signups/{id}/notify": {
      "post": {
        "operationId": "post_back_in_stock_signups_id_notify",
        "summary": "Notify",
        "description": "Send the back-in-stock notification for one signup now, regardless of stock state, and report what happened.\n\n**Note:** The dashboard's Send / Re-send on one signup row. 202 with outcome.status \"sent\" or \"queued\" when a message went to the provider; outcome.provider names who delivers it (stoq is STOQ's own sender). 422 with the outcome when nothing was sent: status \"skipped\" (channel off, first alert off, no contact, channel cannot send), \"blocked\" (plan limit, or a provider that cannot deliver), \"failed\" (provider rejected) or \"not_sent\". 409 when the signup was already notified and allow_resend is not set.",
        "tags": [
          "Back In Stock · Signups"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "signup_id": "5f0c2a9e-3b1d-4c8e-9a51-2d7e6b1f0a42",
                  "outcome": {
                    "signup_id": "5f0c2a9e-3b1d-4c8e-9a51-2d7e6b1f0a42",
                    "channel": "email",
                    "notification_id": "0e9b7c2d-4a1f-4b8e-a6d3-5c2f1e8b9a70",
                    "status": "queued",
                    "provider": "stoq"
                  }
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "notify signup",
          "send the restock email",
          "notify this customer",
          "send back in stock notification",
          "resend restock notification"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "allow_resend": {}
                }
              },
              "example": {
                "allow_resend": false
              }
            }
          }
        }
      }
    },
    "/back_in_stock/signups/bulk_delete": {
      "post": {
        "operationId": "post_back_in_stock_signups_bulk_delete",
        "summary": "Bulk Delete",
        "description": "Delete up to 100 back-in-stock signups in one request, as the waitlist table's bulk Delete does.\n\n**Note:** All or nothing: when any id is unknown, nothing is deleted and the 422 lists each one under failed[]. Cannot be undone.",
        "tags": [
          "Back In Stock · Signups"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk delete signups",
          "clear the waitlist",
          "delete waitlist entries",
          "remove signups in bulk",
          "purge pending restock signups"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "signup_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "signup_ids"
                ]
              },
              "example": {
                "signup_ids": [
                  "sgn_a1b2c3"
                ]
              }
            }
          }
        }
      }
    },
    "/back_in_stock/signups/notification_status": {
      "get": {
        "operationId": "get_back_in_stock_signups_notification_status",
        "summary": "Notification Status",
        "description": "Notification/waitlist status for one product variant: pending signups (count_by as on the dashboard), total alerts sent, the 5 most recent send batches (each with what triggered it), and the shop's delivery settings -- the usual reason a restock produced no send yet.",
        "tags": [
          "Back In Stock · Signups"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "notification status",
          "restock alert status",
          "has this been notified",
          "waitlist status for a variant"
        ],
        "parameters": [
          {
            "name": "shopify_variant_id",
            "in": "query",
            "required": true,
            "schema": {},
            "example": "45000000001"
          },
          {
            "name": "count_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "customers",
                "signups"
              ]
            },
            "example": "customers"
          }
        ]
      }
    },
    "/back_in_stock/signups/notify": {
      "post": {
        "operationId": "post_back_in_stock_signups_notify",
        "summary": "Notify",
        "description": "Send back-in-stock notifications to every signup matching the waitlist filters, or only the first N, as the dashboard's Send notifications and Re-send all buttons do.\n\n**Note:** status is pending (not notified yet) or notified; from/to are shop-local days matched against the signup date for pending and the notified date for notified. title and sku match the product title or SKU. without_orders keeps notified signups that led to no order. status pending sends to signups not notified yet; status notified re-sends to signups already notified, oldest notification first when limit is set. channel sends only email or only sms. Sends regardless of stock. 202 with one send per variant: its id is the job id for GET /back_in_stock/sending_history/:id. providers names who delivers each channel (stoq is STOQ's own sender). 422 when no signup matches, or a channel cannot send (plan limit, channel off, awaiting review, or a provider that cannot deliver), and nothing is queued.",
        "tags": [
          "Back In Stock · Signups"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "sends": [
                    {
                      "id": "c3e8a1f4-7b2d-4e9a-8c51-0f6d2b9e7a13",
                      "shopify_product_id": "gid://shopify/Product/8784906035384",
                      "shopify_variant_id": "gid://shopify/ProductVariant/47284734423096",
                      "product_title": "Trail Shoe",
                      "variant_title": "Blue / Medium",
                      "shopify_location_id": null,
                      "source": "bulk_send",
                      "channel": "email",
                      "status": "pending",
                      "limit": 42,
                      "signups_count": 42,
                      "sent_count": 0,
                      "created_at": "2026-06-25T14:02:11Z"
                    }
                  ],
                  "providers": {
                    "email": "stoq"
                  }
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "notify the waitlist",
          "notify everyone waiting",
          "send notifications",
          "bulk send",
          "send restock emails to the whole waitlist",
          "resend to everyone notified",
          "send to the waitlist"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "enum": [
                      "pending",
                      "notified"
                    ]
                  },
                  "shopify_market_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "channel": {
                    "enum": [
                      "email",
                      "sms"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "shopify_product_id": {},
                  "shopify_variant_id": {},
                  "customer_id": {},
                  "title": {},
                  "sku": {},
                  "without_orders": {},
                  "from": {},
                  "to": {}
                }
              },
              "example": {
                "shopify_variant_id": "gid://shopify/ProductVariant/47284734423096",
                "channel": "email"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/signups/notify_variants": {
      "post": {
        "operationId": "post_back_in_stock_signups_notify_variants",
        "summary": "Notify Variants",
        "description": "Send back-in-stock notifications to everyone waiting on up to 10 variants, as the products table's Send notifications bulk action does.\n\n**Note:** Sends to pending signups only, on every channel, regardless of stock. A variant whose channel cannot send (plan limit, channel off, awaiting review, or a provider that cannot deliver) is skipped and its reason listed in errors; the others still send. 202 with one send per variant queued (its id is the job id for GET /back_in_stock/sending_history/:id) and providers per channel. 422 when nothing was queued.",
        "tags": [
          "Back In Stock · Signups"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "notify these variants",
          "send notifications for these variants",
          "bulk send for variants",
          "notify waitlists for several products",
          "send restock alerts for selected variants"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopify_variant_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "shopify_variant_ids"
                ]
              },
              "example": {
                "shopify_variant_ids": [
                  "45000000001"
                ]
              }
            }
          }
        }
      }
    },
    "/back_in_stock/signups/resend_optin": {
      "post": {
        "operationId": "post_back_in_stock_signups_resend_optin",
        "summary": "Resend Optin",
        "description": "Re-send the double opt-in (GDPR consent) confirmation email to every unconfirmed signup waiting on a variant or product, as the dashboard's Re-send confirmation does. It cannot target one customer or signup: never offer a resend to a single contact.\n\n**Note:** Give shopify_variant_id or shopify_product_id. 202 with signups_count, how many unconfirmed pending signups were queued; each email goes to the signup's customer email address. 422 when double opt-in is turned off.",
        "tags": [
          "Back In Stock · Signups"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "resend confirmation",
          "resend opt-in email",
          "resend gdpr consent email",
          "remind customers to confirm their signup",
          "resend double opt-in"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopify_variant_id": {},
                  "shopify_product_id": {}
                }
              },
              "example": {
                "shopify_variant_id": "45000000001",
                "shopify_product_id": "78000000001"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/signups/transfer": {
      "post": {
        "operationId": "post_back_in_stock_signups_transfer",
        "summary": "Transfer",
        "description": "Move a variant's or a product's current waitlist (pending signups) to another variant, as the dashboard's Transfer signups does.\n\n**Note:** Give from_shopify_variant_id to move one variant's waitlist, or only from_shopify_product_id to move every variant of a product. Notified signups stay. A signup that would duplicate one already waiting on the target variant is dropped. 422 when the target is not a variant of this store. to_shopify_product_id is read from the target variant when omitted. Moves of more than 500 signups run in the background: background is true and count is the number queued to move.",
        "tags": [
          "Back In Stock · Signups"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "count": 42,
                  "background": false
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "transfer signups",
          "move the waitlist",
          "move signups to another variant",
          "merge waitlists",
          "shift restock signups to a new variant",
          "move requests"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to_shopify_variant_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "from_shopify_variant_id": {},
                  "from_shopify_product_id": {},
                  "to_shopify_product_id": {}
                },
                "required": [
                  "to_shopify_variant_id"
                ]
              },
              "example": {
                "from_shopify_variant_id": "gid://shopify/ProductVariant/47284734423096",
                "to_shopify_variant_id": "gid://shopify/ProductVariant/47284734455864"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/templates": {
      "get": {
        "operationId": "get_back_in_stock_templates",
        "summary": "List",
        "description": "List every back-in-stock notification's email and SMS copy, in send order: signup_thank_you, restock_alert, reminder. ?locale= picks the language (omit it for the shop default).\n\n**Note:** A notification the shop has no template for is left out. Each entry is the GET /back_in_stock/templates/:key body.",
        "tags": [
          "Back In Stock · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "list back in stock templates",
          "show all restock emails",
          "back in stock notification copy"
        ],
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      }
    },
    "/back_in_stock/templates/{key}": {
      "get": {
        "operationId": "get_back_in_stock_templates_key",
        "summary": "Read",
        "description": "Read one back-in-stock notification's email and SMS copy. key is \"signup_thank_you\" (sent right after a customer signs up), \"restock_alert\" (sent when the product restocks) or \"reminder\" (the follow-up). ?locale= picks the language of the copy (omit it for the shop default); the response names it in `locale`. Whether it sends, and when, is GET /back_in_stock/notification_settings.",
        "tags": [
          "Back In Stock · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get back in stock template",
          "show restock email",
          "back in stock email copy",
          "restock reminder template",
          "localized back in stock template",
          "signup thank you email",
          "thank you for signing up template"
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_back_in_stock_templates_key",
        "summary": "Update",
        "description": "Update one back-in-stock notification's email and SMS copy. key is \"signup_thank_you\", \"restock_alert\" or \"reminder\". The body is the GET shape: email{subject, preheader, heading, body, footer, button{...}, colors{...}, radius, css, html{enabled, template}, reviews{...}, social{...}, unsubscribe_text, klaviyo_flow_name} and sms{body, link_destination, klaviyo_flow_name}. An optional body `locale` (\"fr\", \"pt-BR\") writes the copy in that language only; omit it for the shop default. Colours, switches and other untranslated fields ignore it. Turning a notification on or off, and its timing, is PATCH /back_in_stock/notification_settings/:key.\n\n**Note:** Deep partial: absent fields are unchanged; unknown or read-only keys are rejected (signup_thank_you has no email.button.destination or sms.link_destination). Errors are 422 keyed \"template.<path>\"; nothing is saved when any field fails. Rejects HTML except in email.html.template and email.css, and runs Template validations and callbacks. Colours, corner radii and the Judge.me reviews block are shared by the restock alert and the reminder; social links, the icon colour and email.unsubscribe_text by every template of the shop.",
        "tags": [
          "Back In Stock · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit back in stock template",
          "change restock email",
          "change restock sms",
          "update back in stock reminder copy",
          "localize back in stock template",
          "add social links to email",
          "social media icons in restock email",
          "edit thank you for signing up email",
          "disable custom html template",
          "use standard email template",
          "turn off html email template"
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "email": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "subject": {
                        "type": "string",
                        "description": "Subject of the email. Takes the editor variables, e.g. {{product.title_incl_variant}} or {{shop.name}} (get_bis_template lists them all); a bare {{product}} is not a variable."
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Pre-header -- the preview line after the subject in the inbox. Takes the editor variables, e.g. {{product.title_incl_variant}} or {{shop.name}} (get_bis_template lists them all); a bare {{product}} is not a variable."
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading at the top of the email body. Takes the editor variables, e.g. {{product.title_incl_variant}} or {{shop.name}} (get_bis_template lists them all); a bare {{product}} is not a variable."
                      },
                      "body": {
                        "type": "string",
                        "description": "Description -- the main body copy of the email. Takes the editor variables, e.g. {{product.title_incl_variant}} or {{shop.name}} (get_bis_template lists them all); a bare {{product}} is not a variable."
                      },
                      "footer": {
                        "type": "string",
                        "description": "Footer line at the bottom of the email."
                      },
                      "button": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "text": {
                            "type": "string",
                            "description": "Button text on the email."
                          },
                          "destination": {
                            "type": "string",
                            "description": "\"Take customer to\": where the email button lands, the checkout or the product page. Not on signup_thank_you.",
                            "enum": [
                              "checkout",
                              "product"
                            ]
                          },
                          "background_color": {
                            "type": "string",
                            "pattern": "^#([0-9a-fA-F]{3,8})$",
                            "description": "Button -- Background colour of the email button. Hex."
                          },
                          "text_color": {
                            "type": "string",
                            "pattern": "^#([0-9a-fA-F]{3,8})$",
                            "description": "Button -- Text colour of the email button. Hex."
                          },
                          "radius": {
                            "type": "integer",
                            "description": "Corner radius of the email button, in pixels. Saving it sets it on the restock alert and the reminder alike.",
                            "minimum": 0
                          }
                        }
                      },
                      "colors": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "background": {
                            "type": "string",
                            "pattern": "^#([0-9a-fA-F]{3,8})$",
                            "description": "Colors -- Background of the email. Hex, e.g. \"#FFFFFF\"."
                          },
                          "section": {
                            "type": "string",
                            "pattern": "^#([0-9a-fA-F]{3,8})$",
                            "description": "Colors -- Background of the content section of the email. Hex. Saving it sets it on the restock alert and the reminder alike."
                          },
                          "text": {
                            "type": "string",
                            "pattern": "^#([0-9a-fA-F]{3,8})$",
                            "description": "Colors -- Text colour of the email. Hex."
                          }
                        }
                      },
                      "radius": {
                        "type": "integer",
                        "description": "Corner radius of the content section, in pixels. Saving it sets it on the restock alert and the reminder alike.",
                        "minimum": 0
                      },
                      "css": {
                        "type": "string",
                        "description": "Custom CSS added to the email. Applies to the standard email design. An empty string removes it."
                      },
                      "html": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "enabled": {
                            "type": "boolean",
                            "description": "The \"Use HTML template\" switch: true sends email.html.template, false the standard STOQ email."
                          },
                          "template": {
                            "type": "string",
                            "description": "The custom HTML email (Custom HTML tab). Sent instead of the standard email while email.html.enabled is true. Takes the same {{ }} variables as the editor. Paid plans only."
                          }
                        }
                      },
                      "reviews": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "enabled": {
                            "type": "boolean",
                            "description": "Show product reviews: adds the product's Judge.me star rating and top reviews to the email. Paid plans only; shows only while Judge.me is connected (Settings > Integrations). Saving it sets it on the restock alert and the reminder alike."
                          },
                          "count": {
                            "type": "integer",
                            "description": "Number of reviews to show in the Judge.me reviews block, 1 to 3. Saving it sets it on the restock alert and the reminder alike.",
                            "minimum": 1,
                            "maximum": 3
                          },
                          "min_rating": {
                            "type": "integer",
                            "description": "Only show reviews rated at least this many stars: 5, 4 or 3. Saving it sets it on the restock alert and the reminder alike.",
                            "enum": [
                              5,
                              4,
                              3
                            ]
                          },
                          "title": {
                            "type": "string",
                            "description": "Section title of the Judge.me reviews block, e.g. \"What customers are saying\". Saving it sets it on the restock alert and the reminder alike."
                          }
                        }
                      },
                      "social": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "facebook": {
                            "type": "string",
                            "description": "Facebook profile URL, without the https:// prefix. Shows as an icon in the email. Saving it sets it on every notification template of the shop."
                          },
                          "instagram": {
                            "type": "string",
                            "description": "Instagram profile URL, without the https:// prefix. Saving it sets it on every notification template of the shop."
                          },
                          "pinterest": {
                            "type": "string",
                            "description": "Pinterest profile URL, without the https:// prefix. Saving it sets it on every notification template of the shop."
                          },
                          "twitter": {
                            "type": "string",
                            "description": "X (Twitter) profile URL, without the https:// prefix. Saving it sets it on every notification template of the shop."
                          },
                          "tiktok": {
                            "type": "string",
                            "description": "TikTok profile URL, without the https:// prefix. Saving it sets it on every notification template of the shop."
                          },
                          "whatsapp": {
                            "type": "string",
                            "description": "WhatsApp link, without the https:// prefix. Saving it sets it on every notification template of the shop."
                          },
                          "youtube": {
                            "type": "string",
                            "description": "YouTube channel URL, without the https:// prefix. Saving it sets it on every notification template of the shop."
                          },
                          "icon_color": {
                            "type": "string",
                            "enum": [
                              "#FFFFFF",
                              "#000000"
                            ],
                            "description": "Icon Color of the social icons: white (#FFFFFF) or black (#000000). Saving it sets it on every notification template of the shop."
                          }
                        }
                      },
                      "unsubscribe_text": {
                        "type": "string",
                        "description": "Text of the unsubscribe link at the bottom of the email. Saving it sets it on every notification template of the shop."
                      },
                      "klaviyo_flow_name": {
                        "type": "string",
                        "description": "Flow name to trigger in Klaviyo instead of sending the email here. Only used while the email platform is Klaviyo."
                      }
                    }
                  },
                  "sms": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "body": {
                        "type": "string",
                        "description": "SMS Body -- the text message sent instead of the email. Takes the editor variables, e.g. {{product.title_incl_variant}} or {{shop.name}} (get_bis_template lists them all); a bare {{product}} is not a variable."
                      },
                      "link_destination": {
                        "type": "string",
                        "enum": [
                          "checkout",
                          "product"
                        ],
                        "description": "\"Link takes customer to\": where the SMS link lands, the checkout or the product page. Not on signup_thank_you."
                      },
                      "klaviyo_flow_name": {
                        "type": "string",
                        "description": "Flow name to trigger in Klaviyo instead of sending the SMS here. Only used while the SMS platform is Klaviyo."
                      }
                    }
                  },
                  "locale": {
                    "type": "string",
                    "description": "Language the translated fields are written in, such as 'fr' or 'pt-BR'. Omitted: the shop's default language. Untranslated fields ignore it."
                  }
                }
              },
              "example": {
                "email": {
                  "subject": "string",
                  "preheader": "string",
                  "heading": "string",
                  "body": "string",
                  "footer": "string",
                  "button": {
                    "text": "Preorder now",
                    "destination": "checkout",
                    "background_color": "#1A1A1A",
                    "text_color": "#1A1A1A",
                    "radius": 0
                  },
                  "colors": {
                    "background": "string",
                    "section": "string",
                    "text": "Preorder now"
                  },
                  "radius": 0,
                  "css": "string",
                  "html": {
                    "enabled": true,
                    "template": "string"
                  },
                  "reviews": {
                    "enabled": true,
                    "count": 5,
                    "min_rating": 5,
                    "title": "string"
                  },
                  "social": {
                    "facebook": "string",
                    "instagram": "string",
                    "pinterest": "string",
                    "twitter": "string",
                    "tiktok": "string",
                    "whatsapp": "string",
                    "youtube": "string",
                    "icon_color": "#FFFFFF"
                  },
                  "unsubscribe_text": "Preorder now",
                  "klaviyo_flow_name": "Summer Sneaker Drop"
                },
                "sms": {
                  "body": "string",
                  "link_destination": "checkout",
                  "klaviyo_flow_name": "Summer Sneaker Drop"
                },
                "locale": "fr"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/templates/{key}/send_test": {
      "post": {
        "operationId": "post_back_in_stock_templates_key_send_test",
        "summary": "Send Test",
        "description": "Send a back-in-stock notification template to one email address as a test, rendered against a sample alert in the body `locale` (omit it for the shop default language). Matches the template page's Send test email button.\n\n**Note:** email defaults to the shop's reply-to address; one address only. shopify_variant_id and shopify_product_id (both gids, send both or neither) pick the product shown. Fails (422) when email sending is turned off for the shop.",
        "tags": [
          "Back In Stock · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "send test email",
          "send a test back in stock email",
          "preview the restock email in my inbox",
          "test the signup thank you email"
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "locale": {
                    "type": "string",
                    "minLength": 1
                  },
                  "email": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "shopify_variant_id": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "shopify_product_id": {
                    "type": [
                      "null",
                      "string"
                    ]
                  }
                }
              },
              "example": {
                "locale": "fr",
                "email": "shopper@example.com",
                "shopify_variant_id": "45000000001",
                "shopify_product_id": "78000000001"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/templates/{key}/translations": {
      "get": {
        "operationId": "get_back_in_stock_templates_key_translations",
        "summary": "Translations",
        "description": "Read every translation of one back-in-stock notification's copy: the translatable field paths (as GET /back_in_stock/templates/:key names them), each one's default-language text, and the text per locale. key is \"signup_thank_you\", \"restock_alert\" or \"reminder\".\n\n**Note:** Write a translation with PATCH /back_in_stock/templates/:key and a body `locale`.",
        "tags": [
          "Back In Stock · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "back in stock template translations",
          "restock email translations",
          "restock sms translations"
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/back_in_stock/templates/{key}/verify_flow": {
      "post": {
        "operationId": "post_back_in_stock_templates_key_verify_flow",
        "summary": "Verify Flow",
        "description": "Check that the Klaviyo or Postscript flow for one back-in-stock notification is set up, the same as the template page's Verify flow button. channel is \"email\" (Klaviyo email) or \"sms\" (Klaviyo SMS or Postscript, whichever is the SMS provider). Klaviyo is checked for a flow with the template's klaviyo_flow_name / klaviyo_sms_flow_name. Postscript has no flows API, so for Postscript this records your confirmation that the flow exists.\n\n**Note:** 422 when the channel's provider is not Klaviyo/Postscript or is not connected. A flow Klaviyo cannot find is not an error: flow_verified is false and reason says why. The result also shows on GET /back_in_stock/templates/:key as email.klaviyo_flow_verified, sms.klaviyo_flow_verified and sms.postscript_flow_verified.",
        "tags": [
          "Back In Stock · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "verify klaviyo flow",
          "check my klaviyo flow",
          "verify postscript flow",
          "confirm postscript flow setup",
          "is my klaviyo flow set up"
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channel": {
                    "type": "string",
                    "minLength": 1,
                    "enum": [
                      "email",
                      "sms"
                    ]
                  }
                },
                "required": [
                  "channel"
                ]
              },
              "example": {
                "channel": "email"
              }
            }
          }
        }
      }
    },
    "/back_in_stock/widget_templates": {
      "post": {
        "operationId": "post_back_in_stock_widget_templates",
        "summary": "Create",
        "description": "Create a per-product back-in-stock widget template: a button and form design that products can use instead of the shop-wide widget.\n\n**Note:** name is required. Fields are the template's columns (storefront_button_*, storefront_form_*, inline_form_enabled, template_type, is_default). Errors are 422 keyed \"widget_template.<field>\".",
        "tags": [
          "Back In Stock · Widget Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "create widget template",
          "add a custom widget for some products",
          "new product widget design"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "get": {
        "operationId": "get_back_in_stock_widget_templates",
        "summary": "List",
        "description": "List the shop's per-product back-in-stock widget templates (button and form designs assigned to products), oldest first.\n\n**Note:** Assign a template to products with PATCH /back_in_stock/products (widget_template_id).",
        "tags": [
          "Back In Stock · Widget Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "list widget templates",
          "show product widget designs",
          "which products use a custom widget"
        ]
      }
    },
    "/back_in_stock/widget_templates/{id}": {
      "delete": {
        "operationId": "delete_back_in_stock_widget_templates_id",
        "summary": "Delete",
        "description": "Delete a per-product back-in-stock widget template. Its products fall back to the shop-wide widget. Default templates cannot be deleted.\n\n**Note:** 403 for a default template.",
        "tags": [
          "Back In Stock · Widget Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "delete widget template",
          "remove a product widget design"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      },
      "patch": {
        "operationId": "patch_back_in_stock_widget_templates_id",
        "summary": "Update",
        "description": "Update a per-product back-in-stock widget template. Partial: fields left out are unchanged.\n\n**Note:** Errors are 422 keyed \"widget_template.<field>\"; unknown and read-only fields are rejected.",
        "tags": [
          "Back In Stock · Widget Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit widget template",
          "change a product widget design",
          "rename widget template"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/customers/status": {
      "get": {
        "operationId": "get_customers_status",
        "summary": "Status",
        "description": "One customer's preorder and back-in-stock status by exact email — built for helpdesk sidebar widgets.",
        "tags": [
          "Customers · Status"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "customer status",
          "gorgias sidebar",
          "customer preorder status",
          "customer back in stock status"
        ],
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": true,
            "schema": {},
            "example": "shopper@example.com"
          },
          {
            "name": "include_checkout_text",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "Preorder now"
          }
        ]
      }
    },
    "/preorders/notification_settings": {
      "get": {
        "operationId": "get_preorders_notification_settings",
        "summary": "List",
        "description": "List the preorder notifications' switches. Only the confirmation has any: whether its email and SMS send, and whether customers may cancel from it. shipping_update and payment_failed always send once their trigger happens. sending_paused, present only when STOQ blocks a channel for the shop, says those notifications will not go out on it.\n\n**Note:** Each entry is the GET /preorders/notification_settings/:key body. Copy is GET /preorders/templates/:key.",
        "tags": [
          "Preorders · Notification Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "preorder notification channels",
          "is the preorder confirmation email on",
          "preorder notification settings"
        ]
      }
    },
    "/preorders/notification_settings/confirmation": {
      "get": {
        "operationId": "get_preorders_notification_settings_confirmation",
        "summary": "Confirmation",
        "description": "Read whether the preorder confirmation email and SMS send, and whether customers may cancel their preorder from the confirmation.",
        "tags": [
          "Preorders · Notification Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "show preorder confirmation switches"
        ]
      },
      "patch": {
        "operationId": "patch_preorders_notification_settings_confirmation",
        "summary": "Confirmation",
        "description": "Switch the preorder confirmation email and SMS on or off, and whether customers may cancel their preorder from the email.\n\n**Note:** Deep partial: absent fields are unchanged, unknown or read-only keys are rejected. Errors are 422 keyed \"notification_setting.<field>\". Returns the notification setting.",
        "tags": [
          "Preorders · Notification Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "turn off the preorder confirmation email",
          "edit preorder notifications",
          "enable preorder email",
          "disable preorder sms"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "email_enabled": {
                    "type": "boolean",
                    "description": "Send the preorder confirmation email."
                  },
                  "sms_enabled": {
                    "type": "boolean",
                    "description": "Send the preorder confirmation SMS; with STOQ SMS, the first switch-on pauses all SMS until STOQ reviews the content."
                  },
                  "customer_cancellation_enabled": {
                    "type": "boolean",
                    "description": "Let customers cancel their preorder from the link in the confirmation email."
                  }
                }
              },
              "example": {
                "email_enabled": true,
                "sms_enabled": true,
                "customer_cancellation_enabled": true
              }
            }
          }
        }
      }
    },
    "/preorders/offer_lookup": {
      "get": {
        "operationId": "get_preorders_offer_lookup",
        "summary": "Find",
        "description": "Resolve one preorder offer from an exact id or a fuzzy name match. Returns the full offer (same shape as GET /preorders/offers/:id) on a unique match. If `name` matches more than one offer, returns {ambiguous: true, candidates: [...]} instead of guessing -- re-call with the chosen id. Omit both id and name for the most recently created offer.",
        "tags": [
          "Preorders · Offer Lookup"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "find offer",
          "resolve offer",
          "look up offer by name",
          "which offer",
          "the offer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "Summer Sneaker Drop"
          }
        ]
      }
    },
    "/preorders/offers": {
      "post": {
        "operationId": "post_preorders_offers",
        "summary": "Create",
        "description": "Create a new preorder offer.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "73a74948-2b57-4cc3-971f-2b441828c977",
                  "name": "Summer Sneaker Drop",
                  "internal_name": "summer-2026",
                  "availability": {
                    "schedule": "enabled",
                    "starts_at": null,
                    "ends_at": null,
                    "current_status": "live",
                    "time_zone": "America/New_York"
                  }
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "new offer",
          "make a preorder",
          "create preorder offer"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {},
                  "internal_name": {}
                }
              },
              "example": {
                "name": "Summer Sneaker Drop",
                "internal_name": "summer-2026"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "get_preorders_offers",
        "summary": "List",
        "description": "List preorder offers in this shop, paginated. search matches offer name, internal name, or an attached product's title. status filters by current_status (live, scheduled, off, or deleted for deleted offers, which all leaves out). shopify_market_ids (Market GIDs) narrows to offers restricted to those Shopify markets. sort orders by created date, name, or revenue.\n\n**Note:** expand adds offer sections to each row, in the same shape as GET /preorders/offers/:id: inventory, shipping, payments, markets, products (comma-separated or an array). summary counts every offer matching the filters by current_status (total, live, scheduled, off; with status=deleted, total and deleted), not only this page.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "offers": [
                    {
                      "id": "73a74948-2b57-4cc3-971f-2b441828c977",
                      "name": "Summer Sneaker Drop",
                      "internal_name": "summer-2026",
                      "current_status": "live",
                      "line_item_revenue": "0.00",
                      "order_revenue": "0.00",
                      "created_at": "2026-06-25T10:30:45Z",
                      "updated_at": "2026-06-25T10:30:45Z"
                    },
                    {
                      "id": "5d1c6f0e-8a43-4e57-9b0a-2f6f4c1d7e90",
                      "name": "Winter Collection",
                      "internal_name": "winter-2026",
                      "current_status": "off",
                      "line_item_revenue": "0.00",
                      "order_revenue": "0.00",
                      "created_at": "2026-06-20T14:15:30Z",
                      "updated_at": "2026-06-22T09:45:12Z"
                    }
                  ],
                  "meta": {
                    "total_count": 2,
                    "page": 1,
                    "per_page": 50,
                    "total_pages": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "list offers",
          "show all offers",
          "preorder offers",
          "all preorders"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "live",
                "scheduled",
                "off",
                "deleted",
                "enabled",
                "disabled"
              ]
            },
            "example": "all"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "created_at desc",
                "created_at asc",
                "internal_name asc",
                "internal_name desc",
                "preorder_revenue desc",
                "preorder_revenue asc"
              ]
            },
            "example": "created_at desc"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "shopify_market_ids",
            "in": "query",
            "required": false,
            "schema": {},
            "example": [
              "gid://shopify/Market/12345"
            ]
          },
          {
            "name": "expand",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/preorders/offers/{id}": {
      "get": {
        "operationId": "get_preorders_offers_id",
        "summary": "Read",
        "description": "Read a preorder offer's full representation.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "73a74948-2b57-4cc3-971f-2b441828c977",
                  "shopify_selling_plan_group_id": "gid://shopify/SellingPlanGroup/100",
                  "name": "Summer Sneaker Drop",
                  "internal_name": "summer-2026",
                  "widget": {
                    "button": {
                      "button_text": "Preorder Now",
                      "custom_colors_enabled": true,
                      "text_color": "#ffffff",
                      "background_color": "#8700d3"
                    },
                    "disclaimer": {
                      "show_disclaimer": true,
                      "disclaimer_text": "Expected to ship by August 2026",
                      "text_color": "#FFFFFF",
                      "background_color": "#1F2937",
                      "border_radius": 4
                    },
                    "badge": {
                      "show_badge": true,
                      "badge_text": "Pre-Order",
                      "text_color": "#FFFFFF",
                      "background_color": "#000000"
                    }
                  },
                  "inventory": {
                    "stock_condition": "out_of_stock",
                    "reserve": "on_sale"
                  },
                  "products": {
                    "selection": "custom",
                    "shopify_collection_id": null,
                    "tags": [],
                    "eligible_inventory_policy": "all",
                    "excluded_shopify_variant_ids": [],
                    "exclusion_tag": null
                  },
                  "shipping": {
                    "timeline": {
                      "scope": "same",
                      "show_shipping_text": true,
                      "shipping_text": "Shipping: As soon as possible",
                      "variant_shipping_text": "ASAP"
                    },
                    "delivery_timing": "asap",
                    "ships_at": null,
                    "days_after_checkout": null,
                    "fulfillment": {
                      "handling": "none",
                      "hold_reason": "Order contains a preorder product. All fulfillments are on hold, as configured in STOQ > Preorders.",
                      "separate_orders": {
                        "grouping": "offer",
                        "number_format": "suffix",
                        "suffix": "SPLIT",
                        "hold_fulfillments": false,
                        "tag": "STOQ-split-order",
                        "transaction_gateway": "Prepaid",
                        "original_order_hold_tag": null,
                        "original_order_split_tag": null
                      }
                    },
                    "on_hold": {
                      "release_schedule": "manual",
                      "release_at": null,
                      "require_payment": false
                    }
                  },
                  "payments": {
                    "options_offered": "full",
                    "default_option": "full",
                    "full": {
                      "selling_plan_id": "gid://shopify/SellingPlan/101",
                      "checkout_charge": {
                        "charge_type": "percentage",
                        "charge_amount": 100
                      },
                      "remaining_balance": {
                        "charge_trigger": "no_remaining_balance",
                        "charge_exact_time": null,
                        "days_after_checkout": null
                      },
                      "price_adjustment": {
                        "adjustment_type": null,
                        "adjustment_amount": null
                      },
                      "option_title": "Full payment",
                      "option_description": "Pay the full price now",
                      "discount_text": "Save {{ discount }}"
                    },
                    "collection_schedule": "manual",
                    "show_payment_widget": false,
                    "show_discounted_price": null,
                    "currency_code": "USD"
                  },
                  "availability": {
                    "schedule": "enabled",
                    "starts_at": null,
                    "ends_at": null,
                    "current_status": "live"
                  },
                  "limits": {
                    "default_per_variant": null,
                    "display_style": "none",
                    "limit_text": "{{ quantity }} units available for preorder",
                    "show_icons": true,
                    "progress_bar": {
                      "progress_text": "{{ sold }} of {{ total }} claimed",
                      "fill_color": "#ffffff",
                      "background_color": "#e5e5e5",
                      "box_background_color": null,
                      "text_color": "#ffffff",
                      "border_radius": 4,
                      "show_percentage": false
                    },
                    "order_tags": [
                      "STOQ-preorder"
                    ],
                    "terms": {
                      "require_acceptance": false,
                      "terms_text": "I acknowledge and agree to the preorder terms and conditions for this product.",
                      "disable_button_until_accepted": false,
                      "record_acceptance": false,
                      "acceptance_label": "Preorder Terms Accepted"
                    },
                    "cart": {
                      "allowed_items": "mixed",
                      "error_message": "Preorders must be purchased separately from regular items. Please complete your current order first, or clear your cart to continue."
                    },
                    "order_quantity": {
                      "minimum": null,
                      "maximum": null
                    }
                  },
                  "countdown": {
                    "show_when": "disabled",
                    "date_source": "schedule",
                    "starts_at": null,
                    "ends_at": null,
                    "starts_text": null,
                    "ends_text": null,
                    "labels": {
                      "days": "Days",
                      "hours": "Hours",
                      "minutes": "Mins",
                      "seconds": "Secs"
                    },
                    "text_color": "#000000",
                    "background_color": "#f5f5f5",
                    "border_radius": 8,
                    "units": [
                      "days",
                      "hours",
                      "minutes",
                      "seconds"
                    ],
                    "current": {
                      "visible_phase": "hidden",
                      "target_at": null,
                      "heading_text": null
                    }
                  },
                  "markets": {
                    "scope": "all",
                    "shopify_market_ids": []
                  },
                  "advanced": {
                    "checkout_method": "selling_plan",
                    "cart_attributes": {
                      "show_payment": false,
                      "show_shipping": true,
                      "custom_text": null
                    }
                  },
                  "integrations": {
                    "pos": {
                      "enable_pos": true,
                      "inventory_check": "required"
                    },
                    "b2b": {
                      "enable_b2b": true
                    }
                  },
                  "batches": {
                    "release_strategy": "all_at_once",
                    "advance_schedule": "automatic",
                    "label_format": "Batch {{ n }}",
                    "status_text": {
                      "past": "Sold out",
                      "live": "Live",
                      "upcoming": "Coming soon"
                    },
                    "widget": {
                      "style": "roadmap",
                      "progress": "counts",
                      "show_other_ship_dates": true,
                      "show_names": false
                    },
                    "items": []
                  },
                  "translations": {},
                  "created_at": "2026-06-25T10:30:45Z",
                  "updated_at": "2026-06-25T11:45:30Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "show offer",
          "get preorder offer",
          "look up offer",
          "view offer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id",
        "summary": "Update",
        "description": "Update the offer's names: name (customer-facing) and internal_name (staff-only label).\n\n**Note:** Deep partial: absent fields are unchanged. name cannot be blank; internal_name null restores the default label (Preorder N). Other settings have their own section PATCH (/preorders/offers/:id/<section>); turning the offer on or off and scheduling it are the enable, disable, schedule and unschedule operations.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit offer",
          "modify offer",
          "change offer settings",
          "rename offer",
          "change offer name",
          "rename preorder",
          "change internal name",
          "relabel offer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {},
                  "internal_name": {}
                }
              },
              "example": {
                "name": "Summer Sneaker Drop",
                "internal_name": "summer-2026"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/advanced": {
      "get": {
        "operationId": "get_preorders_offers_id_advanced",
        "summary": "Advanced",
        "description": "Read the advanced settings of a preorder offer: the purchase option (checkout_method) and the cart attributes.\n\n**Note:** purchase_option_rules says, in plain sentences, what blocks turning the purchase option on, what needs it, and what turning it off would change. It is read-only.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get advanced",
          "show advanced settings",
          "view advanced settings",
          "view line item properties",
          "view advanced"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id_advanced",
        "summary": "Advanced",
        "description": "Update any subset of the advanced settings on a preorder offer: the purchase option and the cart attributes.\n\n**Note:** Deep partial: absent fields are unchanged. Accepting terms as a cart attribute is limits terms.record_acceptance.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "checkout_method": "selling_plan",
                  "cart_attributes": {
                    "show_payment": true,
                    "show_shipping": true,
                    "custom_text": null
                  }
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit advanced",
          "change advanced settings",
          "modify advanced",
          "enable line item property",
          "include in line item properties",
          "add cart property",
          "show on cart line",
          "disable line item property",
          "exclude from line item properties",
          "remove cart property",
          "hide from cart line",
          "clear button text override",
          "remove button text override",
          "reset button text for state",
          "use default button text",
          "attach to shopify selling plan",
          "use shopify selling plans",
          "resume shopify sync",
          "reattach to shopify",
          "detach from shopify selling plan",
          "stop using shopify selling plans",
          "manage selling plan internally",
          "bypass shopify selling plan",
          "set custom line item property",
          "set custom cart property",
          "set custom cart text",
          "add custom cart text"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "checkout_method": {
                    "type": "string",
                    "enum": [
                      "selling_plan",
                      "line_item_property"
                    ],
                    "description": "selling_plan uses a Shopify purchase option (selling plan); line_item_property runs the offer without one. line_item_property breaks Shopify-native checkout selling-plan display and third-party subscription apps, and resets what needs the purchase option: partial payment to full payment, the discount to none, and a Scheduled fulfillment status to On hold (listed in the response as also_changed). selling_plan is refused while \"Move preorder items to a separate order\" (shipping fulfillment.handling separate_orders) is on; turn that off first."
                  },
                  "cart_attributes": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "show_payment": {
                        "type": "boolean",
                        "description": "Show payment details & savings in cart."
                      },
                      "show_shipping": {
                        "type": "boolean",
                        "description": "Show fulfillment timeline in cart."
                      },
                      "custom_text": {
                        "type": "string",
                        "description": "Custom attribute: free text added to every preorder cart line. Empty string or null removes it."
                      }
                    }
                  },
                  "locale": {
                    "type": "string",
                    "description": "Language the translated fields are written in, such as 'fr' or 'pt-BR'. Omitted: the shop's default language. Untranslated fields ignore it."
                  }
                }
              },
              "example": {
                "cart_attributes": {
                  "show_payment": true
                }
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/batches": {
      "get": {
        "operationId": "get_preorders_offers_id_batches",
        "summary": "Batches",
        "description": "Read the batch settings of a preorder offer: release strategy, advance schedule, labels, storefront widget and the kept batches in order.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get batches",
          "show batches",
          "view batches",
          "batch settings",
          "list batches"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id_batches",
        "summary": "Batches",
        "description": "Update any subset of the batch settings on a preorder offer, including the batches themselves.\n\n**Note:** Deep partial: absent fields are unchanged; items[].label is read-only.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "release_strategy": "sequential",
                  "advance_schedule": "automatic",
                  "label_format": "Batch {{ n }}",
                  "status_text": {
                    "past": "Sold out",
                    "live": "Live",
                    "upcoming": "Coming soon"
                  },
                  "widget": {
                    "style": "roadmap",
                    "progress": "counts",
                    "show_other_ship_dates": true,
                    "show_names": false
                  },
                  "items": [
                    {
                      "id": "6f1c9e2a-0d4b-4c1e-9a57-2f0e8d3b7c11",
                      "position": 1,
                      "quantity_limit": 120,
                      "shipping_text": "Ships in June",
                      "label": "Batch 1"
                    },
                    {
                      "id": "a3d8b5f0-7e21-4b9c-8f64-1c2d9e0a5b37",
                      "position": 2,
                      "quantity_limit": 200,
                      "shipping_text": "Ships in July",
                      "label": "Batch 2"
                    }
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit batches",
          "change batch settings",
          "modify batches",
          "enable batches",
          "turn on batches",
          "sell in batches",
          "release in waves",
          "disable batches",
          "turn off batches",
          "stop selling in batches",
          "add a batch",
          "remove a batch",
          "reorder batches",
          "set batch limits",
          "set batch ship dates",
          "advance batches automatically",
          "auto advance batches",
          "advance batches manually",
          "batch widget style",
          "change batch widget",
          "batch progress display"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "release_strategy": {
                    "type": "string",
                    "enum": [
                      "sequential",
                      "all_at_once"
                    ],
                    "description": "sequential sells the batches one after another (needs at least two batches, a paid plan, and no market-specific offer); all_at_once turns batches off. Turning batches on uses one shipping timeline for every product and moves a Scheduled fulfillment status (shipping.delivery_timing exact_time) to Unfulfilled (asap), listed in also_changed, as the editor does."
                  },
                  "advance_schedule": {
                    "type": "string",
                    "enum": [
                      "automatic",
                      "manual"
                    ],
                    "description": "automatic moves to the next batch when one sells its quantity_limit (every batch then needs one); manual waits for the merchant."
                  },
                  "label_format": {
                    "type": "string",
                    "description": "Batch name; {{ n }} is replaced by the position. null uses \"Batch {{ n }}\"."
                  },
                  "status_text": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "past": {
                        "type": "string",
                        "description": "Word shown for a batch that has passed."
                      },
                      "live": {
                        "type": "string",
                        "description": "Word shown for the batch on sale now."
                      },
                      "upcoming": {
                        "type": "string",
                        "description": "Word shown for a batch still to come."
                      }
                    }
                  },
                  "widget": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "style": {
                        "type": "string",
                        "enum": [
                          "roadmap",
                          "stacked",
                          "compact",
                          "segmented"
                        ],
                        "description": "Storefront batch widget layout."
                      },
                      "progress": {
                        "type": "string",
                        "enum": [
                          "counts",
                          "percent"
                        ],
                        "description": "counts shows units sold of the limit; percent shows a percentage."
                      },
                      "show_other_ship_dates": {
                        "type": "boolean",
                        "description": "Show the other batches' ship dates on the storefront."
                      },
                      "show_names": {
                        "type": "boolean",
                        "description": "Show batch names on the storefront."
                      }
                    }
                  },
                  "items": {
                    "type": "array",
                    "description": "The batches. A list replaces them: entries with an id keep that batch, entries without one are created, and batches left out are archived. An object keyed by batch id edits those batches (quantity_limit, shipping_text) and keeps the rest. Kept batches stay in their current order and new ones go at the end; positions end up 1..N. Each batch needs shipping_text; quantity_limit is all or none across batches."
                  }
                }
              },
              "example": {
                "release_strategy": "sequential",
                "items": {
                  "6f1c9e2a-0d4b-4c1e-9a57-2f0e8d3b7c11": {
                    "quantity_limit": 120
                  }
                }
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/countdown": {
      "get": {
        "operationId": "get_preorders_offers_id_countdown",
        "summary": "Countdown",
        "description": "Read the countdown timer settings of a preorder offer.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get countdown",
          "show timer",
          "view countdown timer",
          "view timer settings",
          "countdown settings"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id_countdown",
        "summary": "Countdown",
        "description": "Update any subset of the countdown timer settings on a preorder offer.\n\n**Note:** Deep partial: absent fields are unchanged; current is read-only.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "show_when": "during_preorder",
                  "date_source": "custom",
                  "starts_at": null,
                  "ends_at": "2026-09-30T18:00:00Z",
                  "starts_text": null,
                  "ends_text": null,
                  "labels": {
                    "days": "Days",
                    "hours": "Hours",
                    "minutes": "Mins",
                    "seconds": "Secs"
                  },
                  "text_color": "#000000",
                  "background_color": "#f5f5f5",
                  "border_radius": 8,
                  "units": [
                    "days",
                    "hours",
                    "minutes",
                    "seconds"
                  ],
                  "current": {
                    "visible_phase": "during_preorder",
                    "target_at": "2026-09-30T18:00:00Z",
                    "heading_text": null
                  }
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit countdown",
          "change timer",
          "modify countdown settings",
          "enable countdown",
          "show timer",
          "turn on countdown",
          "enable countdown timer",
          "disable countdown",
          "hide timer",
          "turn off countdown",
          "disable countdown timer",
          "set countdown text",
          "set timer text",
          "change countdown label",
          "set timer label",
          "set custom end date",
          "set timer end date",
          "change timer deadline",
          "set ends text",
          "set timer end text",
          "set 'ends in' text",
          "set countdown mode",
          "change timer mode",
          "use schedule for timer",
          "use custom date for timer",
          "set starts text",
          "set timer pre-launch text",
          "set 'starts in' text",
          "set timer style",
          "change timer style",
          "set countdown style",
          "change timer colors",
          "countdown labels",
          "timer labels",
          "rename days label",
          "change hours label",
          "countdown unit names"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "show_when": {
                    "type": "string",
                    "enum": [
                      "disabled",
                      "before_launch",
                      "during_preorder",
                      "both"
                    ],
                    "description": "disabled hides the timer; before_launch counts down to the start, during_preorder to the end, both to the start and then the end. It is read back from the dates: both switches date_source to schedule unless date_source is sent, and with custom dates before_launch clears ends_at and during_preorder clears starts_at."
                  },
                  "date_source": {
                    "type": "string",
                    "enum": [
                      "schedule",
                      "custom"
                    ],
                    "description": "schedule uses the offer schedule start and end dates; custom uses starts_at and ends_at."
                  },
                  "starts_at": {
                    "type": "string",
                    "description": "Custom launch date and time. Without Z or an offset it is the shop's local time (2026-09-30T18:00). null clears it. Used when date_source is custom."
                  },
                  "ends_at": {
                    "type": "string",
                    "description": "Custom deadline date and time. Without Z or an offset it is the shop's local time (2026-09-30T18:00). null clears it. Used when date_source is custom."
                  },
                  "starts_text": {
                    "type": "string",
                    "description": "Heading shown before launch."
                  },
                  "ends_text": {
                    "type": "string",
                    "description": "Heading shown during the preorder."
                  },
                  "labels": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "days": {
                        "type": "string",
                        "description": "Days label."
                      },
                      "hours": {
                        "type": "string",
                        "description": "Hours label."
                      },
                      "minutes": {
                        "type": "string",
                        "description": "Minutes label."
                      },
                      "seconds": {
                        "type": "string",
                        "description": "Seconds label."
                      }
                    }
                  },
                  "text_color": {
                    "type": "string",
                    "pattern": "^#([0-9a-fA-F]{3,8})$",
                    "description": "Timer text color. Hex."
                  },
                  "background_color": {
                    "type": "string",
                    "pattern": "^#([0-9a-fA-F]{3,8})$",
                    "description": "Timer background color. Hex."
                  },
                  "border_radius": {
                    "type": "integer",
                    "description": "Corner radius in pixels."
                  },
                  "units": {
                    "type": "array",
                    "description": "Time units to display, any of days, hours, minutes, seconds."
                  },
                  "locale": {
                    "type": "string",
                    "description": "Language the translated fields are written in, such as 'fr' or 'pt-BR'. Omitted: the shop's default language. Untranslated fields ignore it."
                  }
                }
              },
              "example": {
                "show_when": "during_preorder",
                "date_source": "custom",
                "ends_at": "2026-09-30T18:00:00Z"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/disable": {
      "post": {
        "operationId": "post_preorders_offers_id_disable",
        "summary": "Disable",
        "description": "Turn a preorder offer off. A scheduled or dated offer has its schedule cleared, as the dashboard does. Optionally flip attached variants' inventory policy back to DENY.\n\n**Note:** Variants are left at their existing inventory policy unless `update_inventory_policy: true` is passed. On a scheduled or dated offer, disable removes the schedule (`schedule.start` and `schedule.end` are cleared), so the offer stays off instead of starting on its start date. To turn it on later, call enable or set a new schedule.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "73a74948-2b57-4cc3-971f-2b441828c977",
                  "name": "Summer Sneaker Drop",
                  "internal_name": "summer-2026",
                  "availability": {
                    "schedule": "disabled",
                    "starts_at": null,
                    "ends_at": null,
                    "current_status": "disabled"
                  },
                  "updated_at": "2026-06-25T12:15:20Z"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "pause",
          "turn off",
          "deactivate",
          "stop offer",
          "end preorder",
          "disable and stop overselling",
          "close out preorder"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "update_inventory_policy": {},
                  "shopify_variant_ids": {}
                }
              },
              "example": {
                "update_inventory_policy": true
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/discard": {
      "post": {
        "operationId": "post_preorders_offers_id_discard",
        "summary": "Discard",
        "description": "Discard (soft-delete) a preorder offer. Not permanent: it can be restored later, and comes back off.\n\n**Note:** Turns the offer off and removes its schedule first, as the dashboard does. Recoverable via restore indefinitely; it comes back off.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "delete",
          "remove",
          "archive",
          "trash",
          "soft delete"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/offers/{id}/duplicate": {
      "post": {
        "operationId": "post_preorders_offers_id_duplicate",
        "summary": "Duplicate",
        "description": "Duplicate a preorder offer, as the dashboard's Duplicate does. Returns the new offer.\n\n**Note:** The copy has every setting, payment option and batch of the original, named \"<internal_name> (Copy)\" (\"(Copy 2)\" and so on when taken). It starts off, with no products (selection is a custom list, empty), no schedule and no automatic hold release. A ship or balance date already in the past is reset: delivery to asap, the balance charge to none remaining. A deleted offer returns 404; restore it first.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "copy offer",
          "clone offer",
          "duplicate preorder",
          "copy preorder",
          "make a copy of offer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/offers/{id}/enable": {
      "post": {
        "operationId": "post_preorders_offers_id_enable",
        "summary": "Enable",
        "description": "Enable a preorder offer. On a scheduled offer this starts it now (the start date is cleared; an end date is kept), as the dashboard does. Optionally flip attached variants' inventory policy to CONTINUE.\n\n**Note:** Variants are left at their existing inventory policy unless `update_inventory_policy: true` is passed. On a scheduled offer enable starts the offer now: the start date is cleared, the end date is kept, and with no end date the schedule is removed. To keep the start date, do not call enable; the offer starts on its own.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "73a74948-2b57-4cc3-971f-2b441828c977",
                  "name": "Summer Sneaker Drop",
                  "internal_name": "summer-2026",
                  "availability": {
                    "schedule": "enabled",
                    "starts_at": null,
                    "ends_at": null,
                    "current_status": "live"
                  },
                  "updated_at": "2026-06-25T11:45:30Z"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "turn on",
          "activate",
          "launch",
          "go live",
          "start offer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "update_inventory_policy": {},
                  "shopify_variant_ids": {}
                }
              },
              "example": {
                "update_inventory_policy": true
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/integrations": {
      "get": {
        "operationId": "get_preorders_offers_id_integrations",
        "summary": "Integrations",
        "description": "Read integration settings for a preorder offer (POS, B2B).",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get integrations",
          "show integrations",
          "view pos settings",
          "view b2b settings",
          "integration settings"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id_integrations",
        "summary": "Integrations",
        "description": "Update any subset of the POS and B2B settings on a preorder offer.\n\n**Note:** Deep partial: absent fields are unchanged. This does not configure marketing or email integrations, which are shop-level.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit integrations",
          "change integration settings",
          "modify integrations",
          "enable pos",
          "turn on pos",
          "allow in pos",
          "enable point of sale",
          "disable pos",
          "turn off pos",
          "block from pos",
          "disable point of sale",
          "enable pos skip inventory check",
          "skip inventory check on pos",
          "bypass inventory at pos",
          "allow pos sale without inventory",
          "skip pos inventory check",
          "disable pos skip inventory check",
          "enforce inventory check at pos",
          "stop bypassing inventory at pos",
          "enable b2b",
          "turn on b2b",
          "allow b2b",
          "enable wholesale",
          "disable b2b",
          "turn off b2b",
          "block b2b",
          "disable wholesale",
          "b2b preorders",
          "wholesale preorders",
          "sell on pos",
          "pos preorders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "pos": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "enable_pos": {
                        "type": "boolean",
                        "description": "Sell preorders on POS."
                      },
                      "inventory_check": {
                        "type": "string",
                        "enum": [
                          "skip",
                          "required"
                        ],
                        "description": "skip sells on POS without checking inventory; required keeps the inventory check."
                      }
                    }
                  },
                  "b2b": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "enable_b2b": {
                        "type": "boolean",
                        "description": "Allow B2B customers to place preorders on this offer."
                      }
                    }
                  }
                }
              },
              "example": {
                "pos": {
                  "enable_pos": true,
                  "inventory_check": "skip"
                },
                "b2b": {
                  "enable_b2b": true
                }
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/inventory": {
      "get": {
        "operationId": "get_preorders_offers_id_inventory",
        "summary": "Inventory",
        "description": "Read the inventory configuration for a preorder offer.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get inventory settings",
          "show inventory",
          "view inventory policy",
          "view reservation timing",
          "view stock handling"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id_inventory",
        "summary": "Inventory",
        "description": "Update any subset of the inventory settings on a preorder offer.\n\n**Note:** Deep partial: absent fields are unchanged. Continue selling for newly attached variants is products.eligible_inventory_policy, part of the products section.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "stock_condition": "out_of_stock",
                  "reserve": "on_fulfillment"
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit inventory",
          "change inventory settings",
          "modify inventory",
          "enable continue selling for the whole offer",
          "allow overselling",
          "enable oversell",
          "auto continue selling",
          "auto-apply continue selling on attach",
          "disable continue selling",
          "stop auto continue selling",
          "disable oversell",
          "prevent overselling on attach",
          "enable auto apply continue selling",
          "auto continue selling on attach",
          "auto-flip new variants to continue",
          "apply oversell to new variants",
          "disable auto apply continue selling",
          "stop auto continue selling on attach",
          "don't auto-flip new variants",
          "no oversell on new variants",
          "set inventory provider",
          "switch inventory provider",
          "use shopify inventory",
          "use stoq inventory",
          "set reservation timing",
          "change inventory reservation",
          "set when inventory is held",
          "reserve on sale",
          "reserve on fulfillment",
          "always show preorder",
          "preorder regardless of stock"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "stock_condition": {
                    "type": "string",
                    "enum": [
                      "out_of_stock",
                      "in_stock",
                      "any_stock_level"
                    ],
                    "description": "When the Preorder button shows: out_of_stock when the product is out of stock (needs Shopify's 'Continue selling when out of stock' on the variants); in_stock only while the product is in stock (at 0 it stops showing); any_stock_level whenever the variant can be bought, in or out of stock, never changing the inventory policy: \"even when in stock\" or \"in stock too\" is any_stock_level. in_stock and any_stock_level need specific products."
                  },
                  "reserve": {
                    "type": "string",
                    "enum": [
                      "on_sale",
                      "on_fulfillment"
                    ],
                    "description": "When to deduct from inventory: on_sale is at checkout, on_fulfillment is at fulfillment. in_stock and any_stock_level always deduct on_sale."
                  }
                }
              },
              "example": {
                "reserve": "on_fulfillment"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/limits": {
      "get": {
        "operationId": "get_preorders_offers_id_limits",
        "summary": "Limits",
        "description": "Read the limits & terms of a preorder offer: quantity limits and their display, order tags, the terms checkbox and mixed-cart rules.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get limits",
          "show limits",
          "view quantity limits",
          "view order min max",
          "limits",
          "get checkout settings",
          "show checkout",
          "view terms",
          "view mixed cart",
          "view order tags",
          "checkout"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id_limits",
        "summary": "Limits",
        "description": "Update any subset of the limits & terms on a preorder offer: quantity limits and their display, order tags, the terms checkbox and mixed-cart rules.\n\n**Note:** Deep partial: absent fields are unchanged, null clears. default_per_variant is copied onto every variant in the offer when it changes, replacing their own limits, as the editor does after its confirmation.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "default_per_variant": null,
                  "display_style": "progress_bar",
                  "limit_text": "{{ quantity }} units available for preorder",
                  "show_icons": true,
                  "progress_bar": {
                    "progress_text": "{{ sold }} of {{ total }} claimed",
                    "fill_color": "#ffffff",
                    "background_color": "#e5e5e5",
                    "box_background_color": null,
                    "text_color": "#ffffff",
                    "border_radius": 4,
                    "show_percentage": false
                  },
                  "order_tags": [
                    "STOQ-preorder",
                    "vip"
                  ],
                  "terms": {
                    "require_acceptance": true,
                    "terms_text": "I acknowledge and agree to the preorder terms and conditions for this product.",
                    "disable_button_until_accepted": false,
                    "record_acceptance": false,
                    "acceptance_label": "Preorder Terms Accepted"
                  },
                  "cart": {
                    "allowed_items": "mixed",
                    "error_message": "Preorders must be purchased separately from regular items."
                  },
                  "order_quantity": {
                    "minimum": null,
                    "maximum": null
                  }
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit checkout",
          "change checkout settings",
          "modify checkout",
          "enable terms",
          "require acknowledgement",
          "show terms checkbox",
          "turn on terms",
          "require terms",
          "disable terms",
          "hide terms checkbox",
          "remove terms requirement",
          "turn off terms",
          "stop requiring terms",
          "enable disable until acknowledged",
          "require acknowledgement before buying",
          "lock button until terms accepted",
          "grey out button until terms checked",
          "disable button until terms",
          "disable disable until acknowledged",
          "don't lock button on terms",
          "allow buying without acknowledging first",
          "keep button enabled before terms",
          "include terms in line item properties",
          "record terms acceptance on order",
          "add acknowledgement to line items",
          "show terms accepted on order",
          "record terms acceptance",
          "allow mixed cart",
          "permit mixed cart",
          "enable mixed cart",
          "let preorders mix with regular items",
          "block mixed cart",
          "disable mixed cart",
          "prevent mixed cart",
          "force separate checkout",
          "block mixed carts",
          "dont allow mixed carts",
          "add order tag",
          "add tag to preorder orders",
          "append order tag",
          "remove order tag",
          "delete order tag",
          "drop order tag",
          "mixed cart orders",
          "set mixed cart error message",
          "change mixed cart message",
          "set mixed cart warning",
          "customize mixed cart error",
          "set order tags",
          "replace order tags",
          "change order tags",
          "set tags on preorder orders",
          "accept terms",
          "terms checkbox",
          "set terms text",
          "change terms text",
          "update terms",
          "change acknowledgement text",
          "set fine print",
          "edit limits",
          "change limits",
          "modify quantity limits",
          "enable show remaining",
          "show remaining units",
          "show stock left",
          "display quantity remaining",
          "disable show remaining",
          "hide remaining units",
          "hide stock left",
          "stop showing quantity",
          "hide progress bar",
          "show icons",
          "enable icons",
          "hide icons",
          "disable icons",
          "icons for details",
          "set maximum per order",
          "set max quantity",
          "maximum order quantity",
          "set order limit",
          "set minimum per order",
          "set min quantity",
          "minimum order quantity",
          "set order minimum",
          "progress bar",
          "show counter",
          "stock counter",
          "show limit as counter",
          "crowdfunding bar",
          "units left bar",
          "quantity limit text",
          "limit text",
          "units left text",
          "change limit message"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "default_per_variant": {
                    "type": "integer",
                    "description": "Same limit for every product: the most units of each variant that can be preordered. Copied onto EVERY variant in the offer when it changes, replacing each variant's own limit. null clears the limit on every variant. Set one variant's limit with the offer's variant settings instead. While batches release_strategy is sequential the editor hides it: per-batch quantities govern."
                  },
                  "display_style": {
                    "type": "string",
                    "enum": [
                      "none",
                      "disclaimer",
                      "progress_bar"
                    ],
                    "description": "How customers see the limit: none, disclaimer (remaining units in the disclaimer) or progress_bar."
                  },
                  "limit_text": {
                    "type": "string",
                    "description": "Quantity Limit -- the text printed with the remaining-units count."
                  },
                  "show_icons": {
                    "type": "boolean",
                    "description": "Use icons for quantity & shipping details on the widget."
                  },
                  "progress_bar": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "progress_text": {
                        "type": "string",
                        "description": "Progress bar text."
                      },
                      "fill_color": {
                        "type": "string",
                        "pattern": "^#([0-9a-fA-F]{3,8})$",
                        "description": "The bar's Fill color. Hex."
                      },
                      "background_color": {
                        "type": "string",
                        "pattern": "^#([0-9a-fA-F]{3,8})$",
                        "description": "The bar's Background color. Hex."
                      },
                      "box_background_color": {
                        "type": "string",
                        "pattern": "^#([0-9a-fA-F]{3,8})$",
                        "description": "Box background -- the colour behind the bar. Hex; null falls back to the disclaimer background."
                      },
                      "text_color": {
                        "type": "string",
                        "pattern": "^#([0-9a-fA-F]{3,8})$",
                        "description": "The bar's Text color. Hex."
                      },
                      "border_radius": {
                        "type": "integer",
                        "description": "The bar's corner radius in pixels."
                      },
                      "show_percentage": {
                        "type": "boolean",
                        "description": "Show percentage next to progress bar."
                      }
                    }
                  },
                  "order_tags": {
                    "type": "array",
                    "description": "Tags Shopify puts on orders containing this offer. A list replaces them; {\"$add\": [...], \"$remove\": [...]} edits them. Blanks and duplicates are dropped; null or [] clears."
                  },
                  "terms": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "require_acceptance": {
                        "type": "boolean",
                        "description": "Require customer to accept terms before preordering."
                      },
                      "terms_text": {
                        "type": "string",
                        "description": "Acknowledgement text -- the wording beside the terms checkbox."
                      },
                      "disable_button_until_accepted": {
                        "type": "boolean",
                        "description": "Disable button until terms are accepted."
                      },
                      "record_acceptance": {
                        "type": "boolean",
                        "description": "Record when customer accepted terms, as a cart line property."
                      },
                      "acceptance_label": {
                        "type": "string",
                        "description": "Label for that recorded-acceptance cart line property."
                      }
                    }
                  },
                  "cart": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "allowed_items": {
                        "type": "string",
                        "enum": [
                          "mixed",
                          "preorder_only"
                        ],
                        "description": "mixed lets a cart hold preorder and regular items; preorder_only blocks the mix at checkout (the editor's \"Don't allow mixed cart orders\")."
                      },
                      "error_message": {
                        "type": "string",
                        "description": "Mixed cart error message -- shown when a blocked mixed cart reaches checkout."
                      }
                    }
                  },
                  "order_quantity": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "minimum": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "description": "Minimum quantity per order. null removes it."
                      },
                      "maximum": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "description": "Maximum quantity per order. null removes the cap."
                      }
                    }
                  },
                  "locale": {
                    "type": "string",
                    "description": "Language the translated fields are written in, such as 'fr' or 'pt-BR'. Omitted: the shop's default language. Untranslated fields ignore it."
                  }
                }
              },
              "example": {
                "display_style": "progress_bar",
                "order_tags": {
                  "$add": [
                    "vip"
                  ]
                },
                "terms": {
                  "require_acceptance": true
                }
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/markets": {
      "get": {
        "operationId": "get_preorders_offers_id_markets",
        "summary": "Markets",
        "description": "Read market scoping for a preorder offer.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get markets",
          "show market scoping",
          "view markets",
          "what markets",
          "which countries",
          "market settings"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id_markets",
        "summary": "Markets",
        "description": "Update any subset of the market settings on a preorder offer.\n\n**Note:** Deep partial: absent fields are unchanged. Get market GIDs from the shop's Shopify markets.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "scope": "selected",
                  "shopify_market_ids": [
                    "gid://shopify/Market/1",
                    "gid://shopify/Market/2"
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit markets",
          "change market scoping",
          "modify markets",
          "enable market scoping",
          "turn on market scoping",
          "scope to markets",
          "enable markets",
          "disable market scoping",
          "turn off market scoping",
          "remove market restrictions",
          "global preorder",
          "enable all markets",
          "apply to all markets",
          "all countries",
          "available everywhere",
          "add market",
          "include market",
          "add country",
          "extend to market",
          "remove market",
          "exclude market",
          "drop market",
          "remove country",
          "set markets",
          "change markets",
          "restrict to markets",
          "set countries",
          "set regions"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "scope": {
                    "type": "string",
                    "enum": [
                      "all",
                      "selected"
                    ],
                    "description": "all applies the offer in every market and clears shopify_market_ids; selected applies it only in shopify_market_ids, which must not be empty."
                  },
                  "shopify_market_ids": {
                    "type": "array",
                    "description": "Shopify Market GIDs (or numeric ids) the offer applies to when scope is selected. An array replaces the list; {\"$add\": [...], \"$remove\": [...]} edits it. Emptying the list moves scope to all."
                  }
                }
              },
              "example": {
                "shopify_market_ids": {
                  "$add": [
                    "gid://shopify/Market/2"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/payments": {
      "get": {
        "operationId": "get_preorders_offers_id_payments",
        "summary": "Payments",
        "description": "Read the payment configuration for a preorder offer.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get payment settings",
          "show payments",
          "view billing",
          "view deposit",
          "view discount",
          "payment options"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id_payments",
        "summary": "Payments",
        "description": "Update a deep partial of the canonical payment settings. Full and partial are stable kind selectors.\n\n**Note:** Omitted fields stay unchanged. Null clears copy or price_adjustment. Explicit options_offered adds/removes kinds. Choose full or partial for ambiguous billing copy. Read-only and unknown fields are rejected. Invalid patches write nothing locally; publication runs after commit.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit payments",
          "change payment settings",
          "modify billing",
          "update remaining balance settings",
          "change discount",
          "set discount",
          "apply discount",
          "set percentage off",
          "set amount off",
          "clear discount",
          "remove discount",
          "no discount",
          "stop discount",
          "remove preorder discount",
          "enable auto collect",
          "enable auto charge",
          "auto-charge balance",
          "automatically charge balance",
          "turn on auto collect",
          "disable auto collect",
          "disable auto charge",
          "stop auto charge",
          "turn off auto collect",
          "manual balance collection",
          "disable auto collect on fulfillment",
          "don't charge on fulfillment",
          "turn off charge at ship time",
          "stop collecting on ship",
          "enable auto collect on fulfillment",
          "charge on fulfillment",
          "auto charge at ship time",
          "collect balance on ship",
          "show partial payment option first",
          "preselect deposit option",
          "default to full payment",
          "disable payment option",
          "enable payment option",
          "add full payment option",
          "add partial payment option",
          "set payment mode",
          "change payment options",
          "remove full payment option",
          "stop offering full payment",
          "partial payment only",
          "deposit only",
          "remove partial payment option",
          "stop offering deposit",
          "full payment only",
          "offer both payment options",
          "let customers choose how to pay",
          "offer both full and partial payment",
          "set balance due days",
          "charge balance after n days",
          "collect balance days after checkout",
          "balance due in days",
          "charge remaining balance later",
          "set days after checkout",
          "collect balance a week after checkout",
          "show payment widget",
          "show payment and savings",
          "enable billing widget",
          "show savings breakdown",
          "show payment schedule to customers",
          "show payment breakdown",
          "turn on billing widget",
          "hide payment widget",
          "hide payment and savings",
          "disable billing widget",
          "hide savings breakdown",
          "hide payment breakdown",
          "turn off billing widget",
          "set deposit amount",
          "set a fixed deposit",
          "charge a fixed amount upfront",
          "set upfront payment amount",
          "change down payment amount",
          "change deposit amount",
          "change down payment",
          "set deposit percent",
          "set deposit percentage",
          "set upfront payment percent",
          "set discount text",
          "change discount blurb",
          "set discount message",
          "change discount copy",
          "set savings text",
          "set option copy",
          "change billing title",
          "set payment option text",
          "set partial option copy",
          "set deposit option text",
          "set full option copy",
          "set payment date",
          "balance due date",
          "charge on a specific date",
          "final payment date",
          "collect balance on date",
          "show discounted price",
          "display sale price",
          "show discount price",
          "hide discounted price",
          "set billing widget title",
          "set billing widget description",
          "change payment breakdown text",
          "edit billing widget copy"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "options_offered": {
                    "type": "string",
                    "enum": [
                      "full",
                      "partial",
                      "full_and_partial"
                    ],
                    "description": "Explicitly add or remove full/partial payment kinds. Omitted kinds remain offered. Mode changes initialize payment widget and cart attributes."
                  },
                  "default_option": {
                    "type": "string",
                    "enum": [
                      "full",
                      "partial"
                    ],
                    "description": "Select an offered, synced full or partial kind as the default."
                  },
                  "full": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "option_title": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Billing Title for full payment."
                      },
                      "option_description": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Billing Description for full payment."
                      },
                      "discount_text": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Discount copy for full payment."
                      },
                      "price_adjustment": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "additionalProperties": false,
                        "properties": {
                          "adjustment_type": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "percentage",
                              "price",
                              "fixed_amount",
                              null
                            ],
                            "description": "Percentage or fixed amount discount. Null clears the discount."
                          },
                          "adjustment_amount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Discount amount; an omitted type uses the saved type.",
                            "exclusiveMinimum": 0
                          }
                        }
                      }
                    }
                  },
                  "partial": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "option_title": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Billing Title for partial payment."
                      },
                      "option_description": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Billing Description for partial payment."
                      },
                      "discount_text": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Discount copy for partial payment."
                      },
                      "price_adjustment": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "additionalProperties": false,
                        "properties": {
                          "adjustment_type": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "percentage",
                              "price",
                              "fixed_amount",
                              null
                            ],
                            "description": "Percentage or fixed amount discount. Null clears the discount."
                          },
                          "adjustment_amount": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Discount amount; an omitted type uses the saved type.",
                            "exclusiveMinimum": 0
                          }
                        }
                      },
                      "checkout_charge": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "charge_type": {
                            "type": "string",
                            "enum": [
                              "percentage",
                              "price"
                            ],
                            "description": "Deposit as percentage or price."
                          },
                          "charge_amount": {
                            "type": "number",
                            "description": "Checkout deposit; percentage must not exceed 100. 0 is the editor's \"No upfront payment\": nothing is charged at checkout.",
                            "minimum": 0
                          }
                        }
                      },
                      "remaining_balance": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "charge_trigger": {
                            "type": "string",
                            "enum": [
                              "exact_time",
                              "time_after_checkout"
                            ],
                            "description": "Collect at an exact time or days after checkout."
                          },
                          "charge_exact_time": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 datetime, required for exact_time; otherwise null."
                          },
                          "days_after_checkout": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Positive days, required for time_after_checkout; otherwise null.",
                            "minimum": 1
                          }
                        }
                      }
                    }
                  },
                  "collection_schedule": {
                    "type": "string",
                    "enum": [
                      "manual",
                      "scheduled",
                      "on_fulfillment"
                    ],
                    "description": "Collect the remaining balance manually, on its scheduled date, or on fulfillment. A balance due date alone charges nothing: \"charge the rest after N days\" also needs scheduled, and while it stays manual say the merchant collects it."
                  },
                  "show_payment_widget": {
                    "type": "boolean",
                    "description": "Show payment & discount savings. Also turns the payment cart attribute (advanced.cart_attributes.show_payment) on or off, as the editor does."
                  },
                  "show_discounted_price": {
                    "type": "boolean",
                    "description": "Show discounted price."
                  },
                  "locale": {
                    "type": "string",
                    "description": "Language the translated fields are written in, such as 'fr' or 'pt-BR'. Omitted: the shop's default language. Untranslated fields ignore it."
                  }
                }
              },
              "example": {
                "options_offered": "full",
                "default_option": "full",
                "full": {
                  "option_title": "string",
                  "option_description": "string",
                  "discount_text": "Preorder now",
                  "price_adjustment": "string"
                },
                "partial": {
                  "option_title": "string",
                  "option_description": "string",
                  "discount_text": "Preorder now",
                  "price_adjustment": "string",
                  "checkout_charge": {
                    "charge_type": "percentage",
                    "charge_amount": 0
                  },
                  "remaining_balance": {
                    "charge_trigger": "exact_time",
                    "charge_exact_time": "string",
                    "days_after_checkout": "string"
                  }
                },
                "collection_schedule": "manual",
                "show_payment_widget": true,
                "show_discounted_price": 5,
                "locale": "fr"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/products": {
      "get": {
        "operationId": "get_preorders_offers_id_products",
        "summary": "Products",
        "description": "Read the products configuration for a preorder offer: the selection rule, its collection or tags, exclusions, the eligible inventory policy, the attached variant count and the collection's name.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get products",
          "show linked products",
          "view variants on offer",
          "view product source",
          "what's on this offer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id_products",
        "summary": "Products",
        "description": "Update any subset of the products configuration on a preorder offer: the selection rule, its collection or tags, the exclusions and which inventory policy newly attached variants get.\n\n**Note:** Deep partial: absent fields are unchanged. Switching selection removes the current variants on Shopify before anything is saved, then refills from the new rule asynchronously; a refused Shopify reset leaves the offer as it was. Custom variants are added and removed with add_variants and remove_variants.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "selection": "collection",
                  "shopify_collection_id": "gid://shopify/Collection/482865234104",
                  "tags": [],
                  "eligible_inventory_policy": "all",
                  "excluded_shopify_variant_ids": [],
                  "exclusion_tag": null
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit products",
          "change product selection",
          "change variant source",
          "set products",
          "modify products on offer",
          "change collection",
          "swap collection",
          "use a different collection",
          "update the collection on the offer",
          "set excluded variants",
          "exclude variants list",
          "block variants from offer",
          "set exclusion tag",
          "exclude by tag",
          "set exclude tag",
          "set source to all",
          "apply to all products",
          "auto-source",
          "every variant",
          "shop-wide preorder",
          "set source to collection",
          "use a collection",
          "link to collection",
          "set products from collection",
          "drive variants from collection",
          "set source to custom",
          "use custom variants",
          "custom product list",
          "switch to custom",
          "set source to tags",
          "use product tags",
          "link to tags",
          "set products from tags",
          "drive variants from tags",
          "change product tags",
          "set offer tags",
          "edit tags on offer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "selection": {
                    "type": "string",
                    "enum": [
                      "all",
                      "collection",
                      "custom",
                      "tags"
                    ],
                    "description": "Which rule puts variants on the offer: all (every variant in the shop, minus exclusions), collection, custom (variants added by hand with add_variants) or tags. Changing it removes the current variants from the offer and refills them from the new rule; the previous rule's collection, tags and exclusions are cleared."
                  },
                  "shopify_collection_id": {
                    "type": "string",
                    "description": "The Shopify collection driving the variant list: its Shopify collection gid from resolve_entities (kind collection); never a title. Required when switching selection to collection."
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Product tags; products carrying any of them are on the offer. Replaces the list. Required when switching selection to tags."
                  },
                  "eligible_inventory_policy": {
                    "type": "string",
                    "enum": [
                      "continue_selling",
                      "all"
                    ],
                    "description": "continue_selling: STOQ turns on 'Continue selling when out of stock' for the rule's out-of-stock variants so all of them take preorders (editor: Track all products). all: only variants that already have 'Continue selling' on take preorders (editor: Only track products with 'Continue selling' enabled). Not for custom selection."
                  },
                  "excluded_shopify_variant_ids": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "description": "Variants held back: Shopify variant gids. Replaces the list; [] or null clears it. selection all or tags only."
                  },
                  "exclusion_tag": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Variants of products carrying this tag are held back. null clears it. selection all only."
                  },
                  "inventory_policy_for_removed_variants": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "CONTINUE",
                      "DENY",
                      null
                    ],
                    "description": "When selection changes: CONTINUE or DENY sets the inventory policy of the variants coming off the offer first; omit or null leaves it unchanged."
                  }
                }
              },
              "example": {
                "selection": "collection",
                "shopify_collection_id": "gid://shopify/Collection/482865234104"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/products/add_variants": {
      "post": {
        "operationId": "post_preorders_offers_id_products_add_variants",
        "summary": "Products Add Variants",
        "description": "Attach products and variants to a preorder offer, or re-run a collection, tag or all-products selection.\n\n**Note:** Custom selection: pass shopify_variant_ids, shopify_product_ids (every variant of the product) or shopify_collection_id (every product in the collection), all Shopify gids. Already-attached variants come back under already_present and variants Shopify has deleted under deleted_in_shopify. Collection, tag and all-products selections fill themselves: call with no ids to re-run the selection, as the dashboard's 'Add all products' does. Up to 250 variants attach during the call; above that a job does it; either way poll job.status_url until it is completed. skip_variants_in_market_offers: true leaves out variants that a market-specific offer owns. A custom add first runs the offer Products page's pre-flight check (the store-wide Products tab's 'Add to offer', /preorders/products/add_to_offer, runs none): when other offers already have the variants, 'Continue selling' is off where STOQ won't turn it on, or a sales channel can't sell preorders, nothing is added and it answers 409 with code preflight_issues, the issues under preflight and the resolve keys still needed under unresolved. Pass resolve with the Products tab's fix for each issue type (remove_from_conflicting_offers, enable_continue_selling, skip_sales_channel_products), or skip_preflight: true to add without the check. The answer lists what each fix did per variant under resolved.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "selection": "custom",
                  "shopify_collection_id": null,
                  "tags": [],
                  "eligible_inventory_policy": "all",
                  "excluded_shopify_variant_ids": [],
                  "exclusion_tag": null,
                  "variants_added": [
                    "gid://shopify/ProductVariant/47284734455864",
                    "gid://shopify/ProductVariant/47284734488632"
                  ],
                  "already_present": [
                    "gid://shopify/ProductVariant/47284734423096"
                  ],
                  "deleted_in_shopify": [],
                  "job": {
                    "job_id": "73a74948-2b57-4cc3-971f-2b441828c977",
                    "status_url": "/api/v2/external/preorders/product_variants/jobs/73a74948-2b57-4cc3-971f-2b441828c977"
                  }
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "add variants",
          "attach variants",
          "add products to offer",
          "link variants",
          "include variants",
          "add collection to offer",
          "add all products"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopify_variant_ids": {},
                  "shopify_product_ids": {},
                  "shopify_collection_id": {},
                  "skip_variants_in_market_offers": {},
                  "skip_preflight": {},
                  "resolve": {}
                }
              },
              "example": {
                "shopify_variant_ids": [
                  "gid://shopify/ProductVariant/47284734423096",
                  "gid://shopify/ProductVariant/47284734455864",
                  "gid://shopify/ProductVariant/47284734488632"
                ]
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/products/advance_batches": {
      "post": {
        "operationId": "post_preorders_offers_id_products_advance_batches",
        "summary": "Products Advance Batches",
        "description": "Move variants on a batch preorder offer to their next batch, as the Products table's 'Start next batch' does.\n\n**Note:** Batch offers only. shopify_variant_ids are Shopify variant gids; omit it for every variant that is in a batch. A variant on its last batch stops selling (inventory policy DENY). Ones not on the offer come back under not_attached.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "advance batch",
          "start next batch",
          "next wave",
          "advance variants to next batch"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopify_variant_ids": {}
                }
              },
              "example": {
                "shopify_variant_ids": [
                  "45000000001"
                ]
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/products/bulk_toggle_inventory_policy": {
      "post": {
        "operationId": "post_preorders_offers_id_products_bulk_toggle_inventory_policy",
        "summary": "Products Bulk Toggle Inventory Policy",
        "description": "Flip the Shopify inventory policy on variants attached to a preorder offer (CONTINUE or DENY). Pass the explicit shopify_variant_ids for a partial change; omitting shopify_variant_ids applies the policy to EVERY attached variant, so only omit it when the merchant asked for all of them.\n\n**Note:** Returns 202 with a job; Shopify is updated in batches, so poll job.status_url until it is completed. shopify_variant_ids are Shopify variant gids; ones not on this offer are skipped and returned in skipped_shopify_variant_ids, and the call fails with 422 if none are. With CONTINUE, variants at their quantity limit are left out, as the dashboard's 'Skip variants that have reached their quantity limit' (checked by default) does; skip_quantity_limited: false includes them.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "flip inventory policy",
          "toggle continue selling on variants",
          "set inventory policy for variants",
          "enable oversell on these variants",
          "disable oversell on these variants"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "policy": {
                    "enum": [
                      "CONTINUE",
                      "DENY"
                    ]
                  },
                  "shopify_variant_ids": {},
                  "skip_quantity_limited": {}
                },
                "required": [
                  "policy"
                ]
              },
              "example": {
                "policy": "CONTINUE",
                "shopify_variant_ids": [
                  "45000000001"
                ],
                "skip_quantity_limited": 5
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/products/remove_variants": {
      "post": {
        "operationId": "post_preorders_offers_id_products_remove_variants",
        "summary": "Products Remove Variants",
        "description": "Remove variants from a custom-selection preorder offer.\n\n**Note:** Custom selection only. Shopify is reset to the variants that stay before the local rows go, so a refused reset (502) changes nothing. inventory_policy: DENY first turns 'Continue selling' off on the removed variants; omit it to leave their policy as it is. shopify_variant_ids are Shopify variant gids; ones not on the offer come back under not_attached. Finishes before the response.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "remove variants",
          "detach variants",
          "remove products from offer",
          "unlink variants",
          "exclude variants"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopify_variant_ids": {},
                  "inventory_policy": {}
                }
              },
              "example": {
                "shopify_variant_ids": [
                  "45000000001"
                ],
                "inventory_policy": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/products/variants": {
      "get": {
        "operationId": "get_preorders_offers_id_products_variants",
        "summary": "Products Variants",
        "description": "List the variants on a preorder offer, as the offer's Products table shows them, paginated.\n\n**Note:** On an offer with batches on, each row has batch_progress (units sold and the limit enforced per batch, and the batch on sale now) and batch_limits (the variant's own per-batch limits). max_count is the variant's own limit, the one PATCH writes; quantity_limit is the read-only limit that applies (the batches' total on a batch offer, where max_count is kept but not enforced). search matches product title, variant title and SKU. sort is one of attached, title, title_asc, title_desc, created_asc, created_desc, added_asc, added_desc, sold_asc, sold_desc (default attached, the attach order; title is title_asc). product_status keeps products in active, draft, archived, unlisted (comma-separated); when a product's status can't be read from Shopify the filter is skipped and product_status_filter_skipped is true. limit_reached=true keeps variants at their quantity limit. product.status is the stored status; include_statuses=true reads the ones not stored yet from Shopify (products[].status when grouped). group_by=product returns products (shopify_product_id, title, image_url, variant_count, variants) instead of variants and pages by product, so a product's variants never split across pages: per_page counts products and meta has total_products and total_variants. exclude_discarded=true leaves out variants deleted from the catalog (discarded: true). include_inventory=true adds each row's live Shopify inventory_quantity, inventory_policy and product.tags. The filters inventory (zero_or_below | positive), inventory_policy (DENY | CONTINUE; lowercase is deprecated), product_tag and exclude_product_tag imply include_inventory and apply to each page after the read, so a page can hold fewer rows than per_page; keep paging while meta.page < meta.total_pages.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "list variants on offer",
          "variants attached to offer",
          "show offer variants",
          "attached variants",
          "offer variant list",
          "list products on offer",
          "search offer products"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "attached",
                "title",
                "title_asc",
                "title_desc",
                "created_asc",
                "created_desc",
                "added_asc",
                "added_desc",
                "sold_asc",
                "sold_desc"
              ]
            },
            "example": "attached"
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "product"
              ]
            },
            "example": "product"
          },
          {
            "name": "inventory",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "zero_or_below",
                "positive"
              ]
            },
            "example": "zero_or_below"
          },
          {
            "name": "inventory_policy",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "DENY",
                "CONTINUE",
                "deny",
                "continue"
              ]
            },
            "example": "DENY"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "product_status",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "limit_reached",
            "in": "query",
            "required": false,
            "schema": {},
            "example": 5
          },
          {
            "name": "include_statuses",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "exclude_discarded",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "include_inventory",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "product_tag",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "exclude_product_tag",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/preorders/offers/{id}/products/variants/{shopify_variant_id}": {
      "get": {
        "operationId": "get_preorders_offers_id_products_variants_shopify_variant_id",
        "summary": "Products Variants",
        "description": "Read one variant on a preorder offer: its row in the offer's Products table.\n\n**Note:** :shopify_variant_id is the Shopify variant gid (a numeric id also works).",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "show variant settings on offer",
          "view per-variant overrides",
          "get variant on offer",
          "variant settings"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "shopify_variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id_products_variants_shopify_variant_id",
        "summary": "Products Variants",
        "description": "Set one variant's Limit, Shipping and per-batch limits on a preorder offer, as the Products table edits them.\n\n**Note:** Deep partial: absent fields are unchanged. null clears shipping_text (the offer's text shows) and removes max_count. :shopify_variant_id is the variant's Shopify gid (a numeric id also works). market_overrides is no longer accepted; set per-market values on the offer instead.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "override variant settings",
          "set shipping text for variant",
          "set max count for variant",
          "per-variant overrides"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "shopify_variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shipping_text": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "max_count": {
                    "type": [
                      "null",
                      "integer"
                    ]
                  },
                  "batch_limits": {},
                  "batch_ship_texts": {}
                }
              },
              "example": {
                "shipping_text": "Preorder now",
                "max_count": 5,
                "batch_limits": 5,
                "batch_ship_texts": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/products/variants/{shopify_variant_id}/reset_count": {
      "post": {
        "operationId": "post_preorders_offers_id_products_variants_shopify_variant_id_reset_count",
        "summary": "Products Variants Reset Count",
        "description": "Reset one variant's preorder count to zero on this offer, as the Products table's Reset does.\n\n**Note:** :shopify_variant_id is the Shopify variant gid (a numeric id also works). Orders already placed on this offer are kept; they stop counting toward the limit. On a batch offer the variant returns to its first batch.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "reset variant count",
          "reset variant limit",
          "reset preorder count",
          "clear sold count"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "shopify_variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/offers/{id}/products/variants/{shopify_variant_id}/toggle_inventory_policy": {
      "post": {
        "operationId": "post_preorders_offers_id_products_variants_shopify_variant_id_toggle_inventory_policy",
        "summary": "Products Variants Toggle Inventory Policy",
        "description": "Set whether Shopify continues selling one attached preorder variant when it is out of stock (CONTINUE or DENY).\n\n**Note:** :shopify_variant_id is the Shopify variant gid (a numeric id also works). The Shopify write finishes before the response. skip_quantity_limited: true (CONTINUE only) refuses with 422 when the variant is at its quantity limit.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "toggle continue selling on variant",
          "enable oversell on variant",
          "disable oversell on variant",
          "set variant inventory policy"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "shopify_variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "policy": {
                    "enum": [
                      "CONTINUE",
                      "DENY"
                    ]
                  },
                  "skip_quantity_limited": {}
                },
                "required": [
                  "policy"
                ]
              },
              "example": {
                "policy": "CONTINUE",
                "skip_quantity_limited": 5
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/products/variants/bulk_update_settings": {
      "post": {
        "operationId": "post_preorders_offers_id_products_variants_bulk_update_settings",
        "summary": "Products Variants Bulk Update Settings",
        "description": "Set the same shipping text, max preorder count or per-batch limits on many variants of a preorder offer.\n\n**Note:** shopify_variant_ids is required (1 to 250 variant gids attached to the offer). The other fields follow PATCH /preorders/offers/:id/products/variants/:shopify_variant_id: absent is unchanged, null clears. Variants not attached to the offer are skipped and returned in skipped_shopify_variant_ids; the call fails with 422 if none are attached.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shipping_text": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "max_count": {
                    "type": [
                      "null",
                      "integer"
                    ]
                  },
                  "shopify_variant_ids": {},
                  "batch_limits": {},
                  "batch_ship_texts": {}
                }
              },
              "example": {
                "shipping_text": "Preorder now",
                "max_count": 5,
                "shopify_variant_ids": [
                  "45000000001"
                ],
                "batch_limits": 5,
                "batch_ship_texts": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/restore": {
      "post": {
        "operationId": "post_preorders_offers_id_restore",
        "summary": "Restore",
        "description": "Restore a discarded preorder offer.\n\n**Note:** The offer comes back off with no schedule. Variant attachments are not restored: add them again with add_variants, or set the products selection.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "undelete",
          "undiscard",
          "undo delete",
          "bring back"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/offers/{id}/schedule": {
      "post": {
        "operationId": "post_preorders_offers_id_schedule",
        "summary": "Schedule",
        "description": "Schedule a preorder offer: start only (off until then), end only (on until then) or both (on between them).\n\n**Note:** Send start, end or both; absent or null leaves that side open. Like the editor, start only or a window turns the offer off until the start, and end only turns it on until the end. Changing the kind of schedule turns the countdown off, reported in also_changed. When the countdown is on or the merchant also wants one, say before proposing that scheduling turns it off, and schedule first, then turn the countdown on. Use unschedule to remove the schedule.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "73a74948-2b57-4cc3-971f-2b441828c977",
                  "name": "Summer Sneaker Drop",
                  "internal_name": "summer-2026",
                  "availability": {
                    "schedule": "date_range",
                    "starts_at": "2026-07-01T09:00:00-04:00",
                    "ends_at": "2026-07-31T23:59:00-04:00",
                    "current_status": "scheduled"
                  }
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "set schedule",
          "schedule launch",
          "set start date",
          "set end date",
          "schedule offer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start": {},
                  "end": {}
                }
              },
              "example": {
                "start": "2026-07-01T09:00",
                "end": "2026-07-31T23:59"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/shipping": {
      "get": {
        "operationId": "get_preorders_offers_id_shipping",
        "summary": "Shipping",
        "description": "Read the shipping settings of a preorder offer: the shipping timeline text, delivery timing, fulfillment handling (hold, split or separate orders) and hold release.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get shipping",
          "show shipping",
          "view delivery",
          "view fulfillment",
          "view shipping text",
          "shipping settings"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id_shipping",
        "summary": "Shipping",
        "description": "Update any subset of the shipping settings on a preorder offer: the shipping timeline text, delivery timing, fulfillment handling (hold, split or separate orders) and hold release.\n\n**Note:** Deep partial: absent fields are unchanged, null clears. Settings the save changes on its own (the purchase option and payments when separate orders turns on, split fulfillments when delivery leaves asap) are listed in also_changed. reschedule_existing_orders: true is the editor's \"Reschedule existing orders to this date\" checkbox: after the save, every unfulfilled, uncancelled preorder on the offer has its scheduled fulfillments moved to the offer's ship date (ships_at), or to its own order date plus days_after_checkout, in the background. It needs delivery_timing exact_time after the save, can be sent alone to re-apply the current date, and does not email customers (send a shipping update from the orders endpoints for that). When sent, the response has rescheduled_orders_queued.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "timeline": {
                    "scope": "same",
                    "show_shipping_text": true,
                    "shipping_text": "Shipping: {{ date }}",
                    "variant_shipping_text": "ASAP"
                  },
                  "delivery_timing": "exact_time",
                  "ships_at": null,
                  "days_after_checkout": 30,
                  "fulfillment": {
                    "handling": "hold_all",
                    "hold_reason": "Waiting on stock",
                    "separate_orders": {
                      "grouping": "offer",
                      "number_format": "suffix",
                      "suffix": "SPLIT",
                      "hold_fulfillments": false,
                      "tag": "STOQ-split-order",
                      "transaction_gateway": "Prepaid",
                      "original_order_hold_tag": null,
                      "original_order_split_tag": null
                    }
                  },
                  "on_hold": {
                    "release_schedule": "manual",
                    "release_at": null,
                    "require_payment": false
                  }
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit shipping",
          "change shipping settings",
          "change delivery",
          "change fulfillment",
          "modify shipping",
          "enable fulfillment hold",
          "hold preorder fulfillments",
          "turn on fulfillment hold",
          "prevent shipping until released",
          "hold all fulfillments",
          "hold orders",
          "hold fulfillments",
          "disable fulfillment hold",
          "release fulfillments",
          "stop holding fulfillments",
          "turn off fulfillment hold",
          "let preorder ship immediately",
          "disable split",
          "disable split orders",
          "disable split fulfillments",
          "turn off order splitting",
          "stop separating preorders",
          "release fulfillment hold",
          "enable split",
          "turn on order splitting",
          "enable split orders",
          "separate preorder from regular",
          "enable split fulfillments",
          "enable split hold fulfillments",
          "hold split order fulfillments",
          "hold fulfillments on split order",
          "don't ship split order immediately",
          "disable split hold fulfillments",
          "release split order fulfillments",
          "ship split order immediately",
          "stop holding split order",
          "enable split sequential number",
          "sequential split order numbers",
          "number split orders sequentially",
          "sequential order name for split",
          "disable split sequential number",
          "no sequential split order numbers",
          "stop numbering split orders sequentially",
          "auto release holds",
          "automatically release holds",
          "release holds on a date",
          "stop releasing holds automatically",
          "release holds after payment",
          "set delivery asap",
          "ship asap",
          "set delivery to asap",
          "ship as soon as possible",
          "set delivery date",
          "ship on date",
          "set ship date",
          "set exact delivery date",
          "set delivery window",
          "ship within days",
          "set delivery in days",
          "set ship window",
          "fulfillment hold reason",
          "set shipping text",
          "change shipping text",
          "update shipping message",
          "set delivery text",
          "change PDP shipping line",
          "set split order suffix",
          "change split suffix",
          "set split order name suffix",
          "rename split order suffix",
          "change split order label text",
          "set split order tag",
          "change split tag",
          "set split order label",
          "set split transaction gateway",
          "set split payment gateway",
          "change split order gateway"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "timeline": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "scope": {
                        "type": "string",
                        "enum": [
                          "same",
                          "per_variant"
                        ],
                        "description": "same shows one shipping text for every product; per_variant uses each variant's own shipping text (set per variant)."
                      },
                      "show_shipping_text": {
                        "type": "boolean",
                        "description": "Show shipping timeline on the widget. Also turns the cart line-item property (advanced.cart_attributes.show_shipping) on or off when it changes, as the editor does; sending the current value changes nothing."
                      },
                      "shipping_text": {
                        "type": "string",
                        "description": "The line under the preorder button. Required while show_shipping_text is true."
                      }
                    }
                  },
                  "delivery_timing": {
                    "type": "string",
                    "enum": [
                      "asap",
                      "exact_time",
                      "unknown"
                    ],
                    "description": "Fulfillment status of preorder items: asap is Unfulfilled (ship now), exact_time is Scheduled (needs ships_at or days_after_checkout and the Shopify purchase option), unknown is On hold (no date promised). asap and unknown clear ships_at and days_after_checkout."
                  },
                  "ships_at": {
                    "type": "string",
                    "description": "Ship date: a date (2026-11-05), read as midnight in the shop time zone, or an ISO 8601 datetime (kept as that exact moment). Returned as the UTC datetime. Sending it alone makes delivery_timing exact_time on that date. Also sets timeline.variant_shipping_text (the {{ date }} value) to the date in the shop time zone, as the editor does: \"05 Nov 2026\"."
                  },
                  "days_after_checkout": {
                    "type": "integer",
                    "description": "Ship N days after checkout. Sending it alone makes delivery_timing exact_time with that delay; ships_at is then null. Also sets timeline.variant_shipping_text to \"N days after checkout\", as the editor does."
                  },
                  "fulfillment": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "handling": {
                        "type": "string",
                        "enum": [
                          "none",
                          "hold_all",
                          "split_fulfillments",
                          "separate_orders"
                        ],
                        "description": "none; hold_all holds every fulfillment; split_fulfillments ships in-stock items first (needs delivery_timing asap); separate_orders moves preorder items to their own order, which switches the Shopify purchase option off and resets partial payment, the discount and a Scheduled status (listed in also_changed)."
                      },
                      "hold_reason": {
                        "type": "string",
                        "description": "The hold reason shown in Shopify."
                      },
                      "separate_orders": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "grouping": {
                            "type": "string",
                            "enum": [
                              "variant",
                              "offer",
                              "ship_date"
                            ],
                            "description": "offer creates one separate order per offer; variant one per variant; ship_date one per ship date (batch or shipping text), which needs timeline.scope per_variant or batches on."
                          },
                          "number_format": {
                            "type": "string",
                            "enum": [
                              "sequential",
                              "suffix"
                            ],
                            "description": "sequential gives each separate order its own order number; suffix appends suffix to the original order name."
                          },
                          "suffix": {
                            "type": "string",
                            "description": "Suffix appended to the separate order name."
                          },
                          "hold_fulfillments": {
                            "type": "boolean",
                            "description": "Hold fulfillments on the separate order until they're released."
                          },
                          "tag": {
                            "type": "string",
                            "description": "Tag applied to the separate preorder order."
                          },
                          "transaction_gateway": {
                            "type": "string",
                            "description": "Payment gateway recorded on the separate order transaction."
                          },
                          "original_order_hold_tag": {
                            "type": "string",
                            "description": "Tag on the original order while it is being split. Removed once the split finishes."
                          },
                          "original_order_split_tag": {
                            "type": "string",
                            "description": "Tag on the original order after the preorder items move to a separate order."
                          }
                        }
                      }
                    }
                  },
                  "on_hold": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "release_schedule": {
                        "type": "string",
                        "enum": [
                          "scheduled",
                          "manual"
                        ],
                        "description": "scheduled releases held fulfillments on release_at; manual leaves them held."
                      },
                      "release_at": {
                        "type": "string",
                        "description": "ISO 8601. Required while release_schedule is scheduled."
                      },
                      "require_payment": {
                        "type": "boolean",
                        "description": "Only release once the balance is paid."
                      }
                    }
                  },
                  "reschedule_existing_orders": {
                    "type": "boolean",
                    "description": "true also moves the scheduled fulfillments of existing unfulfilled preorders on this offer to the ship date (ships_at, or each order date plus days_after_checkout), as the editor's \"Reschedule existing orders to this date\" checkbox does. Needs delivery_timing exact_time. No customer email."
                  },
                  "locale": {
                    "type": "string",
                    "description": "Language the translated fields are written in, such as 'fr' or 'pt-BR'. Omitted: the shop's default language. Untranslated fields ignore it."
                  }
                }
              },
              "example": {
                "days_after_checkout": 30,
                "fulfillment": {
                  "handling": "hold_all",
                  "hold_reason": "Waiting on stock"
                }
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/shipping/schedulable_orders": {
      "get": {
        "operationId": "get_preorders_offers_id_shipping_schedulable_orders",
        "summary": "Shipping Schedulable Orders",
        "description": "How many of a preorder offer's latest 100 orders have fulfillments that reschedule_existing_orders on PATCH /preorders/offers/:id/shipping would move: the unfulfilled, uncancelled ones. checked_count is how many orders were looked at.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "orders to reschedule",
          "how many orders will be rescheduled",
          "schedulable orders count"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/preorders/offers/{id}/translations": {
      "get": {
        "operationId": "get_preorders_offers_id_translations",
        "summary": "Translations",
        "description": "Read every translation override on a preorder offer, plus the full enumeration of translatable field paths, each field's default-locale source text, and every locale the shop has actually published (not just ones with an override already).",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get translations",
          "show translations",
          "view translations",
          "list translations",
          "view localized text",
          "i18n",
          "localization"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/preorders/offers/{id}/translations/clear_locale": {
      "post": {
        "operationId": "post_preorders_offers_id_translations_clear_locale",
        "summary": "Translations Clear Locale",
        "description": "Remove all translation overrides for one locale on a preorder offer.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "clear locale",
          "remove locale",
          "wipe locale",
          "drop translations for locale",
          "remove all translations for a language"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "locale": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "locale"
                ]
              },
              "example": {
                "locale": "fr"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/translations/reset_to_defaults": {
      "post": {
        "operationId": "post_preorders_offers_id_translations_reset_to_defaults",
        "summary": "Translations Reset To Defaults",
        "description": "Reset a preorder offer's storefront text for one language to STOQ's default translations, as the offer translator's \"Load default translations\" does.\n\n**Note:** locale is optional and defaults to the shop's default language. Overwrites the shipping text, billing title and description (the deposit or full-payment default, by the offer's payment type), discount text, badge, button and disclaimer text, preorder shipping text, quantity limit text, mixed cart error and the four countdown unit labels with STOQ's defaults in that language. Other translated fields and payment-option text are unchanged.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "reset translations",
          "load default translations",
          "reset all translations",
          "restore default text",
          "reset offer copy to defaults"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "locale": {}
                }
              },
              "example": {
                "locale": "fr"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/translations/set": {
      "post": {
        "operationId": "post_preorders_offers_id_translations_set",
        "summary": "Translations Set",
        "description": "Set a single translation override (one locale, one field) on a preorder offer.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "set translation",
          "add translation",
          "translate field",
          "localize a field",
          "set localized text"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "locale": {
                    "type": "string",
                    "minLength": 1
                  },
                  "field": {},
                  "value": {}
                },
                "required": [
                  "locale",
                  "field"
                ]
              },
              "example": {
                "locale": "fr",
                "field": "string",
                "value": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/translations/set_many": {
      "post": {
        "operationId": "post_preorders_offers_id_translations_set_many",
        "summary": "Translations Set Many",
        "description": "Set many translation overrides for one locale on a preorder offer, atomically.\n\n**Note:** All-or-nothing. Pre-validates every field path before writing.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "set many translations",
          "translate offer",
          "bulk translate",
          "localize offer",
          "translate to french",
          "add translations"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "locale": {
                    "type": "string",
                    "minLength": 1
                  },
                  "translations": {}
                },
                "required": [
                  "locale",
                  "translations"
                ]
              },
              "example": {
                "locale": "fr",
                "translations": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/translations/unset": {
      "post": {
        "operationId": "post_preorders_offers_id_translations_unset",
        "summary": "Translations Unset",
        "description": "Remove a translation override (one locale, one field) from a preorder offer.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "unset translation",
          "remove translation",
          "clear translation",
          "delete localized text",
          "remove localized override"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "locale": {
                    "type": "string",
                    "minLength": 1
                  },
                  "field": {}
                },
                "required": [
                  "locale",
                  "field"
                ]
              },
              "example": {
                "locale": "fr",
                "field": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/{id}/unschedule": {
      "post": {
        "operationId": "post_preorders_offers_id_unschedule",
        "summary": "Unschedule",
        "description": "Remove the schedule from a preorder offer. A live offer stays on; any other stays off.\n\n**Note:** Turns the countdown off when it was on, as the editor does; reported in also_changed.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "clear schedule",
          "remove schedule",
          "no schedule",
          "unschedule offer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/offers/{id}/widget": {
      "get": {
        "operationId": "get_preorders_offers_id_widget",
        "summary": "Widget",
        "description": "Read the widget configuration for a preorder offer.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get widget",
          "show widget",
          "view button settings",
          "view badge settings",
          "view disclaimer settings",
          "preorder ui"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_offers_id_widget",
        "summary": "Widget",
        "description": "Update any subset of the widget configuration on a preorder offer.\n\n**Note:** Deep partial: absent fields are unchanged. Text can be cleared with null. Button colors only show with button.custom_colors_enabled: true, so send both.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "button": {
                    "button_text": "Reserve Now",
                    "custom_colors_enabled": true,
                    "text_color": "#FFFFFF",
                    "background_color": "#1a1a1a"
                  },
                  "disclaimer": {
                    "show_disclaimer": true,
                    "disclaimer_text": "Expected to ship by August 2026",
                    "text_color": "#000000",
                    "background_color": "#FFFFFF",
                    "border_radius": 4
                  },
                  "badge": {
                    "show_badge": true,
                    "badge_text": "Pre-Order",
                    "text_color": "#000000",
                    "background_color": "#FFFFFF"
                  }
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit widget",
          "change widget settings",
          "modify widget",
          "update preorder ui",
          "enable badge",
          "show badge",
          "turn on badge",
          "make badge visible",
          "disable badge",
          "hide badge",
          "turn off badge",
          "remove badge",
          "enable disclaimer",
          "show disclaimer",
          "turn on disclaimer",
          "show fine print",
          "show shipping notice",
          "disable disclaimer",
          "hide disclaimer",
          "turn off disclaimer",
          "hide fine print",
          "remove shipping notice",
          "remove disclaimer",
          "enable custom button colors",
          "use custom button colors",
          "turn on button colors",
          "apply custom colors",
          "disable custom button colors",
          "use theme button colors",
          "turn off button colors",
          "revert to theme colors",
          "change badge colors",
          "set badge color",
          "customize badge colors",
          "change badge background",
          "change badge text",
          "set badge label",
          "rename badge",
          "change preorder badge text",
          "update badge text",
          "change button colors",
          "set button color",
          "customize button colors",
          "change button text",
          "rename button",
          "set button label",
          "change preorder button label",
          "update button text",
          "change disclaimer colors",
          "set disclaimer style",
          "style the disclaimer",
          "set disclaimer border radius",
          "change disclaimer background",
          "change disclaimer text",
          "set disclaimer text",
          "edit disclaimer",
          "change disclaimer message",
          "set shipping disclaimer"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "button": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "button_text": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Button text -- the preorder call-to-action label."
                      },
                      "text_color": {
                        "type": "string",
                        "pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
                        "description": "The button's Text color. Hex. Only shows when button.custom_colors_enabled is true; send it too."
                      },
                      "background_color": {
                        "type": "string",
                        "pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
                        "description": "The button's Background color. Hex. Only shows when button.custom_colors_enabled is true; send it too."
                      },
                      "custom_colors_enabled": {
                        "type": "boolean",
                        "description": "Use custom colors for button. False falls back to the theme's own button colors."
                      }
                    }
                  },
                  "disclaimer": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "show_disclaimer": {
                        "type": "boolean",
                        "description": "Add disclaimer -- shows or hides the disclaimer line under the button."
                      },
                      "disclaimer_text": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Disclaimer -- the line shown under the preorder button."
                      },
                      "text_color": {
                        "type": "string",
                        "pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
                        "description": "The disclaimer's Text color. Hex."
                      },
                      "background_color": {
                        "type": "string",
                        "pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
                        "description": "The disclaimer's Background color. Hex."
                      },
                      "border_radius": {
                        "type": "integer",
                        "description": "The disclaimer's Border radius in pixels.",
                        "minimum": 0
                      }
                    }
                  },
                  "badge": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "show_badge": {
                        "type": "boolean",
                        "description": "Add badge -- shows or hides the preorder badge. On product pages it sits after the price by default. On home, collection and search pages it shows on the product card, only where Preorder pages turns the Preorder button on."
                      },
                      "badge_text": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Badge -- the label printed on the preorder badge."
                      },
                      "text_color": {
                        "type": "string",
                        "pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
                        "description": "The badge's Text color. Hex."
                      },
                      "background_color": {
                        "type": "string",
                        "pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$",
                        "description": "The badge's Background color. Hex."
                      }
                    }
                  },
                  "locale": {
                    "type": "string",
                    "description": "Language the translated fields are written in, such as 'fr' or 'pt-BR'. Omitted: the shop's default language. Untranslated fields ignore it."
                  }
                }
              },
              "example": {
                "button": {
                  "button_text": "Reserve Now"
                }
              }
            }
          }
        }
      }
    },
    "/preorders/offers/bulk_disable": {
      "post": {
        "operationId": "post_preorders_offers_bulk_disable",
        "summary": "Bulk Disable",
        "description": "Turn many preorder offers off at once, as the Offers list's bulk Disable does. Optionally flip the attached variants' inventory policy back to DENY.\n\n**Note:** ids are offer ids. Each offer is turned off as the dashboard's bulk Disable does: a dated offer has its schedule removed. update_inventory_policy: true also sets every attached variant of the STOQ-inventory offers back to \"Stop selling when out of stock\" (DENY), as the bulk Disable dialog does; offers with more than 250 variants are flipped in the background.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk disable offers",
          "disable offers",
          "turn off offers",
          "pause offers",
          "disable several offers",
          "turn these offers off",
          "disable all offers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {},
                  "update_inventory_policy": {}
                }
              },
              "example": {
                "ids": "string",
                "update_inventory_policy": "2026-07-01T00:00:00Z"
              }
            }
          }
        }
      }
    },
    "/preorders/offers/bulk_enable": {
      "post": {
        "operationId": "post_preorders_offers_bulk_enable",
        "summary": "Bulk Enable",
        "description": "Turn many preorder offers on at once, as the Offers list's bulk Enable does. Optionally flip the attached variants' inventory policy to CONTINUE.\n\n**Note:** ids are offer ids. Each offer is turned on as the dashboard's bulk Enable does: a scheduled offer starts now (its start date is cleared, an end date is kept). An offer that cannot be turned on (for example the plan's offer limit) is counted in failed with its reason in failed_errors; the others still turn on. update_inventory_policy: true also sets every attached variant of the STOQ-inventory offers to \"Continue selling when out of stock\", as the bulk Enable dialog's Continue selling choice does; offers with more than 250 variants are flipped in the background.",
        "tags": [
          "Preorders · Offers"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk enable offers",
          "enable offers",
          "turn on offers",
          "enable several offers",
          "activate offers",
          "turn these offers on",
          "enable all offers"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {},
                  "update_inventory_policy": {}
                }
              },
              "example": {
                "ids": "string",
                "update_inventory_policy": "2026-07-01T00:00:00Z"
              }
            }
          }
        }
      }
    },
    "/preorders/orders": {
      "get": {
        "operationId": "get_preorders_orders",
        "summary": "List",
        "description": "List preorder orders in this shop, paginated. search matches order number/name, customer name, email, a Shopify order id (10+ digits), an order gid (gid://shopify/Order/<id>), or a Shopify admin order URL.\n\n**Note:** Filters match the Reports > Preorders > Orders filters and combine with AND. Comma-separated: financial_status and fulfillment_status (Shopify values), preorder_fulfillment_status (on_hold, scheduled, open), cancelled_status (cancelled or not_cancelled), payment_collection_status (latest collection attempt: failed, success, unknown), offer_id (our offer ids, any state), shopify_variant_id and shopify_product_id (gids; a product means its variants). vendors is an array of vendor names, matched on the preorder lines only. A bare from/to date is that whole day in the shop's time zone.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "list preorder orders",
          "show all preorder orders",
          "preorder orders",
          "list orders"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "financial_status",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "fulfillment_status",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "preorder_fulfillment_status",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "cancelled_status",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "payment_collection_status",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "offer_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "shopify_variant_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "45000000001"
          },
          {
            "name": "shopify_product_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "78000000001"
          },
          {
            "name": "vendors",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/preorders/orders/{id}": {
      "get": {
        "operationId": "get_preorders_orders_id",
        "summary": "Read",
        "description": "Read an order's full representation: payments, fulfillment, notifications, tags, attributed offers and line items.\n\n**Note:** Payments report only synced/recorded values (null when unknown). `tags.tags` is read live from Shopify and is null when Shopify can't be reached. Each section also has its own URL, e.g. /preorders/orders/:id/payments.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "show preorder order",
          "get order",
          "look up order",
          "view preorder order",
          "order tags",
          "order labels",
          "what tags does the order have"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/preorders/orders/{id}/collect_payment": {
      "post": {
        "operationId": "post_preorders_orders_id_collect_payment",
        "summary": "Collect Payment",
        "description": "Collect the order's outstanding balance now by charging the customer's saved payment method. Pass `line_item_ids` to collect the full price of those products, or `amount` to collect part of the balance (both are Shopify Plus only).\n\n**Note:** Matches the dashboard actions Collect payment and Collect partial payment (an amount, or chosen products). With neither `amount` nor `line_item_ids` the full outstanding balance is charged, on any plan. `line_item_ids` alone charges the sum of those lines' price times quantity plus tax; with `amount` too, `amount` is charged and the lines are recorded. A bundle line stands for its components. An amount above the outstanding balance, a line not on this order, or a shop not on Shopify Plus returns 422. The charge is created on the customer's saved payment method and Shopify settles it asynchronously: `outcome.payment_reference_id` identifies it and payments.last_payment_attempt shows its state, with `shopify_line_item_ids` for a charge chosen by product. Fails (422) when nothing is outstanding, there is no saved payment method or Shopify declines. send_notifications false suppresses the customer email sent when a charge fails.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "collect payment",
          "capture payment",
          "charge the balance now",
          "take the remaining payment",
          "collect outstanding balance",
          "collect partial payment",
          "charge part of the balance",
          "collect payment for these products",
          "charge for one item"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "send_notifications": {},
                  "amount": {},
                  "line_item_ids": {}
                }
              },
              "example": {
                "send_notifications": "string",
                "amount": "string",
                "line_item_ids": [
                  "string"
                ]
              }
            }
          }
        }
      }
    },
    "/preorders/orders/{id}/fulfillment": {
      "get": {
        "operationId": "get_preorders_orders_id_fulfillment",
        "summary": "Fulfillment",
        "description": "Read an order's fulfillment: its Shopify fulfillment status and that of its preorder items, the hold note, split orders and each attributed offer's fulfillment handling.\n\n**Note:** hold_reason_note is the note Shopify got with the hold, from the offer that caused it; change it on the offer.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "order fulfillment",
          "shipping",
          "hold state",
          "fulfillment hold",
          "is the order on hold",
          "split orders"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/preorders/orders/{id}/hold_fulfillments": {
      "post": {
        "operationId": "post_preorders_orders_id_hold_fulfillments",
        "summary": "Hold Fulfillments",
        "description": "Put all of the order's fulfillment orders on hold, with an optional reason.\n\n**Note:** Matches the dashboard action Hold fulfillments and the Flow action Hold all fulfillments. Every open or scheduled fulfillment order is held, preorder or not; one this app already holds is skipped. reason_notes is shown on the hold in Shopify; without it the default hold note is used. outcome lists each fulfillment order held, skipped or rejected. Fails (422) when nothing could be held.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "hold fulfillments",
          "hold order",
          "put order on hold",
          "stop order from shipping",
          "hold all fulfillments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason_notes": {}
                }
              },
              "example": {
                "reason_notes": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/{id}/notifications": {
      "get": {
        "operationId": "get_preorders_orders_id_notifications",
        "summary": "Notifications",
        "description": "Read which customer messages were sent for an order: confirmation email and SMS, shipping update and payment link, with counts and when each was last sent.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "order notifications",
          "was the confirmation sent",
          "did the customer get an email",
          "was the sms sent"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/preorders/orders/{id}/open_scheduled_fulfillments": {
      "post": {
        "operationId": "post_preorders_orders_id_open_scheduled_fulfillments",
        "summary": "Open Scheduled Fulfillments",
        "description": "Open the order's scheduled fulfillment orders for immediate fulfillment.\n\n**Note:** Matches the merchant dashboard action Open scheduled fulfillments. outcome lists each fulfillment order Shopify opened or rejected.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "open scheduled fulfillments",
          "open order"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/orders/{id}/payments": {
      "get": {
        "operationId": "get_preorders_orders_id_payments",
        "summary": "Payments",
        "description": "Read an order's payments: amount paid, balance outstanding, due date and payment attempts.\n\n**Note:** Only synced/recorded values; null when unknown.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "order payments",
          "deposit",
          "balance",
          "remaining balance",
          "was the balance collected",
          "payment attempts",
          "why did the payment fail"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/preorders/orders/{id}/release": {
      "post": {
        "operationId": "post_preorders_orders_id_release",
        "summary": "Release",
        "description": "Release the order's fulfillment holds without applying offer-configured order tags.\n\n**Note:** Matches the merchant dashboard action Release \"On hold\" fulfillments. outcome lists each fulfillment order Shopify released or rejected.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "release order",
          "release fulfillments",
          "let it ship",
          "unhold order",
          "open fulfillments"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/orders/{id}/reschedule_fulfillment": {
      "post": {
        "operationId": "post_preorders_orders_id_reschedule_fulfillment",
        "summary": "Reschedule Fulfillment",
        "description": "Change the fulfillment date for the order's scheduled fulfillment orders.\n\n**Note:** Accepts the same ISO 8601 timestamp as the merchant dashboard. send_shipping_update emails the customer a shipping update, like the modal's Send customers a shipping update, only when a scheduled fulfillment moved. subject and header default to the template text. description is sent as given; left out, it is what the modal prefills: \"Your preorder is now scheduled to ship on {date}.\" (the fulfill_at UTC date in the shop's app language) followed by the template text. outcome.notified says whether the email went out (as the dashboard reports it).",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "reschedule fulfillment",
          "change fulfillment date"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fulfill_at": {
                    "type": "string",
                    "minLength": 1
                  },
                  "send_shipping_update": {},
                  "subject": {},
                  "header": {},
                  "description": {}
                },
                "required": [
                  "fulfill_at"
                ]
              },
              "example": {
                "fulfill_at": "2026-07-01T00:00:00Z",
                "send_shipping_update": "2026-07-01T00:00:00Z",
                "subject": "string",
                "header": "string",
                "description": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/{id}/reschedule_payment": {
      "post": {
        "operationId": "post_preorders_orders_id_reschedule_payment",
        "summary": "Reschedule Payment",
        "description": "Change the due date for the order's remaining-balance payment schedule.\n\n**Note:** Accepts a calendar date (YYYY-MM-DD) and changes the payment schedule only; it does not charge or refund money.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "reschedule payment",
          "change payment due date"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "due_at": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "due_at"
                ]
              },
              "example": {
                "due_at": "2026-07-01T00:00:00Z"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/{id}/send_confirmation": {
      "post": {
        "operationId": "post_preorders_orders_id_send_confirmation",
        "summary": "Send Confirmation",
        "description": "Send the preorder confirmation email to the customer again.\n\n**Note:** Matches the dashboard action Send confirmation email. Fails (422) when the email was not sent.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "send confirmation",
          "resend confirmation email",
          "resend order confirmation",
          "email the confirmation again"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/orders/{id}/send_shipping_update": {
      "post": {
        "operationId": "post_preorders_orders_id_send_shipping_update",
        "summary": "Send Shipping Update",
        "description": "Email the customer a shipping update for the preorder.\n\n**Note:** Matches the dashboard action Send shipping update. subject, header and description override the template text for this send. Not sent for cancelled or refunded orders (422).",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "send shipping update",
          "email shipping update",
          "notify customer about shipping",
          "send delivery update"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "subject": {},
                  "header": {},
                  "description": {}
                }
              },
              "example": {
                "subject": "string",
                "header": "string",
                "description": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/{id}/send_sms_confirmation": {
      "post": {
        "operationId": "post_preorders_orders_id_send_sms_confirmation",
        "summary": "Send Sms Confirmation",
        "description": "Send the preorder confirmation SMS to the customer again.\n\n**Note:** Matches the dashboard action Send confirmation SMS. Fails (422) with the reason when SMS is not enabled, the customer unsubscribed, or delivery failed.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "send sms confirmation",
          "resend confirmation sms",
          "text the confirmation again",
          "resend order sms"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/orders/{id}/split_fulfillment_orders": {
      "post": {
        "operationId": "post_preorders_orders_id_split_fulfillment_orders",
        "summary": "Split Fulfillment Orders",
        "description": "Split the order's preorder items into their own fulfillment orders.\n\n**Note:** Matches the dashboard action Split fulfillment orders and the Flow action Split fulfillment orders. Runs whether or not the offer splits automatically, but only moves items on offers with split fulfillments turned on. outcome lists each fulfillment order split or rejected; an order with nothing to split returns an empty list. Refused (409) for a cancelled or fulfilled order. Fails (422) when the order has no offer or a split fails.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "split fulfillment orders",
          "split fulfillments",
          "split order fulfillments",
          "separate preorder items for fulfillment"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/orders/{id}/timeline": {
      "get": {
        "operationId": "get_preorders_orders_id_timeline",
        "summary": "Timeline",
        "description": "Read an order's timeline: every event STOQ recorded for it, newest first, as the dashboard order page shows it.\n\n**Note:** Covers back-in-stock orders too.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "order timeline",
          "order history",
          "order activity log",
          "what happened to this order",
          "order events"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/preorders/orders/bulk_collect_payment": {
      "post": {
        "operationId": "post_preorders_orders_bulk_collect_payment",
        "summary": "Bulk Collect Payment",
        "description": "Collect the outstanding balance of many preorder orders now (up to 1000 order_ids, or apply_to_all with the order list filters), charging each customer's saved payment method.\n\n**Note:** Matches the dashboard bulk action Collect payment. Each order is charged its full outstanding balance; paid and cancelled orders are skipped and reported failed. Shopify settles charges asynchronously, so a succeeded order means the charge was created; its payments.last_payment_attempt shows the final state. send_notifications false suppresses the customer email sent when a charge fails. Poll status_url for per-order results.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk collect payment",
          "collect payment for many orders",
          "charge balances in bulk",
          "capture payments in bulk",
          "collect all outstanding balances"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "search": {},
                  "financial_status": {},
                  "fulfillment_status": {},
                  "preorder_fulfillment_status": {},
                  "cancelled_status": {},
                  "payment_collection_status": {},
                  "offer_id": {},
                  "shopify_variant_id": {},
                  "shopify_product_id": {},
                  "vendors": {},
                  "customer_id": {},
                  "from": {},
                  "to": {},
                  "order_ids": {},
                  "apply_to_all": {},
                  "send_notifications": {}
                }
              },
              "example": {
                "search": "string",
                "financial_status": "string",
                "fulfillment_status": "string",
                "preorder_fulfillment_status": "string",
                "cancelled_status": "string",
                "payment_collection_status": "string",
                "offer_id": "string",
                "shopify_variant_id": "45000000001",
                "shopify_product_id": "78000000001",
                "vendors": "string",
                "customer_id": "string",
                "from": "string",
                "to": "string",
                "order_ids": [
                  "string"
                ],
                "apply_to_all": "string",
                "send_notifications": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/bulk_hold_fulfillments": {
      "post": {
        "operationId": "post_preorders_orders_bulk_hold_fulfillments",
        "summary": "Bulk Hold Fulfillments",
        "description": "Put the fulfillment orders of many preorder orders on hold (up to 1000 order_ids, or apply_to_all with the order list filters).\n\n**Note:** Matches the dashboard bulk action Hold fulfillments. Cancelled and fulfilled orders, and orders with nothing to hold, are reported failed. Poll status_url for per-order results.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk hold fulfillments",
          "hold many orders",
          "bulk hold orders",
          "hold these orders"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "search": {},
                  "financial_status": {},
                  "fulfillment_status": {},
                  "preorder_fulfillment_status": {},
                  "cancelled_status": {},
                  "payment_collection_status": {},
                  "offer_id": {},
                  "shopify_variant_id": {},
                  "shopify_product_id": {},
                  "vendors": {},
                  "customer_id": {},
                  "from": {},
                  "to": {},
                  "order_ids": {},
                  "apply_to_all": {},
                  "reason_notes": {}
                }
              },
              "example": {
                "search": "string",
                "financial_status": "string",
                "fulfillment_status": "string",
                "preorder_fulfillment_status": "string",
                "cancelled_status": "string",
                "payment_collection_status": "string",
                "offer_id": "string",
                "shopify_variant_id": "45000000001",
                "shopify_product_id": "78000000001",
                "vendors": "string",
                "customer_id": "string",
                "from": "string",
                "to": "string",
                "order_ids": [
                  "string"
                ],
                "apply_to_all": "string",
                "reason_notes": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/bulk_open_scheduled_fulfillments": {
      "post": {
        "operationId": "post_preorders_orders_bulk_open_scheduled_fulfillments",
        "summary": "Bulk Open Scheduled Fulfillments",
        "description": "Open the scheduled fulfillment orders of many preorder orders (up to 1000 order_ids, or apply_to_all with the order list filters).\n\n**Note:** Matches the dashboard bulk action Open scheduled fulfillments. Poll status_url for per-order results.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk open scheduled fulfillments",
          "open many orders",
          "bulk open orders",
          "open fulfillments in bulk"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "search": {},
                  "financial_status": {},
                  "fulfillment_status": {},
                  "preorder_fulfillment_status": {},
                  "cancelled_status": {},
                  "payment_collection_status": {},
                  "offer_id": {},
                  "shopify_variant_id": {},
                  "shopify_product_id": {},
                  "vendors": {},
                  "customer_id": {},
                  "from": {},
                  "to": {},
                  "order_ids": {},
                  "apply_to_all": {}
                }
              },
              "example": {
                "search": "string",
                "financial_status": "string",
                "fulfillment_status": "string",
                "preorder_fulfillment_status": "string",
                "cancelled_status": "string",
                "payment_collection_status": "string",
                "offer_id": "string",
                "shopify_variant_id": "45000000001",
                "shopify_product_id": "78000000001",
                "vendors": "string",
                "customer_id": "string",
                "from": "string",
                "to": "string",
                "order_ids": [
                  "string"
                ],
                "apply_to_all": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/bulk_release": {
      "post": {
        "operationId": "post_preorders_orders_bulk_release",
        "summary": "Bulk Release",
        "description": "Release fulfillment holds on many preorder orders (up to 1000 order_ids, or apply_to_all with the order list filters).\n\n**Note:** Matches the dashboard bulk action Release \"On hold\" fulfillments. Poll status_url for per-order results.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk release",
          "release many orders",
          "batch release",
          "release these orders"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "search": {},
                  "financial_status": {},
                  "fulfillment_status": {},
                  "preorder_fulfillment_status": {},
                  "cancelled_status": {},
                  "payment_collection_status": {},
                  "offer_id": {},
                  "shopify_variant_id": {},
                  "shopify_product_id": {},
                  "vendors": {},
                  "customer_id": {},
                  "from": {},
                  "to": {},
                  "order_ids": {},
                  "apply_to_all": {}
                }
              },
              "example": {
                "search": "string",
                "financial_status": "string",
                "fulfillment_status": "string",
                "preorder_fulfillment_status": "string",
                "cancelled_status": "string",
                "payment_collection_status": "string",
                "offer_id": "string",
                "shopify_variant_id": "45000000001",
                "shopify_product_id": "78000000001",
                "vendors": "string",
                "customer_id": "string",
                "from": "string",
                "to": "string",
                "order_ids": [
                  "string"
                ],
                "apply_to_all": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/bulk_reschedule_fulfillment": {
      "post": {
        "operationId": "post_preorders_orders_bulk_reschedule_fulfillment",
        "summary": "Bulk Reschedule Fulfillment",
        "description": "Change the fulfillment date of many preorder orders (up to 1000 order_ids, or apply_to_all with the order list filters).\n\n**Note:** Matches the dashboard bulk action Reschedule fulfillment. Pass fulfill_at (one date for all) or anchor_days (each order created_at plus N days). send_shipping_update emails each customer whose scheduled fulfillment moved, as the modal does. subject and header default to the template text. description is sent as given; left out, it is what the modal prefills: \"Your preorder is now scheduled to ship on {date}.\" (each order's new fulfillment UTC date in the shop's app language) followed by the template text. Poll status_url for per-order results.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk reschedule fulfillment",
          "change fulfillment date for many orders",
          "reschedule many orders",
          "move fulfillment dates in bulk"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "search": {},
                  "financial_status": {},
                  "fulfillment_status": {},
                  "preorder_fulfillment_status": {},
                  "cancelled_status": {},
                  "payment_collection_status": {},
                  "offer_id": {},
                  "shopify_variant_id": {},
                  "shopify_product_id": {},
                  "vendors": {},
                  "customer_id": {},
                  "from": {},
                  "to": {},
                  "order_ids": {},
                  "apply_to_all": {},
                  "fulfill_at": {},
                  "anchor_days": {},
                  "send_shipping_update": {},
                  "subject": {},
                  "header": {},
                  "description": {}
                }
              },
              "example": {
                "search": "string",
                "financial_status": "string",
                "fulfillment_status": "string",
                "preorder_fulfillment_status": "string",
                "cancelled_status": "string",
                "payment_collection_status": "string",
                "offer_id": "string",
                "shopify_variant_id": "45000000001",
                "shopify_product_id": "78000000001",
                "vendors": "string",
                "customer_id": "string",
                "from": "string",
                "to": "string",
                "order_ids": [
                  "string"
                ],
                "apply_to_all": "string",
                "fulfill_at": "2026-07-01T00:00:00Z",
                "anchor_days": "string",
                "send_shipping_update": "2026-07-01T00:00:00Z",
                "subject": "string",
                "header": "string",
                "description": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/bulk_reschedule_payment": {
      "post": {
        "operationId": "post_preorders_orders_bulk_reschedule_payment",
        "summary": "Bulk Reschedule Payment",
        "description": "Change the remaining-balance due date of many preorder orders (up to 1000 order_ids, or apply_to_all with the order list filters).\n\n**Note:** Matches the dashboard bulk action Reschedule payment. Changes the schedule only; nothing is charged. Poll status_url for per-order results.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk reschedule payment",
          "change payment due date for many orders",
          "move payment dates in bulk",
          "reschedule many payments"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "search": {},
                  "financial_status": {},
                  "fulfillment_status": {},
                  "preorder_fulfillment_status": {},
                  "cancelled_status": {},
                  "payment_collection_status": {},
                  "offer_id": {},
                  "shopify_variant_id": {},
                  "shopify_product_id": {},
                  "vendors": {},
                  "customer_id": {},
                  "from": {},
                  "to": {},
                  "order_ids": {},
                  "apply_to_all": {},
                  "due_at": {}
                }
              },
              "example": {
                "search": "string",
                "financial_status": "string",
                "fulfillment_status": "string",
                "preorder_fulfillment_status": "string",
                "cancelled_status": "string",
                "payment_collection_status": "string",
                "offer_id": "string",
                "shopify_variant_id": "45000000001",
                "shopify_product_id": "78000000001",
                "vendors": "string",
                "customer_id": "string",
                "from": "string",
                "to": "string",
                "order_ids": [
                  "string"
                ],
                "apply_to_all": "string",
                "due_at": "2026-07-01T00:00:00Z"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/bulk_send_confirmation": {
      "post": {
        "operationId": "post_preorders_orders_bulk_send_confirmation",
        "summary": "Bulk Send Confirmation",
        "description": "Send the preorder confirmation email again to many customers (up to 1000 order_ids, or apply_to_all with the order list filters).\n\n**Note:** Matches the dashboard bulk action Send confirmation email. Poll status_url for per-order results.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk send confirmation",
          "resend confirmations",
          "send confirmation emails in bulk",
          "email many customers their confirmation"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "search": {},
                  "financial_status": {},
                  "fulfillment_status": {},
                  "preorder_fulfillment_status": {},
                  "cancelled_status": {},
                  "payment_collection_status": {},
                  "offer_id": {},
                  "shopify_variant_id": {},
                  "shopify_product_id": {},
                  "vendors": {},
                  "customer_id": {},
                  "from": {},
                  "to": {},
                  "order_ids": {},
                  "apply_to_all": {}
                }
              },
              "example": {
                "search": "string",
                "financial_status": "string",
                "fulfillment_status": "string",
                "preorder_fulfillment_status": "string",
                "cancelled_status": "string",
                "payment_collection_status": "string",
                "offer_id": "string",
                "shopify_variant_id": "45000000001",
                "shopify_product_id": "78000000001",
                "vendors": "string",
                "customer_id": "string",
                "from": "string",
                "to": "string",
                "order_ids": [
                  "string"
                ],
                "apply_to_all": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/bulk_send_shipping_update": {
      "post": {
        "operationId": "post_preorders_orders_bulk_send_shipping_update",
        "summary": "Bulk Send Shipping Update",
        "description": "Email a shipping update to many preorder customers (up to 1000 order_ids, or apply_to_all with the order list filters).\n\n**Note:** Matches the dashboard bulk action Send shipping update. Cancelled and refunded orders are skipped and reported failed. Poll status_url for per-order results.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk send shipping update",
          "email shipping updates",
          "send shipping updates in bulk",
          "notify many customers about shipping"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "search": {},
                  "financial_status": {},
                  "fulfillment_status": {},
                  "preorder_fulfillment_status": {},
                  "cancelled_status": {},
                  "payment_collection_status": {},
                  "offer_id": {},
                  "shopify_variant_id": {},
                  "shopify_product_id": {},
                  "vendors": {},
                  "customer_id": {},
                  "from": {},
                  "to": {},
                  "order_ids": {},
                  "apply_to_all": {},
                  "subject": {},
                  "header": {},
                  "description": {}
                }
              },
              "example": {
                "search": "string",
                "financial_status": "string",
                "fulfillment_status": "string",
                "preorder_fulfillment_status": "string",
                "cancelled_status": "string",
                "payment_collection_status": "string",
                "offer_id": "string",
                "shopify_variant_id": "45000000001",
                "shopify_product_id": "78000000001",
                "vendors": "string",
                "customer_id": "string",
                "from": "string",
                "to": "string",
                "order_ids": [
                  "string"
                ],
                "apply_to_all": "string",
                "subject": "string",
                "header": "string",
                "description": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/bulk_split_fulfillment_orders": {
      "post": {
        "operationId": "post_preorders_orders_bulk_split_fulfillment_orders",
        "summary": "Bulk Split Fulfillment Orders",
        "description": "Split the preorder items of many preorder orders into their own fulfillment orders (up to 1000 order_ids, or apply_to_all with the order list filters).\n\n**Note:** Matches the dashboard bulk action Split fulfillment orders. Orders without an offer, or whose split fails, are reported failed. Poll status_url for per-order results.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "bulk split fulfillment orders",
          "split many orders",
          "bulk split fulfillments",
          "split these orders"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "search": {},
                  "financial_status": {},
                  "fulfillment_status": {},
                  "preorder_fulfillment_status": {},
                  "cancelled_status": {},
                  "payment_collection_status": {},
                  "offer_id": {},
                  "shopify_variant_id": {},
                  "shopify_product_id": {},
                  "vendors": {},
                  "customer_id": {},
                  "from": {},
                  "to": {},
                  "order_ids": {},
                  "apply_to_all": {}
                }
              },
              "example": {
                "search": "string",
                "financial_status": "string",
                "fulfillment_status": "string",
                "preorder_fulfillment_status": "string",
                "cancelled_status": "string",
                "payment_collection_status": "string",
                "offer_id": "string",
                "shopify_variant_id": "45000000001",
                "shopify_product_id": "78000000001",
                "vendors": "string",
                "customer_id": "string",
                "from": "string",
                "to": "string",
                "order_ids": [
                  "string"
                ],
                "apply_to_all": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/orders/jobs/{job_id}": {
      "get": {
        "operationId": "get_preorders_orders_jobs_job_id",
        "summary": "Jobs",
        "description": "Check the status of a bulk-order job, with each order's result.\n\n**Note:** status is queued, running, completed or failed. succeeded / failed list each finished order by id and shopify_order_id; failed entries carry the reason. Results are kept for 24 hours.",
        "tags": [
          "Preorders · Orders"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "check bulk order job",
          "poll bulk order job",
          "get order job status"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/preorders/product_variants/{shopify_variant_id}": {
      "get": {
        "operationId": "get_preorders_product_variants_shopify_variant_id",
        "summary": "Read",
        "description": "Read one Shopify variant as the Preorders > Products tab lists it: the offers it is in, with its shipping text, limit and count on each.\n\n**Note:** :shopify_variant_id is a Shopify variant gid (a numeric id also works). The response is GET /preorders/products for this one variant: `variant` is a row and `offers` the offers it is in. `variant` also has the lifetime preorder_units_sold and line_item_revenue across every offer, without units on cancelled orders or units refunded before they shipped. max_count is the variant's own limit (what PATCH /preorders/products writes); quantity_limit is the read-only limit that applies, which on a batch offer is the batches' total.",
        "tags": [
          "Preorders · Product Variants"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "show preorder context for variant",
          "look up variant preorders",
          "variant preorder state",
          "get preorder variant",
          "show variant in preorders",
          "which offers is this variant in",
          "what offers contain this variant"
        ],
        "parameters": [
          {
            "name": "shopify_variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/preorders/product_variants/{shopify_variant_id}/detach_from_all_offers": {
      "post": {
        "operationId": "post_preorders_product_variants_shopify_variant_id_detach_from_all_offers",
        "summary": "Detach From All Offers",
        "description": "Remove a variant from every preorder offer it's attached to. Customer orders are unaffected.\n\n**Note:** Destructive. Each offer is reset on Shopify before its local link is removed. detached_offer_ids lists the offers it left; failed lists any Shopify refused, which keep the variant (207 when some failed, 502 when all did). inventory_policy: DENY first turns 'Continue selling' off on the variant.",
        "tags": [
          "Preorders · Product Variants"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "remove variant from all preorders",
          "detach from preorder",
          "kick variant out of offers",
          "remove from all offers"
        ],
        "parameters": [
          {
            "name": "shopify_variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inventory_policy": {}
                }
              },
              "example": {
                "inventory_policy": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/product_variants/{shopify_variant_id}/recalculate_preorder_count": {
      "post": {
        "operationId": "post_preorders_product_variants_shopify_variant_id_recalculate_preorder_count",
        "summary": "Recalculate Preorder Count",
        "description": "Recompute preorder_count for a variant from active order line items, then push to Shopify.",
        "tags": [
          "Preorders · Product Variants"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "recalculate preorder count from orders",
          "fix preorder count",
          "rebuild count",
          "recompute preorder count",
          "fix variant count drift"
        ],
        "parameters": [
          {
            "name": "shopify_variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/product_variants/{shopify_variant_id}/reset_metafields": {
      "post": {
        "operationId": "post_preorders_product_variants_shopify_variant_id_reset_metafields",
        "summary": "Reset Metafields",
        "description": "Reset a variant's preorder counts (its preorder orders stop counting, the recounted count of its live offer is republished, and the count is cleared when it has none) and rebuild its shipping text and limit metafields from its live offers. Keeps the variant attached to its offers.\n\n**Note:** Doesn't detach. Shipping text and limit are cleared only where no live offer sets them.",
        "tags": [
          "Preorders · Product Variants"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "clear preorder metafields",
          "wipe variant preorder data",
          "reset variant metafields",
          "clear variant metafields"
        ],
        "parameters": [
          {
            "name": "shopify_variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/product_variants/{shopify_variant_id}/reset_preorder_count": {
      "post": {
        "operationId": "post_preorders_product_variants_shopify_variant_id_reset_preorder_count",
        "summary": "Reset Preorder Count",
        "description": "Hard-reset the variant's preorder count to zero on every offer, retiring the orders counted so far.\n\n**Note:** Use recalculate_preorder_count for a recompute from real orders; this is a destructive zero.",
        "tags": [
          "Preorders · Product Variants"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "zero out preorder count",
          "clear preorder count",
          "reset count to zero"
        ],
        "parameters": [
          {
            "name": "shopify_variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/product_variants/{shopify_variant_id}/sync_metafields": {
      "post": {
        "operationId": "post_preorders_product_variants_shopify_variant_id_sync_metafields",
        "summary": "Sync Metafields",
        "description": "Force-resync every preorder metafield for a variant from local DB state to Shopify.\n\n**Note:** Idempotent. Useful when a previous metafield write failed.",
        "tags": [
          "Preorders · Product Variants"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "force resync to shopify",
          "push metafields to shopify",
          "refresh shopify metafields",
          "fix shopify metafield drift"
        ],
        "parameters": [
          {
            "name": "shopify_variant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ]
      }
    },
    "/preorders/product_variants/availability": {
      "get": {
        "operationId": "get_preorders_product_variants_availability",
        "summary": "Availability",
        "description": "Resolve which preorder offer applies to Shopify variants for a buyer country, with its stock condition and schedule. Beta.\n\n**Note:** country is the buyer's ISO 3166-1 alpha-2 country. status live means an offer applies and its limit is not reached, sold_out that its limit is reached; the caller still checks live inventory per `stock_condition` (in_stock: quantity above 0; out_of_stock: 0 or below with continue selling; any_stock_level: either). Unknown or deleted variants are `not_enrolled`; malformed ids are listed in `errors`. include[]=offer_details adds the offer's shipping_text, max_count, quantity_limit, preorder_count and quantity_limit_reached to `preorder`, as GET /preorders/products lists them; shipping_text is the text the buyer sees.",
        "tags": [
          "Preorders · Product Variants"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "variant availability",
          "is variant on preorder",
          "preorder availability by country",
          "resolve preorder for country"
        ],
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": true,
            "schema": {},
            "example": "US"
          },
          {
            "name": "shopify_variant_ids",
            "in": "query",
            "required": false,
            "schema": {},
            "example": [
              "45000000001"
            ]
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array"
                }
              ]
            },
            "example": "string"
          }
        ]
      }
    },
    "/preorders/product_variants/bulk_recalculate_preorder_counts": {
      "post": {
        "operationId": "post_preorders_product_variants_bulk_recalculate_preorder_counts",
        "summary": "Bulk Recalculate Preorder Counts",
        "description": "Recompute preorder_count for many variants in one job (max 5000).",
        "tags": [
          "Preorders · Product Variants"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "recalculate counts for variants",
          "bulk fix preorder counts",
          "recalculate many variants",
          "batch recompute counts"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopify_variant_ids": {}
                }
              },
              "example": {
                "shopify_variant_ids": [
                  "45000000001"
                ]
              }
            }
          }
        }
      }
    },
    "/preorders/product_variants/bulk_reset_metafields": {
      "post": {
        "operationId": "post_preorders_product_variants_bulk_reset_metafields",
        "summary": "Bulk Reset Metafields",
        "description": "Reset preorder metafields for many variants in one job (max 5000).",
        "tags": [
          "Preorders · Product Variants"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "clear metafields for variants",
          "bulk reset variant metafields",
          "wipe metafields for many variants"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopify_variant_ids": {}
                }
              },
              "example": {
                "shopify_variant_ids": [
                  "45000000001"
                ]
              }
            }
          }
        }
      }
    },
    "/preorders/product_variants/bulk_sync_metafields": {
      "post": {
        "operationId": "post_preorders_product_variants_bulk_sync_metafields",
        "summary": "Bulk Sync Metafields",
        "description": "Force-resync preorder metafields for many variants in one job (max 5000).",
        "tags": [
          "Preorders · Product Variants"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "force resync many variants",
          "bulk refresh metafields",
          "push many variants to shopify"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopify_variant_ids": {}
                }
              },
              "example": {
                "shopify_variant_ids": [
                  "45000000001"
                ]
              }
            }
          }
        }
      }
    },
    "/preorders/product_variants/jobs/{job_id}": {
      "get": {
        "operationId": "get_preorders_product_variants_jobs_job_id",
        "summary": "Jobs",
        "description": "Check the status of a bulk variant-admin job.",
        "tags": [
          "Preorders · Product Variants"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "check bulk variant job status",
          "poll bulk variant job",
          "get variant job status"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/preorders/products": {
      "get": {
        "operationId": "get_preorders_products",
        "summary": "List",
        "description": "List the variants on the store-wide Preorders > Products tab, with the offers each is linked to, paginated.\n\n**Note:** search matches product title, variant title and SKU, as the tab's search does. sort is one of created_asc, created_desc, title_asc, title_desc (default title_asc); created means the product's Shopify creation order. product_status keeps active, draft, archived, unlisted (comma-separated). With no offer filter the list holds only variants linked to an offer, as the tab does; offer_ids keeps variants in those offers and no_offer_linked=true adds the variants in no offer (the tab's 'No offer linked'). Variants deleted in Shopify are left out. per_page is 1-100 (default 20). Each row's offers carry that variant's own shipping_text and max_count (the values PATCH /preorders/products writes), quantity_limit (read-only: the limit that applies, which on a batch offer is the batches' total and not max_count; null is no limit), preorder_count and quantity_limit_reached. The top-level offers are every offer the tab can pick from, each with its current_status (live, scheduled or off, as GET /preorders/offers reports it: a dated offer is scheduled before its start and off after its end). include_inventory=true adds each row's live Shopify inventory_quantity and inventory_policy, and reads sku live, as the tab shows them.",
        "tags": [
          "Preorders · Products"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "preorder products",
          "products tab",
          "list preorder products",
          "variants on preorder",
          "which offer is this product in",
          "products not in an offer",
          "search preorder products"
        ],
        "parameters": [
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "created_asc",
                "created_desc",
                "title_asc",
                "title_desc"
              ]
            },
            "example": "created_asc"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "product_status",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "offer_ids",
            "in": "query",
            "required": false,
            "schema": {},
            "example": [
              "string"
            ]
          },
          {
            "name": "no_offer_linked",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "include_inventory",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_products",
        "summary": "Update",
        "description": "Save rows of the store-wide Preorders > Products tab: link each variant to one offer or to none, and set its shipping text and quantity limit on the offers it is in.\n\n**Note:** variants is a list of up to 100 rows. A row's offer_id replaces every offer the variant is in with that one, and null takes it out of all of them, as the tab's 'Offer linked' select does; omit offer_id to leave the links. Offers that sell in selected markets only cannot be picked, and a variant in one is skipped (skipped_market_shopify_variant_ids); change those on the offer itself. offers sets this variant's shipping_text and max_count on offers it is in; shipping_text only on an offer whose shipping text is per variant, max_count (1 or more) only on an out-of-stock offer. null clears either one; a key left out is unchanged. max_count is the variant's own limit, the same field GET /preorders/products returns, so writing a read value back changes nothing. On an offer with batches on, limits are per batch: max_count (a value or null) returns 422 there, so set batch_limits on PATCH /preorders/offers/:id/products/variants/:shopify_variant_id instead. quantity_limit is read-only. inventory_policy (CONTINUE or DENY) also sets 'Continue selling' on the variants whose offer_id changed, as the save confirm's Turn on / Turn off does; omit it for 'Don't change'. Variants STOQ has not stored yet are read from Shopify. Finishes before the response.",
        "tags": [
          "Preorders · Products"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "link product to offer",
          "move variant to offer",
          "change offer linked",
          "unlink product from offer",
          "set shipping text for variant",
          "set quantity limit for variant",
          "save products tab"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "variants": {},
                  "inventory_policy": {}
                }
              },
              "example": {
                "variants": "string",
                "inventory_policy": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/products/add_to_offer": {
      "post": {
        "operationId": "post_preorders_products_add_to_offer",
        "summary": "Add To Offer",
        "description": "Add variants to one preorder offer as the store-wide Products tab's 'Add to offer' does. Like the tab, it runs no pre-flight check.\n\n**Note:** shopify_variant_ids are up to 100 Shopify variant gids. Unlike /preorders/offers/:id/products/add_variants, this does not run the pre-flight check, because the tab's 'Add to offer' does not: variants are added even when other offers already have them, 'Continue selling' is off, or a sales channel can't sell preorders. Use add_variants to get those warnings first. Offers whose markets.scope is selected cannot be picked, and variants another market-specific offer owns are left out (skipped_market_variant_count). inventory_policy: CONTINUE then turns 'Continue selling' on for the variants, on an out-of-stock offer only, as the tab's 'Turn on Continue selling' choice does; omit it to leave their policy. Finishes before the response.",
        "tags": [
          "Preorders · Products"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "add to offer",
          "add products to offer from products tab",
          "assign offer to variants",
          "bulk add to offer"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "offer_id": {},
                  "shopify_variant_ids": {},
                  "inventory_policy": {}
                }
              },
              "example": {
                "offer_id": "string",
                "shopify_variant_ids": [
                  "45000000001"
                ],
                "inventory_policy": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/products/bulk_toggle_inventory_policy": {
      "post": {
        "operationId": "post_preorders_products_bulk_toggle_inventory_policy",
        "summary": "Bulk Toggle Inventory Policy",
        "description": "Turn 'Continue selling when out of stock' on (CONTINUE) or off (DENY) for variants on the store-wide Preorders > Products tab, whatever offers they are in.\n\n**Note:** shopify_variant_ids are up to 100 Shopify variant gids, as the tab selects them a page at a time; ones STOQ has no row for come back under skipped_shopify_variant_ids. With CONTINUE, variants that have reached their quantity limit on any offer are left out (skipped_quantity_limit_shopify_variant_ids), as the tab's 'Skip products that have reached their quantity limit' (checked by default) does; skip_quantity_limited: false includes them. Fails with 422 quantity_limit_reached when every variant is left out. Before turning it off, GET /preorders/products/inventory_policy_conflicts names the other offers that need it on. Finishes before the response. For one offer's variants use /preorders/offers/:id/products/bulk_toggle_inventory_policy.",
        "tags": [
          "Preorders · Products"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "toggle continue selling",
          "turn on continue selling",
          "turn off continue selling",
          "set inventory policy",
          "allow overselling",
          "stop overselling"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "policy": {
                    "enum": [
                      "CONTINUE",
                      "DENY"
                    ]
                  },
                  "shopify_variant_ids": {},
                  "skip_quantity_limited": {}
                },
                "required": [
                  "policy"
                ]
              },
              "example": {
                "policy": "CONTINUE",
                "shopify_variant_ids": [
                  "45000000001"
                ],
                "skip_quantity_limited": 5
              }
            }
          }
        }
      }
    },
    "/preorders/products/inventory_policy_conflicts": {
      "get": {
        "operationId": "get_preorders_products_inventory_policy_conflicts",
        "summary": "Inventory Policy Conflicts",
        "description": "Name the enabled out-of-stock offers that still sell these variants, before turning 'Continue selling' off on them.\n\n**Note:** shopify_variant_ids are up to 100 Shopify variant gids (repeat the param or comma-separate). 'Continue selling' is one value per variant, and an out-of-stock offer takes preorders only while it is on, so turning it off stops preorders in every offer listed. shared_variant_count is how many of the variants are in one; each offer's variant_count is how many of them it sells. Informational: the write applies anyway.",
        "tags": [
          "Preorders · Products"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "inventory policy conflicts",
          "which offers need continue selling",
          "linked offers warning",
          "what breaks if I turn off continue selling"
        ],
        "parameters": [
          {
            "name": "shopify_variant_ids",
            "in": "query",
            "required": false,
            "schema": {},
            "example": [
              "45000000001"
            ]
          }
        ]
      }
    },
    "/preorders/products/remove_from_offers": {
      "post": {
        "operationId": "post_preorders_products_remove_from_offers",
        "summary": "Remove From Offers",
        "description": "Take variants out of every preorder offer they are in, as the store-wide Products tab's 'Remove from offer' does.\n\n**Note:** shopify_variant_ids are up to 100 Shopify variant gids. A variant in an offer that sells in selected markets only is skipped (skipped_market_shopify_variant_ids), as the tab skips it; ones STOQ has no row for come back under not_found. inventory_policy: DENY first turns 'Continue selling' off on the removed variants, offer by offer, as the tab's Remove modal does by default; omit it to leave their policy. Finishes before the response. To remove from one offer only use /preorders/offers/:id/products/remove_variants.",
        "tags": [
          "Preorders · Products"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "remove from offer",
          "remove products from all offers",
          "unlink variants from offers",
          "take products off preorder",
          "stop preorders on these products"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopify_variant_ids": {},
                  "inventory_policy": {}
                }
              },
              "example": {
                "shopify_variant_ids": [
                  "45000000001"
                ],
                "inventory_policy": "string"
              }
            }
          }
        }
      }
    },
    "/preorders/products/tags": {
      "get": {
        "operationId": "get_preorders_products_tags",
        "summary": "Tags",
        "description": "List the shop's product tags, as the offer's tag picker suggests them.\n\n**Note:** The first 250 tags in alphabetical order, as the picker shows. A tag that is not listed can still be used in a tags selection.",
        "tags": [
          "Preorders · Products"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "product tags",
          "list tags",
          "shop tags",
          "tag suggestions"
        ]
      }
    },
    "/preorders/products/tags/count": {
      "get": {
        "operationId": "get_preorders_products_tags_count",
        "summary": "Tags Count",
        "description": "Count the products that carry any of the given tags, as the offer's tag picker does while you type.\n\n**Note:** tags is a list (or comma-separated). Counts active, published products that carry one of the tags as a whole tag. Past 500 products the count stops and exact is false.",
        "tags": [
          "Preorders · Products"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "count products by tag",
          "tag match count",
          "how many products have this tag"
        ],
        "parameters": [
          {
            "name": "tags",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/preorders/reports": {
      "get": {
        "operationId": "get_preorders_reports",
        "summary": "List",
        "description": "List every available preorder report (name, description, aliases, url).",
        "tags": [
          "Preorders · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "reports",
          "list reports",
          "available reports",
          "what reports are there",
          "report catalog"
        ]
      }
    },
    "/preorders/reports/by_date": {
      "get": {
        "operationId": "get_preorders_reports_by_date",
        "summary": "By Date",
        "description": "The Preorders Overview charts per day, week or month: preorder orders and their sales, and preorder units sold and their line revenue.\n\n**Note:** The same points as the dashboard charts, counted live. Every series leaves cancelled orders out. units_sold and line_item_revenue count preorder lines. interval is daily up to 60 days, weekly up to 180, then monthly, and buckets are UTC days as on the charts. range=all_time is the dashboard's All time.",
        "tags": [
          "Preorders · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "time series",
          "daily breakdown",
          "trend",
          "over time",
          "preorder trend",
          "show trend"
        ],
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "null",
                "string"
              ]
            },
            "example": "string"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/preorders/reports/engagement": {
      "get": {
        "operationId": "get_preorders_reports_engagement",
        "summary": "Engagement",
        "description": "Preorder button engagement: impressions, add-to-carts, add-to-cart rate, orders and order rate, shop-wide and per variant — the merchant's Products > Engagement view.\n\n**Note:** Rates use unique shoppers; total_* fields count every event. order_rate can exceed 1.0: orders are placed preorder orders, a different denominator than unique add-to-carts. from/to default to the shop's lifetime. variants is paged and sorted by sort_by (default impressions); shopify_variant_ids narrows it. pixel_active is false until the STOQ web pixel is set up (POST /account/web_pixel/enable); the dashboard shows a set-up prompt instead of these numbers then. Each variant row's image_url is the variant's stored image, else the product's (null if none is stored).",
        "tags": [
          "Preorders · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "preorder engagement",
          "preorder funnel",
          "add to cart rate",
          "button engagement",
          "preorder performance"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "shopify_market_id",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "gid://shopify/Market/12345"
          },
          {
            "name": "shopify_variant_ids",
            "in": "query",
            "required": false,
            "schema": {},
            "example": [
              "45000000001"
            ]
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/preorders/reports/fulfillments": {
      "get": {
        "operationId": "get_preorders_reports_fulfillments",
        "summary": "Fulfillments",
        "description": "What is still owed to preorder customers: units sold, cancelled, fulfilled and outstanding (waiting, on hold, scheduled) per variant or product, as the dashboard's fulfillment table.\n\n**Note:** Units, not orders. cancelled counts every unit on a cancelled order plus units refunded or split off from an open order. sold = cancelled + fulfilled + outstanding, and outstanding = waiting + on_hold + scheduled. Statuses are as of now; the window selects when the units were sold. range=all_time is the dashboard's All time. image_url is the variant's stored image, else the product's (null if none is stored).",
        "tags": [
          "Preorders · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "fulfillment report",
          "what do I still owe",
          "outstanding preorders",
          "unfulfilled preorder units",
          "preorders left to ship"
        ],
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "null",
                "string"
              ]
            },
            "example": "string"
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "variant",
                "product"
              ]
            },
            "example": "variant"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/preorders/reports/products": {
      "get": {
        "operationId": "get_preorders_reports_products",
        "summary": "Products",
        "description": "Preorder units, orders, line revenue and last order date per variant (or product), as the dashboard's products table.\n\n**Note:** Counts preorder line items only (ordinary items in a mixed cart are excluded). revenue is line revenue. group_by=product rolls variants up to their product. range=all_time is the dashboard's All time. image_url is the variant's stored image, else the product's (null if none is stored).",
        "tags": [
          "Preorders · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — example response shown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "window": {
                    "from": "2026-05-26T00:00:00Z",
                    "to": "2026-06-25T23:59:59Z"
                  },
                  "group_by": "variant",
                  "sort_by": "revenue",
                  "direction": "desc",
                  "currency": "USD",
                  "rows": [
                    {
                      "shopify_product_id": "gid://shopify/Product/8784906035384",
                      "product_title": "Classic Sneaker",
                      "shopify_variant_id": "gid://shopify/ProductVariant/47284734423096",
                      "variant_title": "Blue / Medium",
                      "sku": "CS-BLU-M",
                      "units": 64,
                      "orders": 58,
                      "revenue": "7040.00",
                      "last_order_date": "2026-06-25T10:02:00Z"
                    },
                    {
                      "shopify_product_id": "gid://shopify/Product/8784906035384",
                      "product_title": "Classic Sneaker",
                      "shopify_variant_id": "gid://shopify/ProductVariant/47284734455864",
                      "variant_title": "Red / Large",
                      "sku": "CS-RED-L",
                      "units": 31,
                      "orders": 30,
                      "revenue": "3410.00",
                      "last_order_date": "2026-06-24T18:40:00Z"
                    }
                  ],
                  "meta": {
                    "total_count": 42,
                    "page": 1,
                    "per_page": 25,
                    "total_pages": 2
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "per-product report",
          "product performance",
          "which products are preordering",
          "report by product",
          "per-variant report",
          "report by variant",
          "top preorder products"
        ],
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "null",
                "string"
              ]
            },
            "example": "string"
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "variant",
                "product"
              ]
            },
            "example": "variant"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/preorders/reports/summary": {
      "get": {
        "operationId": "get_preorders_reports_summary",
        "summary": "Summary",
        "description": "The Preorders Overview tiles over a date window: orders, units sold, revenue (total sales), preorder line item revenue, average order value, unpaid and unfulfilled orders and unique customers.\n\n**Note:** The same numbers as the dashboard tiles and the Home analytics card, summed from the shop's daily totals. Every total leaves cancelled orders out, units_sold and line_item_revenue included. range=all_time reads orders and revenue from the shop's lifetime totals, as Home's All time does.",
        "tags": [
          "Preorders · Reports"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "summary",
          "overview",
          "how is preorder doing",
          "preorder summary",
          "dashboard stats",
          "what's happening with preorders"
        ],
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "null",
                "string"
              ]
            },
            "example": "string"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {},
            "example": "string"
          }
        ]
      }
    },
    "/preorders/settings/developer": {
      "get": {
        "operationId": "get_preorders_settings_developer",
        "summary": "Developer",
        "description": "The preorder developer settings: dev mode, the custom CSS, and the theme CSS selectors that place the Preorder button and each preorder element on product pages and on the home, collection and search product lists. Shop-wide, not per offer. The selectors are used only while dev mode is on. Dev mode and CSS are shared with back-in-stock.",
        "tags": [
          "Preorders · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "developer settings",
          "dev mode",
          "preorder selectors",
          "placement selectors",
          "insertion points"
        ]
      },
      "patch": {
        "operationId": "patch_preorders_settings_developer",
        "summary": "Developer",
        "description": "Update the shop-wide preorder developer settings: dev mode, the custom CSS, and the theme selectors that place the Preorder button and each preorder element on product pages and on home, collection and search product cards. Selectors are used only while dev mode is on.\n\n**Note:** Deep partial. null or \"\" clears a selector so the theme default applies. dev_mode_enabled and css are shared with the back-in-stock widget: changing them here changes them there. Returns the developer section.",
        "tags": [
          "Preorders · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "change preorder selectors",
          "set preorder button selector",
          "fix preorder button placement"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "dev_mode_enabled": {
                    "type": "boolean",
                    "description": "Dev mode: place the Preorder button and preorder elements with the selectors below instead of the automatic placement. Shared with the back-in-stock widget's dev mode."
                  },
                  "css": {
                    "type": "string",
                    "description": "Custom CSS added on every storefront page, shared with back-in-stock. REPLACES the stored CSS; \"\" or null clears it."
                  },
                  "product_page": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "form": {
                        "type": "string",
                        "description": "A CSS selector in the theme. The product form the Preorder button belongs to."
                      },
                      "add_to_cart_button": {
                        "type": "string",
                        "description": "A CSS selector in the theme. The theme's add-to-cart button the Preorder button replaces."
                      },
                      "add_to_cart_text": {
                        "type": "string",
                        "description": "A CSS selector in the theme. The element inside the add-to-cart button holding its text."
                      },
                      "original_price": {
                        "type": "string",
                        "description": "A CSS selector in the theme. The price the discounted preorder price strikes through."
                      }
                    }
                  },
                  "insertion_points": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "disclaimer": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "selector": {
                            "type": "string",
                            "description": "A CSS selector in the theme. Where the disclaimer goes on product pages."
                          },
                          "insert_type": {
                            "type": "string",
                            "description": "Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.",
                            "enum": [
                              "beforebegin",
                              "afterbegin",
                              "beforeend",
                              "afterend"
                            ]
                          }
                        }
                      },
                      "payment_options": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "selector": {
                            "type": "string",
                            "description": "A CSS selector in the theme. Where the payment options goes on product pages."
                          },
                          "insert_type": {
                            "type": "string",
                            "description": "Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.",
                            "enum": [
                              "beforebegin",
                              "afterbegin",
                              "beforeend",
                              "afterend"
                            ]
                          }
                        }
                      },
                      "terms": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "selector": {
                            "type": "string",
                            "description": "A CSS selector in the theme. Where the terms goes on product pages."
                          },
                          "insert_type": {
                            "type": "string",
                            "description": "Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.",
                            "enum": [
                              "beforebegin",
                              "afterbegin",
                              "beforeend",
                              "afterend"
                            ]
                          }
                        }
                      },
                      "badge": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "selector": {
                            "type": "string",
                            "description": "A CSS selector in the theme. Where the badge goes on product pages."
                          },
                          "insert_type": {
                            "type": "string",
                            "description": "Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.",
                            "enum": [
                              "beforebegin",
                              "afterbegin",
                              "beforeend",
                              "afterend"
                            ]
                          }
                        }
                      },
                      "discounted_price": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "selector": {
                            "type": "string",
                            "description": "A CSS selector in the theme. Where the discounted price goes on product pages."
                          },
                          "insert_type": {
                            "type": "string",
                            "description": "Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.",
                            "enum": [
                              "beforebegin",
                              "afterbegin",
                              "beforeend",
                              "afterend"
                            ]
                          }
                        }
                      },
                      "countdown_timer": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "selector": {
                            "type": "string",
                            "description": "A CSS selector in the theme. Where the countdown timer goes on product pages."
                          },
                          "insert_type": {
                            "type": "string",
                            "description": "Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.",
                            "enum": [
                              "beforebegin",
                              "afterbegin",
                              "beforeend",
                              "afterend"
                            ]
                          }
                        }
                      },
                      "progress_bar": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "selector": {
                            "type": "string",
                            "description": "A CSS selector in the theme. Where the progress bar goes on product pages."
                          },
                          "insert_type": {
                            "type": "string",
                            "description": "Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.",
                            "enum": [
                              "beforebegin",
                              "afterbegin",
                              "beforeend",
                              "afterend"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "collection": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "form": {
                        "type": "string",
                        "description": "A CSS selector in the theme. The product card form on collection pages."
                      },
                      "add_to_cart_button": {
                        "type": "string",
                        "description": "A CSS selector in the theme. The add-to-cart button on collection page product cards."
                      },
                      "badge": {
                        "type": "string",
                        "description": "A CSS selector in the theme. Where the preorder badge goes on collection page product cards."
                      },
                      "badge_insert_type": {
                        "type": "string",
                        "description": "Where the element goes relative to the selector: beforebegin (before it), afterbegin (inside it, first), beforeend (inside it, last) or afterend (after it). Empty uses the default.",
                        "enum": [
                          "beforebegin",
                          "afterbegin",
                          "beforeend",
                          "afterend"
                        ]
                      }
                    }
                  },
                  "home": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "form": {
                        "type": "string",
                        "description": "A CSS selector in the theme. The product card form on home pages."
                      },
                      "add_to_cart_button": {
                        "type": "string",
                        "description": "A CSS selector in the theme. The add-to-cart button on home page product cards."
                      },
                      "badge": {
                        "type": "string",
                        "description": "A CSS selector in the theme. Where the preorder badge goes on home page product cards."
                      }
                    }
                  },
                  "search": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "form": {
                        "type": "string",
                        "description": "A CSS selector in the theme. The product card form on search pages."
                      },
                      "add_to_cart_button": {
                        "type": "string",
                        "description": "A CSS selector in the theme. The add-to-cart button on search page product cards."
                      },
                      "badge": {
                        "type": "string",
                        "description": "A CSS selector in the theme. Where the preorder badge goes on search page product cards."
                      }
                    }
                  }
                }
              },
              "example": {
                "dev_mode_enabled": true,
                "css": "string",
                "product_page": {
                  "form": "string",
                  "add_to_cart_button": "string",
                  "add_to_cart_text": "Preorder now",
                  "original_price": "string"
                },
                "insertion_points": {
                  "disclaimer": {
                    "selector": "string",
                    "insert_type": "beforebegin"
                  },
                  "payment_options": {
                    "selector": "string",
                    "insert_type": "beforebegin"
                  },
                  "terms": {
                    "selector": "string",
                    "insert_type": "beforebegin"
                  },
                  "badge": {
                    "selector": "string",
                    "insert_type": "beforebegin"
                  },
                  "discounted_price": {
                    "selector": "string",
                    "insert_type": "beforebegin"
                  },
                  "countdown_timer": {
                    "selector": "string",
                    "insert_type": "beforebegin"
                  },
                  "progress_bar": {
                    "selector": "string",
                    "insert_type": "beforebegin"
                  }
                },
                "collection": {
                  "form": "string",
                  "add_to_cart_button": "string",
                  "badge": "string",
                  "badge_insert_type": "beforebegin"
                },
                "home": {
                  "form": "string",
                  "add_to_cart_button": "string",
                  "badge": "string"
                },
                "search": {
                  "form": "string",
                  "add_to_cart_button": "string",
                  "badge": "string"
                }
              }
            }
          }
        }
      }
    },
    "/preorders/settings/pages": {
      "get": {
        "operationId": "get_preorders_settings_pages",
        "summary": "Pages",
        "description": "The Preorder pages settings (Preorders > Settings > Pages): whether the Preorder button shows on the home, collection and search pages, and whether collection pages show the preorder badge when any variant is a preorder. Shop-wide, not per offer. Product pages always show the button. The locations and markets these pages count stock at are GET /account/markets; the page's CSS selectors are GET /preorders/settings/developer.",
        "tags": [
          "Preorders · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "preorder pages",
          "preorder on collection page",
          "preorder on home page",
          "preorder on search page",
          "preorder button on other pages",
          "collection page badge"
        ]
      },
      "patch": {
        "operationId": "patch_preorders_settings_pages",
        "summary": "Pages",
        "description": "Update the Preorder pages settings (Preorders > Settings > Pages): the Preorder button on the home, collection and search pages, and the collection-page badge rule. Shop-wide, not per offer. Locations and markets are PATCH /account/markets; CSS selectors are PATCH /preorders/settings/developer.\n\n**Note:** Deep partial: absent fields are unchanged; unknown keys are rejected. Returns the pages section.",
        "tags": [
          "Preorders · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "show preorder on collection page",
          "hide preorder on collection page",
          "show preorder on home page",
          "show preorder on search page",
          "turn off preorder on search page",
          "show preorder badge if any variant is preorder"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "home": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "description": "Show the Preorder button on products listed on the home page."
                      }
                    }
                  },
                  "collection": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "description": "Show the Preorder button on products listed on collection pages."
                      },
                      "show_badge_if_any_variant_is_preorder": {
                        "type": "boolean",
                        "description": "Show the offer's preorder badge on a product card when any variant is on preorder, not only the variant the card shows first. The editor shows it under Collection page; it applies to every product list with the Preorder button on. The badge shows only for offers with Add badge on. Turning collection pages on does not need it: leave it out unless the merchant asks about the badge."
                      }
                    }
                  },
                  "search": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "description": "Show the Preorder button on products listed on search results pages."
                      }
                    }
                  }
                }
              },
              "example": {
                "home": {
                  "enabled": true
                },
                "collection": {
                  "enabled": true,
                  "show_badge_if_any_variant_is_preorder": true
                },
                "search": {
                  "enabled": true
                }
              }
            }
          }
        }
      }
    },
    "/preorders/settings/reports": {
      "get": {
        "operationId": "get_preorders_settings_reports",
        "summary": "Reports",
        "description": "The merchant's preorder report preferences (Settings > Reports): whether STOQ emails the merchant when it automatically collects the remaining balance of partially paid preorders.",
        "tags": [
          "Preorders · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "preorder report settings"
        ]
      },
      "patch": {
        "operationId": "patch_preorders_settings_reports",
        "summary": "Reports",
        "description": "Update the merchant's preorder report preferences (Settings > Reports): the email to the merchant when balances of partially paid preorders are collected automatically.\n\n**Note:** Deep partial. Returns the reports section.",
        "tags": [
          "Preorders · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "notify me when payments are collected",
          "payment collection notice"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "notify_payment_collection_enabled": {
                    "type": "boolean",
                    "description": "Email the merchant when STOQ automatically collects the remaining balance of partially paid preorders. A notice to the merchant, not to customers."
                  }
                }
              },
              "example": {
                "notify_payment_collection_enabled": true
              }
            }
          }
        }
      }
    },
    "/preorders/settings/storefront_text": {
      "get": {
        "operationId": "get_preorders_settings_storefront_text",
        "summary": "Storefront Text",
        "description": "The shop-wide preorder storefront text: the currency format, the button's out-of-stock and add-to-cart text, and the preorder modal's continue and cancel buttons and error heading. Shared by every preorder offer. `?locale=` reads one language (omitted: the shop's default language).",
        "tags": [
          "Preorders · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "preorder currency format",
          "preorder out of stock text",
          "preorder add to cart text",
          "preorder modal button text",
          "preorder error heading",
          "preorder storefront text"
        ],
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_settings_storefront_text",
        "summary": "Storefront Text",
        "description": "Update the shop-wide preorder storefront text: the currency format, the button's out-of-stock and add-to-cart text, and the preorder modal's continue and cancel buttons and error heading. Shared by every preorder offer, not per offer.\n\n**Note:** Deep partial. Shop-wide: one change applies to every preorder offer. The per-offer Preorder button text and per-state overrides are on the offer's widget and advanced settings. Text fields are written in `locale` (optional); currency_format is not translated. Returns the section.",
        "tags": [
          "Preorders · Settings"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "change preorder currency format",
          "change preorder out of stock text",
          "change preorder add to cart text",
          "change preorder modal continue button",
          "change preorder modal cancel button",
          "change preorder error heading",
          "translate preorder modal buttons"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "currency_format": {
                    "type": "string",
                    "description": "How preorder prices print on the storefront, such as \"{{amount}} {{currency}}\". Use {{currency}}, {{currency_symbol}} and a Shopify amount variable ({{amount}}, {{amount_no_decimals}}, {{amount_with_comma_separator}} ...). \"\" goes back to the theme format. Not translated."
                  },
                  "button": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "out_of_stock_text": {
                        "type": "string",
                        "description": "Button text once the preorder limit is reached and the product is sold out. Every offer."
                      },
                      "add_to_cart_text": {
                        "type": "string",
                        "description": "Button text when the product is in stock and not on preorder. Every offer."
                      }
                    }
                  },
                  "modal": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "continue_button_text": {
                        "type": "string",
                        "description": "Text on the continue button of the preorder modal. Every offer."
                      },
                      "cancel_button_text": {
                        "type": "string",
                        "description": "Text on the cancel button of the preorder modal. Every offer."
                      },
                      "error_heading": {
                        "type": "string",
                        "description": "Heading of error messages in the preorder modal. Edited on the preorder translations page. Every offer."
                      }
                    }
                  },
                  "locale": {
                    "type": "string",
                    "description": "Optional language tag (\"fr\", \"de\", \"pt-BR\"). The text fields are written in that language; omit for the shop's default. currency_format ignores it."
                  }
                }
              },
              "example": {
                "currency_format": "string",
                "button": {
                  "out_of_stock_text": "Preorder now",
                  "add_to_cart_text": "Preorder now"
                },
                "modal": {
                  "continue_button_text": "Preorder now",
                  "cancel_button_text": "Preorder now",
                  "error_heading": "string"
                },
                "locale": "fr"
              }
            }
          }
        }
      }
    },
    "/preorders/templates": {
      "get": {
        "operationId": "get_preorders_templates",
        "summary": "List",
        "description": "List every preorder notification's copy, in send order: confirmation (email and SMS), shipping_update (email) and payment_failed (email). ?locale= picks the language (omit it for the shop default). Whose account sends is GET /account/sending.\n\n**Note:** Each entry is the GET /preorders/templates/:key body. The confirmation is left out when the shop has no preorder template.",
        "tags": [
          "Preorders · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "get preorder notification settings",
          "show preorder notifications",
          "preorder email settings",
          "list preorder templates",
          "preorder notification copy"
        ],
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      }
    },
    "/preorders/templates/confirmation": {
      "get": {
        "operationId": "get_preorders_templates_confirmation",
        "summary": "Confirmation",
        "description": "Read the preorder confirmation notification's email and SMS copy. ?locale= picks the language (omit it for the shop default); the response names it in `locale`. Whether it sends is GET /preorders/notification_settings/confirmation.",
        "tags": [
          "Preorders · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "preorder confirmation email copy",
          "preorder confirmation sms copy",
          "get preorder template",
          "show preorder email",
          "localized preorder notification template"
        ],
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_templates_confirmation",
        "summary": "Confirmation",
        "description": "Update the preorder confirmation notification's email and SMS copy. The body is the GET shape: email{subject, preheader, heading, body, footer, button{text, background_color, text_color, radius}, colors{background, section, text}, radius, css, reviews{enabled, count, min_rating, title}, social{...}, klaviyo_flow_name} and sms{body, klaviyo_flow_name}. An optional body `locale` writes the copy in that language only; omit it for the shop default. Turning the email or SMS on or off is PATCH /preorders/notification_settings/confirmation.\n\n**Note:** Deep partial: absent fields are unchanged, unknown or read-only keys are rejected; errors are 422 keyed \"template.<path>\". Rejects HTML (except in email.css) and runs Template validations and callbacks, so sms.body must keep its required Liquid variables. Social links and the icon colour are shared: saving one sets it on every notification template of the shop. Returns the template.",
        "tags": [
          "Preorders · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "edit preorder template",
          "change preorder email",
          "update preorder confirmation",
          "localize preorder template",
          "change preorder sms"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "email": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "subject": {
                        "type": "string",
                        "description": "Subject of the preorder confirmation email."
                      },
                      "preheader": {
                        "type": "string",
                        "description": "Pre-header -- the preview line after the subject in the inbox."
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading at the top of the email body."
                      },
                      "body": {
                        "type": "string",
                        "description": "Description -- the main body copy of the email."
                      },
                      "footer": {
                        "type": "string",
                        "description": "Cancel order link -- the text of the link that lets customers cancel their preorder. Only shown while \"Allow customers to cancel preorders\" is on."
                      },
                      "button": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "text": {
                            "type": "string",
                            "description": "Button text on the email call to action."
                          },
                          "background_color": {
                            "type": "string",
                            "pattern": "^#([0-9a-fA-F]{3,8})$",
                            "description": "Button -- Background colour of the email button. Hex."
                          },
                          "text_color": {
                            "type": "string",
                            "pattern": "^#([0-9a-fA-F]{3,8})$",
                            "description": "Button -- Text colour of the email button. Hex."
                          },
                          "radius": {
                            "type": "integer",
                            "description": "Corner radius of the email button, in pixels.",
                            "minimum": 0
                          }
                        }
                      },
                      "colors": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "background": {
                            "type": "string",
                            "pattern": "^#([0-9a-fA-F]{3,8})$",
                            "description": "Colors -- Background of the email, around the content. Hex, e.g. \"#F9F9F9\"."
                          },
                          "section": {
                            "type": "string",
                            "pattern": "^#([0-9a-fA-F]{3,8})$",
                            "description": "Colors -- Background of the content section of the email. Hex."
                          },
                          "text": {
                            "type": "string",
                            "pattern": "^#([0-9a-fA-F]{3,8})$",
                            "description": "Colors -- Text colour of the email. Hex."
                          }
                        }
                      },
                      "radius": {
                        "type": "integer",
                        "description": "Corner radius of the content section, in pixels.",
                        "minimum": 0
                      },
                      "css": {
                        "type": "string",
                        "description": "Custom CSS added to the email. Applies to the standard email design. An empty string removes it."
                      },
                      "reviews": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "enabled": {
                            "type": "boolean",
                            "description": "Show product reviews: adds the product's Judge.me star rating and top reviews to the preorder confirmation and shipping update emails. Paid plans only; shows only while Judge.me is connected (Settings > Integrations)."
                          },
                          "count": {
                            "type": "integer",
                            "description": "Number of reviews to show in the Judge.me reviews block, 1 to 3.",
                            "minimum": 1,
                            "maximum": 3
                          },
                          "min_rating": {
                            "type": "integer",
                            "description": "Only show reviews rated at least this many stars: 5, 4 or 3.",
                            "enum": [
                              5,
                              4,
                              3
                            ]
                          },
                          "title": {
                            "type": "string",
                            "description": "Section title for the Judge.me reviews block on the email, e.g. \"What customers are saying\"."
                          }
                        }
                      },
                      "social": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "facebook": {
                            "type": "string",
                            "description": "Facebook profile URL, without the https:// prefix. Shows as an icon in the email. Saving a social link sets it on every notification template of the shop. An empty string removes it."
                          },
                          "instagram": {
                            "type": "string",
                            "description": "Instagram profile URL, without the https:// prefix. Saving a social link sets it on every notification template of the shop."
                          },
                          "pinterest": {
                            "type": "string",
                            "description": "Pinterest profile URL, without the https:// prefix. Saving a social link sets it on every notification template of the shop."
                          },
                          "twitter": {
                            "type": "string",
                            "description": "X (Twitter) profile URL, without the https:// prefix. Saving a social link sets it on every notification template of the shop."
                          },
                          "tiktok": {
                            "type": "string",
                            "description": "TikTok profile URL, without the https:// prefix. Saving a social link sets it on every notification template of the shop."
                          },
                          "whatsapp": {
                            "type": "string",
                            "description": "WhatsApp link, without the https:// prefix. Saving a social link sets it on every notification template of the shop."
                          },
                          "youtube": {
                            "type": "string",
                            "description": "YouTube channel URL, without the https:// prefix. Saving a social link sets it on every notification template of the shop."
                          },
                          "icon_color": {
                            "type": "string",
                            "enum": [
                              "#FFFFFF",
                              "#000000"
                            ],
                            "description": "Icon Color of the social icons: white (#FFFFFF) or black (#000000). Shared by every template."
                          }
                        }
                      },
                      "klaviyo_flow_name": {
                        "type": "string",
                        "description": "Flow name to trigger in Klaviyo instead of sending the email here. Only used while the email platform is Klaviyo."
                      }
                    }
                  },
                  "sms": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "body": {
                        "type": "string",
                        "description": "SMS Body -- the text message sent instead of the email. Must keep its Liquid variables."
                      },
                      "klaviyo_flow_name": {
                        "type": "string",
                        "description": "Flow name to trigger in Klaviyo instead of sending the SMS here. Only used while the SMS platform is Klaviyo."
                      }
                    }
                  },
                  "locale": {
                    "type": "string",
                    "description": "Language the translated fields are written in, such as 'fr' or 'pt-BR'. Omitted: the shop's default language. Untranslated fields ignore it."
                  }
                }
              },
              "example": {
                "email": {
                  "subject": "string",
                  "preheader": "string",
                  "heading": "string",
                  "body": "string",
                  "footer": "string",
                  "button": {
                    "text": "Preorder now",
                    "background_color": "#1A1A1A",
                    "text_color": "#1A1A1A",
                    "radius": 0
                  },
                  "colors": {
                    "background": "string",
                    "section": "string",
                    "text": "Preorder now"
                  },
                  "radius": 0,
                  "css": "string",
                  "reviews": {
                    "enabled": true,
                    "count": 5,
                    "min_rating": 5,
                    "title": "string"
                  },
                  "social": {
                    "facebook": "string",
                    "instagram": "string",
                    "pinterest": "string",
                    "twitter": "string",
                    "tiktok": "string",
                    "whatsapp": "string",
                    "youtube": "string",
                    "icon_color": "#FFFFFF"
                  },
                  "klaviyo_flow_name": "Summer Sneaker Drop"
                },
                "sms": {
                  "body": "string",
                  "klaviyo_flow_name": "Summer Sneaker Drop"
                },
                "locale": "fr"
              }
            }
          }
        }
      }
    },
    "/preorders/templates/confirmation/send_test": {
      "post": {
        "operationId": "post_preorders_templates_confirmation_send_test",
        "summary": "Confirmation Send Test",
        "description": "Send the preorder confirmation email to one email address as a test, rendered in the body `locale` (omit it for the shop default language) against one of the shop's own preorder offer products. Matches the preorder template page's Send test email button.\n\n**Note:** email defaults to the shop's reply-to address; one address only. offer_id (from GET /preorders/offers) and shopify_variant_id (a ProductVariant gid) pick the offer and product shown; omit both for the first product of the first enabled offer. Fails (422) when email sending is turned off, when the shop has no product in a preorder offer, or when the variant is not in the offer; 404 when the offer is not found or the shop has no single preorder confirmation template.",
        "tags": [
          "Preorders · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — async/bulk work was queued. Poll the returned job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "send test preorder email",
          "send a test preorder confirmation",
          "preview the preorder email in my inbox"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "locale": {
                    "type": "string",
                    "minLength": 1
                  },
                  "email": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "offer_id": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "shopify_variant_id": {
                    "type": [
                      "null",
                      "string"
                    ]
                  }
                }
              },
              "example": {
                "locale": "fr",
                "email": "shopper@example.com",
                "offer_id": "string",
                "shopify_variant_id": "45000000001"
              }
            }
          }
        }
      }
    },
    "/preorders/templates/payment_failed": {
      "get": {
        "operationId": "get_preorders_templates_payment_failed",
        "summary": "Payment Failed",
        "description": "Read the preorder payment-failed notification's email copy (it has no SMS). ?locale= picks the language (omit it for the shop default).",
        "tags": [
          "Preorders · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "payment failed email"
        ],
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_templates_payment_failed",
        "summary": "Payment Failed",
        "description": "Update the payment-failed email STOQ sends when the remaining balance of a partially paid preorder cannot be charged: its subject, heading, body, button text and optional Klaviyo flow. The body is the GET shape, email{...}; an optional body `locale` writes the copy in that language only (omit it for the shop default).\n\n**Note:** Deep partial: absent fields are unchanged, unknown or read-only keys are rejected. Errors are 422 keyed \"template.<path>\". Returns the template.",
        "tags": [
          "Preorders · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "change payment collection email"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "email": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "subject": {
                        "type": "string",
                        "description": "Email subject of the payment-failed email, sent when the remaining balance of a partially paid preorder cannot be charged."
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading at the top of the payment-failed email."
                      },
                      "body": {
                        "type": "string",
                        "description": "Message body of the payment-failed email."
                      },
                      "button_text": {
                        "type": "string",
                        "description": "Text of the button that takes the customer to complete the payment."
                      },
                      "klaviyo_flow_name": {
                        "type": "string",
                        "description": "Klaviyo flow to trigger when a preorder payment fails, instead of sending the email here. Only used while the email platform is Klaviyo."
                      }
                    }
                  },
                  "locale": {
                    "type": "string",
                    "description": "Language the translated fields are written in, such as 'fr' or 'pt-BR'. Omitted: the shop's default language. Untranslated fields ignore it."
                  }
                }
              },
              "example": {
                "email": {
                  "subject": "string",
                  "heading": "string",
                  "body": "string",
                  "button_text": "Preorder now",
                  "klaviyo_flow_name": "Summer Sneaker Drop"
                },
                "locale": "fr"
              }
            }
          }
        }
      }
    },
    "/preorders/templates/shipping_update": {
      "get": {
        "operationId": "get_preorders_templates_shipping_update",
        "summary": "Shipping Update",
        "description": "Read the preorder shipping-update notification's email copy (it has no SMS). ?locale= picks the language (omit it for the shop default).",
        "tags": [
          "Preorders · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the requested resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "shipping update email copy"
        ],
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "fr"
          }
        ]
      },
      "patch": {
        "operationId": "patch_preorders_templates_shipping_update",
        "summary": "Shipping Update",
        "description": "Update the shipping-update email STOQ sends when a preorder ships late or its date changes: its subject, heading, body and optional Klaviyo flow. The body is the GET shape, email{...}; an optional body `locale` writes the copy in that language only (omit it for the shop default).\n\n**Note:** Deep partial: absent fields are unchanged, unknown or read-only keys are rejected. Errors are 422 keyed \"template.<path>\". Returns the template.",
        "tags": [
          "Preorders · Templates"
        ],
        "responses": {
          "200": {
            "description": "Success — the updated resource.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Saved. Returns the updated section, with also_changed for cascades.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyKeyInProgress"
          },
          "422": {
            "description": "Invalid fields: one `details` entry per field error, its `path` the canonical section path. Nothing was saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "errors": [
                    "widget.button.text_color must be a hex color"
                  ],
                  "code": "invalid_params",
                  "details": [
                    {
                      "code": "invalid_params",
                      "message": "must be a hex color",
                      "path": "widget.button.text_color",
                      "value": "blue",
                      "expected": {
                        "type": "string"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-aliases": [
          "change shipping update email"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "email": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "subject": {
                        "type": "string",
                        "description": "Email subject of the shipping-update email. Liquid variables such as {{order.name}} work."
                      },
                      "heading": {
                        "type": "string",
                        "description": "Heading at the top of the shipping-update email."
                      },
                      "body": {
                        "type": "string",
                        "description": "Message body of the shipping-update email."
                      },
                      "klaviyo_flow_name": {
                        "type": "string",
                        "description": "Klaviyo flow to trigger for the shipping update instead of sending it here. Only used while the email platform is Klaviyo."
                      }
                    }
                  },
                  "locale": {
                    "type": "string",
                    "description": "Language the translated fields are written in, such as 'fr' or 'pt-BR'. Omitted: the shop's default language. Untranslated fields ignore it."
                  }
                }
              },
              "example": {
                "email": {
                  "subject": "string",
                  "heading": "string",
                  "body": "string",
                  "klaviyo_flow_name": "Summer Sneaker Drop"
                },
                "locale": "fr"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Auth-Token"
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "description": "A fresh unique key for every write (a new UUID, say); reuse it only to retry that write. Keys are remembered for 1 hour: the same key and the same request within that hour returns the first result, with `Idempotent-Replayed: true`, without running again; the same key with a different method, path or body is refused (422 `idempotency_key_reused`); a retry while the first is still running gets 409 `idempotency_key_in_progress`. Keys are per store. Server errors and rate limits are not kept, so their retry runs."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Error envelope returned by every failed request. `errors` is always an array of strings (\"<path> <message>\" for a field error); `details` holds one object per string, in the same order. Neither ever changes shape: new information is only added as new keys on `details` entries. Branch on `code` and `details[].code`/`path`, not on message text, which may be reworded.",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            }
          },
          "code": {
            "type": "string",
            "enum": [
              "auth_required",
              "auth_invalid",
              "shopify_reauth_required",
              "insufficient_scope",
              "action_not_found",
              "not_found",
              "conflict",
              "invalid_params",
              "validation_failed",
              "invalid_arguments",
              "idempotency_key_invalid",
              "unauthorized",
              "forbidden",
              "rate_limited",
              "shopify_rate_limited",
              "upstream_unavailable",
              "shopify_error",
              "batch_too_large",
              "internal_error",
              "unmapped_settings",
              "unknown_integration",
              "invalid_state",
              "job_in_progress",
              "already_connected",
              "already_sent",
              "order_closed",
              "idempotency_key_reused",
              "idempotency_key_in_progress",
              "plan_required",
              "quantity_limit_reached",
              "over_limit",
              "preflight_issues",
              "use_key_link",
              "key_rejected",
              "not_applicable",
              "invalid_option",
              "provider_error",
              "delivery_failed",
              "fetch_failed",
              "hold_failed",
              "no_fulfillment_orders",
              "usage_charge_disabled",
              "sms_not_allowed",
              "restricted_content_unverified",
              "restricted_content",
              "customer_unsubscribed",
              "not_plus",
              "missing_amount",
              "invalid_amount",
              "unknown_line_items"
            ],
            "description": "Machine-readable error code; each has a page at `type` and an entry in `x-error-codes`."
          },
          "type": {
            "type": "string",
            "format": "uri",
            "description": "The code's docs page."
          }
        },
        "required": [
          "errors",
          "details"
        ],
        "example": {
          "errors": [
            "name is required"
          ],
          "code": "validation_failed",
          "details": [
            {
              "code": "validation_failed",
              "message": "name is required",
              "path": null,
              "value": null,
              "expected": null
            }
          ]
        }
      },
      "ErrorDetail": {
        "type": "object",
        "description": "One error. All five keys are always present; a key that does not apply is null.",
        "properties": {
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "`invalid_params` for a field error, else the failure's error code."
          },
          "message": {
            "type": "string",
            "description": "What went wrong, for people. May be reworded; do not parse it."
          },
          "path": {
            "type": [
              "string",
              "null"
            ],
            "description": "The dotted request field at fault, in API terms."
          },
          "value": {
            "description": "The value sent at `path`; null for secret-named fields or when there is no path."
          },
          "expected": {
            "type": [
              "object",
              "null"
            ],
            "description": "The JSON Schema of the field at `path`, where known."
          }
        },
        "required": [
          "code",
          "message",
          "path",
          "value",
          "expected"
        ]
      },
      "JobAccepted": {
        "type": "object",
        "description": "Returned for async/bulk work — poll the job until it reaches a terminal state.",
        "properties": {
          "job_id": {
            "type": "string"
          },
          "status_url": {
            "type": "string"
          }
        },
        "example": {
          "job_id": "job_a1b2c3",
          "status_url": "/api/v2/external/jobs/job_a1b2c3"
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid `X-Auth-Token`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "errors": [
                "Invalid API key"
              ],
              "code": "auth_invalid",
              "details": [
                {
                  "code": "auth_invalid",
                  "message": "Invalid API key",
                  "path": null,
                  "value": null,
                  "expected": null
                }
              ]
            }
          }
        }
      },
      "NotFound": {
        "description": "The resource does not exist for this shop, or the action path is not registered.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "errors": [
                "Offer not found"
              ],
              "code": "not_found",
              "details": [
                {
                  "code": "not_found",
                  "message": "Offer not found",
                  "path": null,
                  "value": null,
                  "expected": null
                }
              ]
            }
          }
        }
      },
      "Conflict": {
        "description": "Invalid lifecycle transition — read the message; don't retry blindly. Also returned while an earlier request with the same Idempotency-Key is still running.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "errors": [
                "Offer is already disabled"
              ],
              "code": "conflict",
              "details": [
                {
                  "code": "conflict",
                  "message": "Offer is already disabled",
                  "path": null,
                  "value": null,
                  "expected": null
                }
              ]
            }
          }
        }
      },
      "IdempotencyKeyInProgress": {
        "description": "An earlier request with the same Idempotency-Key is still running. Wait, then resend the same request with the same key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "errors": [
                "A request with this Idempotency-Key is still running"
              ],
              "code": "idempotency_key_in_progress",
              "details": [
                {
                  "code": "idempotency_key_in_progress",
                  "message": "A request with this Idempotency-Key is still running",
                  "path": null,
                  "value": null,
                  "expected": null
                }
              ]
            }
          }
        }
      },
      "ValidationError": {
        "description": "The request failed validation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "errors": [
                "name is required"
              ],
              "code": "validation_failed",
              "details": [
                {
                  "code": "validation_failed",
                  "message": "name is required",
                  "path": null,
                  "value": null,
                  "expected": null
                }
              ]
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limited — cost-weighted per token (read 1, write 2; 360 points / 60s). Check `Retry-After`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "errors": [
                "Rate limit exceeded"
              ],
              "code": "rate_limited",
              "details": [
                {
                  "code": "rate_limited",
                  "message": "Rate limit exceeded",
                  "path": null,
                  "value": null,
                  "expected": null
                }
              ]
            }
          }
        }
      }
    }
  },
  "x-error-codes": [
    {
      "code": "auth_required",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/auth-required/",
      "title": "API key required",
      "status": 401,
      "detail": "Send the store's API key as the X-Auth-Token header (the MCP server also takes Authorization: Bearer <key>). The merchant finds it in STOQ → Back in stock alerts → Integrations → API Key; see https://docs.stoqapp.com/docs/api-key/",
      "meaning": "The request reached a protected endpoint without any credential.",
      "fix": "Send the store's API key in the X-Auth-Token header (or Authorization: Bearer <key>).",
      "example": {
        "code": "auth_required",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/auth-required/",
        "title": "API key required",
        "status": 401,
        "detail": "API key required. Send the store's API key as the X-Auth-Token header (the MCP server also takes Authorization: Bearer <key>). The merchant finds it in STOQ → Back in stock alerts → Integrations → API Key; see https://docs.stoqapp.com/docs/api-key/",
        "errors": [
          "API key required"
        ],
        "details": [
          {
            "code": "auth_required",
            "message": "API key required",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "auth_invalid",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/auth-invalid/",
      "title": "API key not valid",
      "status": 401,
      "detail": "The credential sent is not a current STOQ API key: it was mistyped, rotated or revoked. Copy the key again from STOQ → Back in stock alerts → Integrations → API Key and resend; see https://docs.stoqapp.com/docs/api-key/",
      "meaning": "A credential was sent, but it is not a current STOQ API key for any store.",
      "fix": "Copy the key again from the STOQ app's API key page and resend. A rotated or revoked key stays invalid.",
      "example": {
        "code": "auth_invalid",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/auth-invalid/",
        "title": "API key not valid",
        "status": 401,
        "detail": "Invalid API key. The credential sent is not a current STOQ API key: it was mistyped, rotated or revoked. Copy the key again from STOQ → Back in stock alerts → Integrations → API Key and resend; see https://docs.stoqapp.com/docs/api-key/",
        "errors": [
          "Invalid API key"
        ],
        "details": [
          {
            "code": "auth_invalid",
            "message": "Invalid API key",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "shopify_reauth_required",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/shopify-reauth-required/",
      "title": "STOQ's Shopify access expired",
      "status": 401,
      "detail": "Open STOQ in your Shopify admin once to refresh its access.",
      "meaning": "STOQ's own access to the store's Shopify account has expired or was revoked, so the call could not run.",
      "fix": "The merchant opens the STOQ app in Shopify admin and approves the access prompt; then retry.",
      "example": {
        "code": "shopify_reauth_required",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/shopify-reauth-required/",
        "title": "STOQ's Shopify access expired",
        "status": 401,
        "detail": "Shopify access expired. Open STOQ in your Shopify admin once to refresh its access.",
        "errors": [
          "Shopify access expired"
        ],
        "details": [
          {
            "code": "shopify_reauth_required",
            "message": "Shopify access expired",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "insufficient_scope",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/insufficient-scope/",
      "title": "Credential lacks the scope",
      "status": 403,
      "detail": "The credential is valid but not for this operation. Reconnect with the scope the operation needs.",
      "meaning": "The credential is valid but was not granted the scope this operation needs.",
      "fix": "Reconnect the client and grant the scope named in the error, then retry.",
      "example": {
        "code": "insufficient_scope",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/insufficient-scope/",
        "title": "Credential lacks the scope",
        "status": 403,
        "detail": "Missing scope: write_preorders. The credential is valid but not for this operation. Reconnect with the scope the operation needs.",
        "errors": [
          "Missing scope: write_preorders"
        ],
        "details": [
          {
            "code": "insufficient_scope",
            "message": "Missing scope: write_preorders",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "action_not_found",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/action-not-found/",
      "title": "No action at this method and path",
      "status": 404,
      "detail": "No v2 action is registered for this method and path. Use one of `suggestions`, or list the actions under the nearest scope at `help_url`.",
      "meaning": "No action is registered for this HTTP method and path.",
      "fix": "Check the verb and path against `suggestions`, or list the actions under the nearest scope at `help_url`.",
      "example": {
        "code": "action_not_found",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/action-not-found/",
        "title": "No action at this method and path",
        "status": 404,
        "detail": "No v2 action registered for POST /preorders/offerz. No v2 action is registered for this method and path. Use one of `suggestions`, or list the actions under the nearest scope at `help_url`.",
        "errors": [
          "No v2 action registered for POST /preorders/offerz"
        ],
        "details": [
          {
            "code": "action_not_found",
            "message": "No v2 action registered for POST /preorders/offerz",
            "path": null,
            "value": null,
            "expected": null
          }
        ],
        "suggestions": [
          {
            "method": "POST",
            "path": "/preorders/offers"
          }
        ]
      }
    },
    {
      "code": "not_found",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/not-found/",
      "title": "Resource not found",
      "status": 404,
      "detail": "Nothing with this id exists in this store. List the resource (GET the parent path) to find a valid id.",
      "meaning": "The path is valid but nothing with that id exists in this store.",
      "fix": "GET the parent collection to find a valid id. Ids from another store never resolve.",
      "example": {
        "code": "not_found",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/not-found/",
        "title": "Resource not found",
        "status": 404,
        "detail": "Preorder offer not found: 5b2e. Nothing with this id exists in this store. List the resource (GET the parent path) to find a valid id.",
        "errors": [
          "Preorder offer not found: 5b2e"
        ],
        "details": [
          {
            "code": "not_found",
            "message": "Preorder offer not found: 5b2e",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "conflict",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/conflict/",
      "title": "Not allowed in the current state",
      "status": 409,
      "detail": "The resource's current state does not allow this. Read it, then choose an action valid for that state; retrying unchanged fails the same way.",
      "meaning": "The request is well formed, but the resource's current state does not allow it.",
      "fix": "Read the resource, pick an action valid for its state (or send `force: true` where the action allows it). Retrying unchanged fails again.",
      "example": {
        "code": "conflict",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/conflict/",
        "title": "Not allowed in the current state",
        "status": 409,
        "detail": "Cannot release: order is already cancelled. The resource's current state does not allow this. Read it, then choose an action valid for that state; retrying unchanged fails the same way.",
        "errors": [
          "Cannot release: order is already cancelled."
        ],
        "details": [
          {
            "code": "conflict",
            "message": "Cannot release: order is already cancelled.",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "invalid_params",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/invalid-params/",
      "title": "Invalid parameters",
      "status": 422,
      "detail": "Fix each entry in `details` (its `path`, `message`, the `value` sent and, where known, the `expected` schema) and resend. The full request schema is at `help_url`.",
      "meaning": "One or more fields failed the action's schema.",
      "fix": "Fix each `details` entry (its `path`, `message`, the `value` sent and the `expected` schema) and resend.",
      "example": {
        "code": "invalid_params",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/invalid-params/",
        "title": "Invalid parameters",
        "status": 422,
        "detail": "mode must be one of: auto, manual. Fix each entry in `details` (its `path`, `message`, the `value` sent and, where known, the `expected` schema) and resend. The full request schema is at `help_url`.",
        "errors": [
          "mode must be one of: auto, manual"
        ],
        "details": [
          {
            "code": "invalid_params",
            "message": "must be one of: auto, manual",
            "path": "mode",
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "validation_failed",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/validation-failed/",
      "title": "Request refused",
      "status": 422,
      "detail": "Change the request as `errors` describes and resend. The request schema and notes are at `help_url`.",
      "meaning": "The action refused the request for a reason that is not a single bad field.",
      "fix": "Change the request as `errors` describes and resend; the schema and notes are at `help_url`.",
      "example": {
        "code": "validation_failed",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/validation-failed/",
        "title": "Request refused",
        "status": 422,
        "detail": "Too many order_ids: 1200 (max 1000 per request) Change the request as `errors` describes and resend. The request schema and notes are at `help_url`.",
        "errors": [
          "Too many order_ids: 1200 (max 1000 per request)"
        ],
        "details": [
          {
            "code": "validation_failed",
            "message": "Too many order_ids: 1200 (max 1000 per request)",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "invalid_arguments",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/invalid-arguments/",
      "title": "Invalid tool arguments",
      "status": 422,
      "detail": "The arguments do not match the tool's inputSchema (tools/list). Fix them and call the tool again.",
      "meaning": "An MCP tool call's arguments do not match the tool's inputSchema.",
      "fix": "Read the tool's inputSchema from tools/list, fix the arguments and call the tool again.",
      "example": {
        "code": "invalid_arguments",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/invalid-arguments/",
        "title": "Invalid tool arguments",
        "status": 422,
        "detail": "Invalid tool arguments. The arguments do not match the tool's inputSchema (tools/list). Fix them and call the tool again.",
        "errors": [
          "Invalid tool arguments"
        ],
        "details": [
          {
            "code": "invalid_arguments",
            "message": "Invalid tool arguments",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "idempotency_key_invalid",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/idempotency-key-invalid/",
      "title": "Idempotency key not valid",
      "status": 422,
      "detail": "Send 1 to 255 visible ASCII characters, such as a UUID, and a new key for each new request.",
      "meaning": "The Idempotency-Key header is empty, longer than 255 characters or has characters other than visible ASCII.",
      "fix": "Send 1 to 255 visible ASCII characters, such as a UUID, and a new key for each new request.",
      "example": {
        "code": "idempotency_key_invalid",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/idempotency-key-invalid/",
        "title": "Idempotency key not valid",
        "status": 422,
        "detail": "Idempotency-Key is not valid. Send 1 to 255 visible ASCII characters, such as a UUID, and a new key for each new request.",
        "errors": [
          "Idempotency-Key is not valid"
        ],
        "details": [
          {
            "code": "idempotency_key_invalid",
            "message": "Idempotency-Key is not valid",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "unauthorized",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/unauthorized/",
      "title": "Not authorized",
      "status": 401,
      "detail": "This action needs a credential that it did not get.",
      "meaning": "The action needs a credential and did not get one that works.",
      "fix": "Send a valid API key as for `auth_required`.",
      "example": {
        "code": "unauthorized",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/unauthorized/",
        "title": "Not authorized",
        "status": 401,
        "detail": "Not authorized. This action needs a credential that it did not get.",
        "errors": [
          "Not authorized"
        ],
        "details": [
          {
            "code": "unauthorized",
            "message": "Not authorized",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "forbidden",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/forbidden/",
      "title": "Forbidden",
      "status": 403,
      "detail": "This store's plan or settings do not allow the operation.",
      "meaning": "The credential is valid, but the store's plan or settings do not allow this operation.",
      "fix": "Check the plan or setting named in the error; the merchant can change it in the STOQ app.",
      "example": {
        "code": "forbidden",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/forbidden/",
        "title": "Forbidden",
        "status": 403,
        "detail": "Not available on this plan. This store's plan or settings do not allow the operation.",
        "errors": [
          "Not available on this plan"
        ],
        "details": [
          {
            "code": "forbidden",
            "message": "Not available on this plan",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "rate_limited",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/rate-limited/",
      "title": "Rate limit exceeded",
      "status": 429,
      "detail": "This API key spent its points for the window. Wait `retry_after` seconds (the Retry-After header), then retry; reads cost fewer points than writes.",
      "meaning": "This API key used all of its points for the current window.",
      "fix": "Wait `retry_after` seconds (the Retry-After header) and retry. Reads cost fewer points than writes.",
      "example": {
        "code": "rate_limited",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/rate-limited/",
        "title": "Rate limit exceeded",
        "status": 429,
        "detail": "Rate limit exceeded. This API key spent its points for the window. Wait `retry_after` seconds (the Retry-After header), then retry; reads cost fewer points than writes.",
        "errors": [
          "Rate limit exceeded"
        ],
        "details": [
          {
            "code": "rate_limited",
            "message": "Rate limit exceeded",
            "path": null,
            "value": null,
            "expected": null
          }
        ],
        "retry_after": 12
      }
    },
    {
      "code": "shopify_rate_limited",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/shopify-rate-limited/",
      "title": "Shopify rate limit reached",
      "status": 429,
      "detail": "Shopify throttled this store's Admin API. Nothing was changed; retry after `retry_after` seconds.",
      "meaning": "Shopify throttled the store's Admin API, so the call was not made.",
      "fix": "Nothing changed. Retry after `retry_after` seconds.",
      "example": {
        "code": "shopify_rate_limited",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/shopify-rate-limited/",
        "title": "Shopify rate limit reached",
        "status": 429,
        "detail": "Shopify rate limit reached. Shopify throttled this store's Admin API. Nothing was changed; retry after `retry_after` seconds.",
        "errors": [
          "Shopify rate limit reached"
        ],
        "details": [
          {
            "code": "shopify_rate_limited",
            "message": "Shopify rate limit reached",
            "path": null,
            "value": null,
            "expected": null
          }
        ],
        "retry_after": 4
      }
    },
    {
      "code": "upstream_unavailable",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/upstream-unavailable/",
      "title": "Upstream unavailable",
      "status": 503,
      "detail": "A service this answer depends on did not respond. Retry with backoff.",
      "meaning": "A service the answer depends on did not respond in time.",
      "fix": "Retry with exponential backoff. Reads are safe to repeat; for a write, read the resource first.",
      "example": {
        "code": "upstream_unavailable",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/upstream-unavailable/",
        "title": "Upstream unavailable",
        "status": 503,
        "detail": "Upstream unavailable. A service this answer depends on did not respond. Retry with backoff.",
        "errors": [
          "Upstream unavailable"
        ],
        "details": [
          {
            "code": "upstream_unavailable",
            "message": "Upstream unavailable",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "shopify_error",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/shopify-error/",
      "title": "Shopify call failed",
      "status": 502,
      "detail": "A Shopify call this operation needs failed. Read the resource before retrying: part of it may have run.",
      "meaning": "A Shopify call the operation needs failed after the operation had started.",
      "fix": "Read the resource before retrying: part of the operation may already have run.",
      "example": {
        "code": "shopify_error",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/shopify-error/",
        "title": "Shopify call failed",
        "status": 502,
        "detail": "Shopify call failed. A Shopify call this operation needs failed. Read the resource before retrying: part of it may have run.",
        "errors": [
          "Shopify call failed"
        ],
        "details": [
          {
            "code": "shopify_error",
            "message": "Shopify call failed",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "batch_too_large",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/batch-too-large/",
      "title": "Batch too large",
      "status": 400,
      "detail": "Split the JSON-RPC batch into smaller batches and send them one after another.",
      "meaning": "A JSON-RPC batch sent to the MCP endpoint has more calls than one batch may hold.",
      "fix": "Split the batch into smaller batches and send them one after another.",
      "example": {
        "code": "batch_too_large",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/batch-too-large/",
        "title": "Batch too large",
        "status": 400,
        "detail": "Batch too large. Split the JSON-RPC batch into smaller batches and send them one after another.",
        "errors": [
          "Batch too large"
        ],
        "details": [
          {
            "code": "batch_too_large",
            "message": "Batch too large",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "internal_error",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/internal-error/",
      "title": "Internal server error",
      "status": 500,
      "detail": "STOQ failed on its side; the request itself may be fine. Retry once; if it fails again, report the `request_id` to STOQ support.",
      "meaning": "STOQ failed on its side while handling the request.",
      "fix": "Retry once. If it fails again, send the `request_id` to STOQ support.",
      "example": {
        "code": "internal_error",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/internal-error/",
        "title": "Internal server error",
        "status": 500,
        "detail": "Internal server error. STOQ failed on its side; the request itself may be fine. Retry once; if it fails again, report the `request_id` to STOQ support.",
        "errors": [
          "Internal server error"
        ],
        "details": [
          {
            "code": "internal_error",
            "message": "Internal server error",
            "path": null,
            "value": null,
            "expected": null
          }
        ],
        "request_id": "3f1c9a2e"
      }
    },
    {
      "code": "unmapped_settings",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/unmapped-settings/",
      "title": "Some settings have no writable field",
      "status": 422,
      "detail": "Remove the listed settings, or find the action that owns them with the search tool or GET /help.",
      "meaning": "The request named settings this action cannot write.",
      "fix": "Remove the listed settings, or find the action that owns them with the search tool or GET /help.",
      "example": {
        "code": "unmapped_settings",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/unmapped-settings/",
        "title": "Some settings have no writable field",
        "status": 422,
        "detail": "These settings cannot be written here: button_style. Remove the listed settings, or find the action that owns them with the search tool or GET /help.",
        "errors": [
          "These settings cannot be written here: button_style"
        ],
        "details": [
          {
            "code": "unmapped_settings",
            "message": "These settings cannot be written here: button_style",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "unknown_integration",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/unknown-integration/",
      "title": "Unknown integration",
      "status": 404,
      "detail": "Use one of the ids listed in the message.",
      "meaning": "The integration id is not one STOQ supports.",
      "fix": "Use one of the ids listed in the message.",
      "example": {
        "code": "unknown_integration",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/unknown-integration/",
        "title": "Unknown integration",
        "status": 404,
        "detail": "id must be one of: klaviyo, mailchimp, postscript. Use one of the ids listed in the message.",
        "errors": [
          "id must be one of: klaviyo, mailchimp, postscript"
        ],
        "details": [
          {
            "code": "unknown_integration",
            "message": "id must be one of: klaviyo, mailchimp, postscript",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "invalid_state",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/invalid-state/",
      "title": "The order is in the wrong state for this operation",
      "status": 409,
      "detail": "Read the order to see its state. Some operations accept `force: true`; the action's /help notes say which.",
      "meaning": "The order's current state rules this operation out, such as releasing a cancelled order.",
      "fix": "Read the order to see its state. Some operations accept `force: true`; the action's /help notes say which.",
      "example": {
        "code": "invalid_state",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/invalid-state/",
        "title": "The order is in the wrong state for this operation",
        "status": 409,
        "detail": "Cannot release: order is already cancelled. Read the order to see its state. Some operations accept `force: true`; the action's /help notes say which.",
        "errors": [
          "Cannot release: order is already cancelled."
        ],
        "details": [
          {
            "code": "invalid_state",
            "message": "Cannot release: order is already cancelled.",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "job_in_progress",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/job-in-progress/",
      "title": "A job is already running on this resource",
      "status": 409,
      "detail": "Poll the job named in the message until it finishes, then retry.",
      "meaning": "An earlier bulk change on the same resource is still running.",
      "fix": "Poll the job named in the message until it finishes, then retry.",
      "example": {
        "code": "job_in_progress",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/job-in-progress/",
        "title": "A job is already running on this resource",
        "status": 409,
        "detail": "An inventory policy change is still running on this offer. Poll /api/v2/external/jobs/job_a1b2c3 and try again once it completes. Poll the job named in the message until it finishes, then retry.",
        "errors": [
          "An inventory policy change is still running on this offer. Poll /api/v2/external/jobs/job_a1b2c3 and try again once it completes."
        ],
        "details": [
          {
            "code": "job_in_progress",
            "message": "An inventory policy change is still running on this offer. Poll /api/v2/external/jobs/job_a1b2c3 and try again once it completes.",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "already_connected",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/already-connected/",
      "title": "The integration is already connected",
      "status": 409,
      "detail": "Send `reconnect: true` to replace the connection.",
      "meaning": "The store already has this integration connected.",
      "fix": "Send `reconnect: true` to replace the connection.",
      "example": {
        "code": "already_connected",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/already-connected/",
        "title": "The integration is already connected",
        "status": 409,
        "detail": "Klaviyo is already connected. Send reconnect: true to replace it. Send `reconnect: true` to replace the connection.",
        "errors": [
          "Klaviyo is already connected. Send reconnect: true to replace it."
        ],
        "details": [
          {
            "code": "already_connected",
            "message": "Klaviyo is already connected. Send reconnect: true to replace it.",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "already_sent",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/already-sent/",
      "title": "Already sent in this bulk operation",
      "status": 422,
      "detail": "Nothing to do; the customer already has the message.",
      "meaning": "This message was already sent to the order earlier in the same bulk operation.",
      "fix": "Nothing to do; the customer already has the message.",
      "example": {
        "code": "already_sent",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/already-sent/",
        "title": "Already sent in this bulk operation",
        "status": 422,
        "detail": "Confirmation email was already sent in this bulk operation. Nothing to do; the customer already has the message.",
        "errors": [
          "Confirmation email was already sent in this bulk operation"
        ],
        "details": [
          {
            "code": "already_sent",
            "message": "Confirmation email was already sent in this bulk operation",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "order_closed",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/order-closed/",
      "title": "The order is cancelled or refunded",
      "status": 422,
      "detail": "Skip this order.",
      "meaning": "Shipping updates are not sent for cancelled or refunded orders.",
      "fix": "Skip this order.",
      "example": {
        "code": "order_closed",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/order-closed/",
        "title": "The order is cancelled or refunded",
        "status": 422,
        "detail": "Shipping updates are not sent for cancelled or refunded orders. Skip this order.",
        "errors": [
          "Shipping updates are not sent for cancelled or refunded orders"
        ],
        "details": [
          {
            "code": "order_closed",
            "message": "Shipping updates are not sent for cancelled or refunded orders",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "idempotency_key_reused",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/idempotency-key-reused/",
      "title": "Idempotency-Key reused with a different request",
      "status": 422,
      "detail": "Send a new Idempotency-Key for a new request. Reuse a key only to retry the identical request.",
      "meaning": "The Idempotency-Key header was already used for a request with a different method, path or body. Keys are remembered for 1 hour.",
      "fix": "Send a new Idempotency-Key for a new request. Reuse a key only to retry the identical request.",
      "example": {
        "code": "idempotency_key_reused",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/idempotency-key-reused/",
        "title": "Idempotency-Key reused with a different request",
        "status": 422,
        "detail": "This Idempotency-Key was already used for a different request. Send a new Idempotency-Key for a new request. Reuse a key only to retry the identical request.",
        "errors": [
          "This Idempotency-Key was already used for a different request"
        ],
        "details": [
          {
            "code": "idempotency_key_reused",
            "message": "This Idempotency-Key was already used for a different request",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "idempotency_key_in_progress",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/idempotency-key-in-progress/",
      "title": "The first request with this Idempotency-Key is still running",
      "status": 409,
      "detail": "Wait a moment, then retry with the same key to get the first request's response.",
      "meaning": "A request with the same Idempotency-Key has not finished yet.",
      "fix": "Wait a moment, then retry with the same key to get the first request's response.",
      "example": {
        "code": "idempotency_key_in_progress",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/idempotency-key-in-progress/",
        "title": "The first request with this Idempotency-Key is still running",
        "status": 409,
        "detail": "A request with this Idempotency-Key is still in progress. Wait a moment, then retry with the same key to get the first request's response.",
        "errors": [
          "A request with this Idempotency-Key is still in progress"
        ],
        "details": [
          {
            "code": "idempotency_key_in_progress",
            "message": "A request with this Idempotency-Key is still in progress",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "plan_required",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/plan-required/",
      "title": "Needs a paid STOQ plan",
      "status": 403,
      "detail": "Ask the merchant to upgrade in the STOQ dashboard (Settings, then Plans), or leave the paid-only fields out.",
      "meaning": "The change uses a feature that is only available on a paid STOQ plan. Connecting a paid-only integration returns 403; a write that sets paid-only fields returns 422 and saves nothing.",
      "fix": "Ask the merchant to upgrade in the STOQ dashboard (Settings, then Plans), or leave the paid-only fields out.",
      "example": {
        "code": "plan_required",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/plan-required/",
        "title": "Needs a paid STOQ plan",
        "status": 403,
        "detail": "Partial payments are only available on a paid plan. Upgrade to enable it. Ask the merchant to upgrade in the STOQ dashboard (Settings, then Plans), or leave the paid-only fields out.",
        "errors": [
          "Partial payments are only available on a paid plan. Upgrade to enable it."
        ],
        "details": [
          {
            "code": "plan_required",
            "message": "Partial payments are only available on a paid plan. Upgrade to enable it.",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "quantity_limit_reached",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/quantity-limit-reached/",
      "title": "Variants are at their preorder quantity limit",
      "status": 422,
      "detail": "Raise the quantity limit on the offer, or target variants still under it.",
      "meaning": "Every targeted variant has reached its preorder quantity limit, so STOQ keeps it from selling.",
      "fix": "Raise the quantity limit on the offer, or target variants still under it.",
      "example": {
        "code": "quantity_limit_reached",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/quantity-limit-reached/",
        "title": "Variants are at their preorder quantity limit",
        "status": 422,
        "detail": "Blue Tee has reached its preorder quantity limit (50). Raise the quantity limit on the offer, or target variants still under it.",
        "errors": [
          "Blue Tee has reached its preorder quantity limit (50)."
        ],
        "details": [
          {
            "code": "quantity_limit_reached",
            "message": "Blue Tee has reached its preorder quantity limit (50).",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "over_limit",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/over-limit/",
      "title": "Too many orders for one bulk operation",
      "status": 422,
      "detail": "Narrow the filters, or select orders by id in smaller batches.",
      "meaning": "The bulk operation matched more orders than one request can process.",
      "fix": "Narrow the filters, or select orders by id in smaller batches.",
      "example": {
        "code": "over_limit",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/over-limit/",
        "title": "Too many orders for one bulk operation",
        "status": 422,
        "detail": "Too many orders for one bulk operation. Narrow the filters, or select orders by id in smaller batches.",
        "errors": [
          "Too many orders for one bulk operation"
        ],
        "details": [
          {
            "code": "over_limit",
            "message": "Too many orders for one bulk operation",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "preflight_issues",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/preflight-issues/",
      "title": "The variants failed pre-flight checks",
      "status": 422,
      "detail": "Fix or leave out the variants listed in `preflight`, then retry.",
      "meaning": "Some variants cannot be added to the offer as requested. The `preflight` field lists each one and why.",
      "fix": "Fix or leave out the variants listed in `preflight`, then retry.",
      "example": {
        "code": "preflight_issues",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/preflight-issues/",
        "title": "The variants failed pre-flight checks",
        "status": 422,
        "detail": "2 variants can't be added. Fix or leave out the variants listed in `preflight`, then retry.",
        "errors": [
          "2 variants can't be added"
        ],
        "details": [
          {
            "code": "preflight_issues",
            "message": "2 variants can't be added",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "use_key_link",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/use-key-link/",
      "title": "Enter API keys in STOQ, not through the API",
      "status": 422,
      "detail": "Show `key_url` to the merchant. Don't ask for the key.",
      "meaning": "Through an assistant or MCP, a third-party API key would pass through a model, so STOQ refuses it and returns the dashboard link where the merchant enters it.",
      "fix": "Show `key_url` to the merchant. Don't ask for the key.",
      "example": {
        "code": "use_key_link",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/use-key-link/",
        "title": "Enter API keys in STOQ, not through the API",
        "status": 422,
        "detail": "Nothing was saved. API keys are entered in STOQ, not through the API. Show `key_url` to the merchant. Don't ask for the key.",
        "errors": [
          "Nothing was saved. API keys are entered in STOQ, not through the API."
        ],
        "details": [
          {
            "code": "use_key_link",
            "message": "Nothing was saved. API keys are entered in STOQ, not through the API.",
            "path": "api_key",
            "value": null,
            "expected": null
          }
        ],
        "path": "api_key",
        "key_url": "https://admin.shopify.com/store/your-store/apps/restockrocket/settings/integrations"
      }
    },
    {
      "code": "key_rejected",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/key-rejected/",
      "title": "The provider refused the API key",
      "status": 422,
      "detail": "Check the key in the provider's dashboard and send it again.",
      "meaning": "The integration provider rejected the API key. Nothing was saved.",
      "fix": "Check the key in the provider's dashboard and send it again.",
      "example": {
        "code": "key_rejected",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/key-rejected/",
        "title": "The provider refused the API key",
        "status": 422,
        "detail": "Klaviyo refused this API key. Nothing was saved. Check the key in the provider's dashboard and send it again.",
        "errors": [
          "Klaviyo refused this API key. Nothing was saved."
        ],
        "details": [
          {
            "code": "key_rejected",
            "message": "Klaviyo refused this API key. Nothing was saved.",
            "path": "api_key",
            "value": null,
            "expected": null
          }
        ],
        "path": "api_key"
      }
    },
    {
      "code": "not_applicable",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/not-applicable/",
      "title": "The integration does not apply to this store",
      "status": 422,
      "detail": "Read the message for what the integration needs.",
      "meaning": "The integration can't be connected for this store as it is set up.",
      "fix": "Read the message for what the integration needs.",
      "example": {
        "code": "not_applicable",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/not-applicable/",
        "title": "The integration does not apply to this store",
        "status": 422,
        "detail": "Postscript only sends SMS for stores in the US. Read the message for what the integration needs.",
        "errors": [
          "Postscript only sends SMS for stores in the US"
        ],
        "details": [
          {
            "code": "not_applicable",
            "message": "Postscript only sends SMS for stores in the US",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "invalid_option",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/invalid-option/",
      "title": "The integration option is invalid",
      "status": 422,
      "detail": "Correct the option named in `path` and resend.",
      "meaning": "An integration option, such as a Mailchimp list id, was rejected.",
      "fix": "Correct the option named in `path` and resend.",
      "example": {
        "code": "invalid_option",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/invalid-option/",
        "title": "The integration option is invalid",
        "status": 422,
        "detail": "list_id is not a list in this Mailchimp account. Correct the option named in `path` and resend.",
        "errors": [
          "list_id is not a list in this Mailchimp account"
        ],
        "details": [
          {
            "code": "invalid_option",
            "message": "list_id is not a list in this Mailchimp account",
            "path": "list_id",
            "value": null,
            "expected": null
          }
        ],
        "path": "list_id"
      }
    },
    {
      "code": "provider_error",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/provider-error/",
      "title": "The integration provider refused the request",
      "status": 422,
      "detail": "Read the message, fix the account at the provider if needed, then retry.",
      "meaning": "The third-party provider returned an error.",
      "fix": "Read the message, fix the account at the provider if needed, then retry.",
      "example": {
        "code": "provider_error",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/provider-error/",
        "title": "The integration provider refused the request",
        "status": 422,
        "detail": "mailchimp refused the disconnect. Read the message, fix the account at the provider if needed, then retry.",
        "errors": [
          "mailchimp refused the disconnect"
        ],
        "details": [
          {
            "code": "provider_error",
            "message": "mailchimp refused the disconnect",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "delivery_failed",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/delivery-failed/",
      "title": "The message could not be sent",
      "status": 422,
      "detail": "Check the store's sending setup (GET /account/sending), then retry.",
      "meaning": "The email or SMS provider did not accept the message.",
      "fix": "Check the store's sending setup (GET /account/sending), then retry.",
      "example": {
        "code": "delivery_failed",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/delivery-failed/",
        "title": "The message could not be sent",
        "status": 422,
        "detail": "Confirmation email could not be sent. Check the store's sending setup (GET /account/sending), then retry.",
        "errors": [
          "Confirmation email could not be sent"
        ],
        "details": [
          {
            "code": "delivery_failed",
            "message": "Confirmation email could not be sent",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "fetch_failed",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/fetch-failed/",
      "title": "Fulfillment orders could not be read",
      "status": 422,
      "detail": "Retry after a short wait.",
      "meaning": "STOQ could not read the order's fulfillment orders from Shopify.",
      "fix": "Retry after a short wait.",
      "example": {
        "code": "fetch_failed",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/fetch-failed/",
        "title": "Fulfillment orders could not be read",
        "status": 422,
        "detail": "Failed to fetch fulfillment orders. Retry after a short wait.",
        "errors": [
          "Failed to fetch fulfillment orders"
        ],
        "details": [
          {
            "code": "fetch_failed",
            "message": "Failed to fetch fulfillment orders",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "hold_failed",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/hold-failed/",
      "title": "Shopify refused the fulfillment hold",
      "status": 422,
      "detail": "Read the message for Shopify's reason; check the order in the Shopify admin.",
      "meaning": "Shopify rejected holding the order's fulfillment orders.",
      "fix": "Read the message for Shopify's reason; check the order in the Shopify admin.",
      "example": {
        "code": "hold_failed",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/hold-failed/",
        "title": "Shopify refused the fulfillment hold",
        "status": 422,
        "detail": "Failed to hold fulfillments: fulfillment order is closed. Read the message for Shopify's reason; check the order in the Shopify admin.",
        "errors": [
          "Failed to hold fulfillments: fulfillment order is closed"
        ],
        "details": [
          {
            "code": "hold_failed",
            "message": "Failed to hold fulfillments: fulfillment order is closed",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "no_fulfillment_orders",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/no-fulfillment-orders/",
      "title": "The order has no fulfillment orders",
      "status": 422,
      "detail": "Skip this order.",
      "meaning": "Shopify has no fulfillment orders for this order, so there is nothing to hold.",
      "fix": "Skip this order.",
      "example": {
        "code": "no_fulfillment_orders",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/no-fulfillment-orders/",
        "title": "The order has no fulfillment orders",
        "status": 422,
        "detail": "No fulfillment orders found for this order. Skip this order.",
        "errors": [
          "No fulfillment orders found for this order"
        ],
        "details": [
          {
            "code": "no_fulfillment_orders",
            "message": "No fulfillment orders found for this order",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "usage_charge_disabled",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/usage-charge-disabled/",
      "title": "SMS is off because usage charges are disabled",
      "status": 422,
      "detail": "Ask the merchant to turn on usage charges in STOQ, or send an email instead.",
      "meaning": "The store has usage charges turned off, so STOQ does not send SMS.",
      "fix": "Ask the merchant to turn on usage charges in STOQ, or send an email instead.",
      "example": {
        "code": "usage_charge_disabled",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/usage-charge-disabled/",
        "title": "SMS is off because usage charges are disabled",
        "status": 422,
        "detail": "SMS is disabled because usage charges are off for this shop. Ask the merchant to turn on usage charges in STOQ, or send an email instead.",
        "errors": [
          "SMS is disabled because usage charges are off for this shop"
        ],
        "details": [
          {
            "code": "usage_charge_disabled",
            "message": "SMS is disabled because usage charges are off for this shop",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "sms_not_allowed",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/sms-not-allowed/",
      "title": "SMS is not enabled for this store",
      "status": 422,
      "detail": "Ask the merchant to enable SMS in STOQ, or send an email instead.",
      "meaning": "SMS is not enabled for this store.",
      "fix": "Ask the merchant to enable SMS in STOQ, or send an email instead.",
      "example": {
        "code": "sms_not_allowed",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/sms-not-allowed/",
        "title": "SMS is not enabled for this store",
        "status": 422,
        "detail": "SMS is not enabled for this shop. Ask the merchant to enable SMS in STOQ, or send an email instead.",
        "errors": [
          "SMS is not enabled for this shop"
        ],
        "details": [
          {
            "code": "sms_not_allowed",
            "message": "SMS is not enabled for this shop",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "restricted_content_unverified",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/restricted-content-unverified/",
      "title": "SMS needs restricted-content verification",
      "status": 422,
      "detail": "Ask the merchant to complete restricted-content verification in STOQ, or send an email instead.",
      "meaning": "The store sells restricted content and has not completed verification for SMS.",
      "fix": "Ask the merchant to complete restricted-content verification in STOQ, or send an email instead.",
      "example": {
        "code": "restricted_content_unverified",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/restricted-content-unverified/",
        "title": "SMS needs restricted-content verification",
        "status": 422,
        "detail": "SMS requires restricted-content verification for this shop. Ask the merchant to complete restricted-content verification in STOQ, or send an email instead.",
        "errors": [
          "SMS requires restricted-content verification for this shop"
        ],
        "details": [
          {
            "code": "restricted_content_unverified",
            "message": "SMS requires restricted-content verification for this shop",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "restricted_content",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/restricted-content/",
      "title": "The order has content SMS can't carry",
      "status": 422,
      "detail": "Send an email instead.",
      "meaning": "The order contains restricted content that cannot be sent by SMS.",
      "fix": "Send an email instead.",
      "example": {
        "code": "restricted_content",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/restricted-content/",
        "title": "The order has content SMS can't carry",
        "status": 422,
        "detail": "The order contains restricted content that cannot be sent by SMS. Send an email instead.",
        "errors": [
          "The order contains restricted content that cannot be sent by SMS"
        ],
        "details": [
          {
            "code": "restricted_content",
            "message": "The order contains restricted content that cannot be sent by SMS",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "customer_unsubscribed",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/customer-unsubscribed/",
      "title": "The customer unsubscribed from SMS",
      "status": 422,
      "detail": "Send an email instead; don't retry the SMS.",
      "meaning": "The customer opted out of SMS, so no message was sent.",
      "fix": "Send an email instead; don't retry the SMS.",
      "example": {
        "code": "customer_unsubscribed",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/customer-unsubscribed/",
        "title": "The customer unsubscribed from SMS",
        "status": 422,
        "detail": "The customer has unsubscribed from SMS. Send an email instead; don't retry the SMS.",
        "errors": [
          "The customer has unsubscribed from SMS"
        ],
        "details": [
          {
            "code": "customer_unsubscribed",
            "message": "The customer has unsubscribed from SMS",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "not_plus",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/not-plus/",
      "title": "Partial collection needs Shopify Plus",
      "status": 422,
      "detail": "Collect the full balance instead (leave out `amount` and `line_item_ids`).",
      "meaning": "Collecting part of an order's balance uses a Shopify API only available to Shopify Plus stores.",
      "fix": "Collect the full balance instead (leave out `amount` and `line_item_ids`).",
      "example": {
        "code": "not_plus",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/not-plus/",
        "title": "Partial collection needs Shopify Plus",
        "status": 422,
        "detail": "Collecting part of the balance requires Shopify Plus. Collect the full balance instead (leave out `amount` and `line_item_ids`).",
        "errors": [
          "Collecting part of the balance requires Shopify Plus"
        ],
        "details": [
          {
            "code": "not_plus",
            "message": "Collecting part of the balance requires Shopify Plus",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "missing_amount",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/missing-amount/",
      "title": "Amount or line items required",
      "status": 422,
      "detail": "Send `amount` or `line_item_ids`.",
      "meaning": "Collecting a partial payment needs an amount or the line items to collect for.",
      "fix": "Send `amount` or `line_item_ids`.",
      "example": {
        "code": "missing_amount",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/missing-amount/",
        "title": "Amount or line items required",
        "status": 422,
        "detail": "Pass amount or line_item_ids. Send `amount` or `line_item_ids`.",
        "errors": [
          "Pass amount or line_item_ids"
        ],
        "details": [
          {
            "code": "missing_amount",
            "message": "Pass amount or line_item_ids",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "invalid_amount",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/invalid-amount/",
      "title": "Invalid amount",
      "status": 422,
      "detail": "Send `amount` as a string such as \"20.00\".",
      "meaning": "The amount is not a positive decimal with at most 2 places.",
      "fix": "Send `amount` as a string such as \"20.00\".",
      "example": {
        "code": "invalid_amount",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/invalid-amount/",
        "title": "Invalid amount",
        "status": 422,
        "detail": "amount must be a positive decimal with at most 2 places. Send `amount` as a string such as \"20.00\".",
        "errors": [
          "amount must be a positive decimal with at most 2 places"
        ],
        "details": [
          {
            "code": "invalid_amount",
            "message": "amount must be a positive decimal with at most 2 places",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    },
    {
      "code": "unknown_line_items",
      "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/unknown-line-items/",
      "title": "Line items are not on this order",
      "status": 422,
      "detail": "Read the order to get its line item ids, then resend.",
      "meaning": "Some of the line item ids are not on the order.",
      "fix": "Read the order to get its line item ids, then resend.",
      "example": {
        "code": "unknown_line_items",
        "type": "https://docs.stoqapp.com/v2/docs/api-v2/errors/unknown-line-items/",
        "title": "Line items are not on this order",
        "status": 422,
        "detail": "These line items are not on this order: 123. Read the order to get its line item ids, then resend.",
        "errors": [
          "These line items are not on this order: 123"
        ],
        "details": [
          {
            "code": "unknown_line_items",
            "message": "These line items are not on this order: 123",
            "path": null,
            "value": null,
            "expected": null
          }
        ]
      }
    }
  ]
}