Change the deposit or ship date across an offer
Worked recipe: move a preorder offer's ship date, move the orders already placed, email those customers, and change the deposit for new orders. Every call, response and error code.
Last updated
For: agencies and merchants whose launch moved: stock lands later, or the client wants a different deposit.
Goal: one offer-wide change that new orders pick up, with the orders already placed moved to the new date and their customers told.
Before you start
Section titled “Before you start”- Credentials: the store’s API key (
X-Auth-Token) or an MCP client signed in to the store. - Plan: a deposit (a partial payment option) and a balance due date are paid features. On the free plan, the payments change fails with
plan_requiredand saves nothing. Moving the ship date works on every plan. - The offer id:
GET /preorders/offers?search=<name>and take theid. - Agree the change with the merchant. A ship date change with
reschedule_existing_ordersmoves every unfulfilled order on the offer, and the shipping update emails every customer you target.
1. Read what’s there now
Section titled “1. Read what’s there now”curl "https://app.stoqapp.com/api/v2/external/preorders/offers/$OFFER_ID/shipping" \ -H "X-Auth-Token: $STOQ_API_KEY"
curl "https://app.stoqapp.com/api/v2/external/preorders/offers/$OFFER_ID/payments" \ -H "X-Auth-Token: $STOQ_API_KEY"
curl "https://app.stoqapp.com/api/v2/external/preorders/offers/$OFFER_ID/shipping/schedulable_orders" \ -H "X-Auth-Token: $STOQ_API_KEY"{ "tool": "execute_read", "arguments": { "method": "GET", "path": "/preorders/offers/<offer_id>/shipping/schedulable_orders" } }shipping has delivery_timing, ships_at and days_after_checkout. payments has options_offered (full, partial or full_and_partial) and, per option, checkout_charge and remaining_balance. schedulable_orders answers { "schedulable_orders_count": 12, "checked_count": 40 }: how many of the offer’s latest 100 orders the reschedule would move (the unfulfilled, uncancelled ones), and how many it looked at. Show the merchant these numbers before you change anything.
2. Move the ship date, and the orders already placed
Section titled “2. Move the ship date, and the orders already placed”curl -X PATCH "https://app.stoqapp.com/api/v2/external/preorders/offers/$OFFER_ID/shipping" \ -H "X-Auth-Token: $STOQ_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "ships_at": "2027-01-15", "timeline": { "shipping_text": "Ships mid-January" }, "reschedule_existing_orders": true }'{ "tool": "execute_write", "arguments": { "method": "PATCH", "path": "/preorders/offers/<offer_id>/shipping", "params": { "ships_at": "2027-01-15", "timeline": { "shipping_text": "Ships mid-January" }, "reschedule_existing_orders": true }, "idempotency_key": "<new uuid>" } }202 Accepted with the shipping settings, plus rescheduled_orders_queued:
{ "timeline": { "scope": "same", "show_shipping_text": true, "shipping_text": "Ships mid-January", "variant_shipping_text": "15 Jan 2027" }, "delivery_timing": "exact_time", "ships_at": "2027-01-15T05:00:00Z", "rescheduled_orders_queued": true, "…": "…"}reschedule_existing_orders: truemoves the scheduled fulfillments of every unfulfilled, uncancelled preorder on the offer to the new date, in the background. It needsdelivery_timingexact_timeafter the save, which sendingships_atgives you. It does not email anyone.- To ship N days after each order instead, send
days_after_checkout: 30in place ofships_at. - Variants with their own shipping text keep it. To set one text on many variants at once, use
POST /preorders/offers/:id/products/variants/bulk_update_settingswithshopify_variant_ids(up to 250) andshipping_text(nullgoes back to the offer’s text).
3. Tell the customers
Section titled “3. Tell the customers”curl -X POST "https://app.stoqapp.com/api/v2/external/preorders/orders/bulk_send_shipping_update" \ -H "X-Auth-Token: $STOQ_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "apply_to_all": true, "offer_id": "6f1c0c0e-2f0a-4c57-9d0f-6a1d5a3a1b11", "cancelled_status": "not_cancelled" }'{ "tool": "execute_write", "arguments": { "method": "POST", "path": "/preorders/orders/bulk_send_shipping_update", "params": { "apply_to_all": true, "offer_id": "<offer_id>", "cancelled_status": "not_cancelled" }, "idempotency_key": "<new uuid>" } }apply_to_all takes the same filters as GET /preorders/orders (here: the offer’s orders that aren’t cancelled). Send order_ids instead for a hand-picked list of up to 1000. subject, header and description override the shipping update template’s copy. 202 Accepted with a job:
{ "job_id": "5b0c2e7e-8f6a-4d1e-9a51-2f3c4d5e6f70", "operation": "send_shipping_update", "status": "queued", "status_url": "/api/v2/external/preorders/orders/jobs/5b0c2e7e-8f6a-4d1e-9a51-2f3c4d5e6f70", "order_count": 47 }Check order_count is what the merchant expects. Poll the job every 5 seconds for the first minute, then every 15:
curl "https://app.stoqapp.com/api/v2/external/preorders/orders/jobs/$JOB_ID" \ -H "X-Auth-Token: $STOQ_API_KEY"{ "job_id": "…", "status": "completed", "total": 47, "processed": 47, "succeeded_count": 46, "failed_count": 1, "succeeded": [ { "id": "…", "shopify_order_id": "gid://shopify/Order/…", "name": "#1042" } ], "failed": [ { "id": "…", "shopify_order_id": "gid://shopify/Order/…", "name": "#1043", "error": "…" } ] }One order failing doesn’t fail the job. Cancelled and refunded orders land in failed. Results are kept for 24 hours.
4. Change the deposit for new orders
Section titled “4. Change the deposit for new orders”Offer both full payment and a 20% deposit, with the balance charged on the ship date:
curl -X PATCH "https://app.stoqapp.com/api/v2/external/preorders/offers/$OFFER_ID/payments" \ -H "X-Auth-Token: $STOQ_API_KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "options_offered": "full_and_partial", "partial": { "checkout_charge": { "charge_type": "percentage", "charge_amount": 20 }, "remaining_balance": { "charge_trigger": "exact_time", "charge_exact_time": "2027-01-15T09:00:00Z" } } }'{ "tool": "execute_write", "arguments": { "method": "PATCH", "path": "/preorders/offers/<offer_id>/payments", "params": { "options_offered": "full_and_partial", "partial": { "checkout_charge": { "charge_type": "percentage", "charge_amount": 20 }, "remaining_balance": { "charge_trigger": "exact_time", "charge_exact_time": "2027-01-15T09:00:00Z" } } }, "idempotency_key": "<new uuid>" } }To make the deposit the option shoppers see first, send { "default_option": "partial" } in a second PATCH once the new option has synced to Shopify (its partial.selling_plan_id is set on GET /preorders/offers/:id/payments). Sent before that, it fails with invalid_params on payments.default_option.
charge_typeispercentage(up to 100) orprice(a fixed amount in the shop’s currency).charge_amount: 0takes nothing at checkout.remaining_balance.charge_triggerisexact_time(withcharge_exact_time) ortime_after_checkout(withdays_after_checkout).- To change only the deposit amount, send only
partial.checkout_charge: the payments PATCH is a deep partial.
202 Accepted with the payments settings, as GET /preorders/offers/:id/payments returns them:
{ "options_offered": "full_and_partial", "default_option": "partial", "full": { "selling_plan_id": "gid://shopify/SellingPlan/…", "checkout_charge": { "charge_type": "percentage", "charge_amount": 100 }, "…": "…" }, "partial": { "selling_plan_id": "gid://shopify/SellingPlan/…", "checkout_charge": { "charge_type": "percentage", "charge_amount": 20 }, "remaining_balance": { "charge_trigger": "exact_time", "charge_exact_time": "2027-01-15T09:00:00Z", "days_after_checkout": null }, "…": "…" }, "collection_schedule": "…", "currency_code": "USD"}A payment change applies to new orders. Orders already placed keep the terms they were bought on; to move one order’s balance date, use POST /preorders/orders/:id/reschedule_payment with due_at.
If it fails
Section titled “If it fails”| Code | What happened | What to do |
|---|---|---|
not_ |
The offer or job id is wrong, or the job’s results expired | List offers again; job results last 24 hours |
invalid_ |
A field failed the schema, such as charge_ over 100 for a percentage or an unknown key, or apply_ matched no orders (path is apply_) |
Fix the field named in details[].; expected has its schema |
validation_ |
The change was refused for a reason that isn’t one field | Change the request as errors says |
plan_ |
A deposit or balance date on the free plan; nothing was saved | Ask the merchant to upgrade, or keep full payment |
over_ |
apply_ matched more orders than one request can process |
Narrow the filters (by variant or date), or send order_ in batches |
conflict |
The offer’s state doesn’t allow the change | Read the offer and pick a change its state allows |
shopify_ |
Shopify refused the selling plan update partway | Read the payments section before you retry |
idempotency_ |
A retry arrived while the first request is still running | Wait, then retry with the same key to get the first answer |
Check it worked
Section titled “Check it worked”-
GET /preorders/offers/:id/shippingshows the newships_at, andGET /preorders/offers/:id/paymentsthe newcheckout_charge. -
Read one of the moved orders and check its scheduled fulfillment date:
{ "tool": "execute_read", "arguments": { "method": "GET", "path": "/preorders/orders", "params": { "offer_id": "<offer_id>", "per_page": 5 } } }Then
GET /preorders/orders/:id/fulfillmentfor one of them. -
The shipping update job’s
succeeded_countmatches the orders the merchant expected, andfailedholds only cancelled or refunded orders. -
On the storefront, the line under the Preorder button reads “Ships mid-January”, and the product page offers the deposit option. Allow a minute for the change to publish to Shopify.
Thanks for letting us know.
Still stuck? Ask Quinn or chat with support