List products
BetaAPI v2 is in public beta: endpoints, fields and behaviour can change before general availability. See the changelog
const url = 'https://app.stoqapp.com/api/v2/external/preorders/products?sort=created_asc&page=string&per_page=string&search=string&product_status=string&offer_ids=string&no_offer_linked=string&include_inventory=string';const options = {method: 'GET', headers: {'X-Auth-Token': '<X-Auth-Token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://app.stoqapp.com/api/v2/external/preorders/products?sort=created_asc&page=string&per_page=string&search=string&product_status=string&offer_ids=string&no_offer_linked=string&include_inventory=string' \ --header 'X-Auth-Token: <X-Auth-Token>'List the variants on the store-wide Preorders > Products tab, with the offers each is linked to, paginated.
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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Example
created_ascExample
stringExample
stringExample
stringExample
stringExample
[ "string"]Example
stringExample
stringResponses
Section titled “Responses”Success — the requested resource.
object
Example generated
{}Missing or invalid X-Auth-Token.
Error envelope returned by every failed request.
object
Example
{ "errors": [ "Unauthorized" ]}The request failed validation.
Error envelope returned by every failed request.
object
Example
{ "errors": [ "name is required" ]}Rate limited — cost-weighted per token (read 1, write 2; 360 points / 60s). Check Retry-After.
Error envelope returned by every failed request.
object
Example
{ "errors": [ "Rate limit exceeded" ]}Thanks for letting us know.
Still stuck? Ask Quinn or chat with support