Skip to content

Update delivery

BetaAPI v2 is in public beta: endpoints, fields and behaviour can change before general availability. See the changelog

PATCH
/back_in_stock/settings/delivery
curl --request PATCH \
--url https://app.stoqapp.com/api/v2/external/back_in_stock/settings/delivery \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <X-Auth-Token>' \
--data '{ "batching": "string", "stock_threshold": "string", "locations": "string", "any_variant": "string", "send_while_password_protected": "string", "market_setup": "gid://shopify/Market/12345", "market_locations_enabled": "gid://shopify/Market/12345", "alert_on_publish": "string" }'

Update back-in-stock delivery settings (batching, stock threshold, locations, any-variant, password-protected sending, market setup, market-based alerts, alerts on publish).

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.location_ids and any_variant.product_ids are arrays of Shopify numeric ids 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. market_setup is “single_market” or “multiple_markets”; market_locations_enabled turns on market-based alerts; alert_on_publish also alerts when a product is published.

Media typeapplication/json
object
batching
stock_threshold
locations
any_variant
send_while_password_protected
market_setup
market_locations_enabled
alert_on_publish

Example

{
"batching": "string",
"stock_threshold": "string",
"locations": "string",
"any_variant": "string",
"send_while_password_protected": "string",
"market_setup": "gid://shopify/Market/12345",
"market_locations_enabled": "gid://shopify/Market/12345",
"alert_on_publish": "string"
}

Success — the updated resource.

Media typeapplication/json
object

Example generated

{}

Accepted — async/bulk work was queued. Poll the returned job.

Media typeapplication/json

Returned for async/bulk work — poll the job until it reaches a terminal state.

object
job_id
string
status_url
string

Example

{
"job_id": "job_a1b2c3",
"status_url": "/api/v2/external/jobs/job_a1b2c3"
}

Missing or invalid X-Auth-Token.

Media typeapplication/json

Error envelope returned by every failed request.

object
errors
required
Array<string>

Example

{
"errors": [
"Unauthorized"
]
}

The request failed validation.

Media typeapplication/json

Error envelope returned by every failed request.

object
errors
required
Array<string>

Example

{
"errors": [
"name is required"
]
}

Rate limited — cost-weighted per token (read 1, write 2; 360 points / 60s). Check Retry-After.

Media typeapplication/json

Error envelope returned by every failed request.

object
errors
required
Array<string>

Example

{
"errors": [
"Rate limit exceeded"
]
}
Was this page helpful?

Still stuck? Ask Quinn or chat with support