Skip to content

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.

  • 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_required and saves nothing. Moving the ship date works on every plan.
  • The offer id: GET /preorders/offers?search=<name> and take the id.
  • Agree the change with the merchant. A ship date change with reschedule_existing_orders moves every unfulfilled order on the offer, and the shipping update emails every customer you target.
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: true moves the scheduled fulfillments of every unfulfilled, uncancelled preorder on the offer to the new date, in the background. It needs delivery_timing exact_time after the save, which sending ships_at gives you. It does not email anyone.
  • To ship N days after each order instead, send days_after_checkout: 30 in place of ships_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_settings with shopify_variant_ids (up to 250) and shipping_text (null goes back to the offer’s text).
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.

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_type is percentage (up to 100) or price (a fixed amount in the shop’s currency). charge_amount: 0 takes nothing at checkout.
  • remaining_balance.charge_trigger is exact_time (with charge_exact_time) or time_after_checkout (with days_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.

Code What happened What to do
not_found The offer or job id is wrong, or the job’s results expired List offers again; job results last 24 hours
invalid_params A field failed the schema, such as charge_amount over 100 for a percentage or an unknown key, or apply_to_all matched no orders (path is apply_to_all) Fix the field named in details[].path; expected has its schema
validation_failed The change was refused for a reason that isn’t one field Change the request as errors says
plan_required A deposit or balance date on the free plan; nothing was saved Ask the merchant to upgrade, or keep full payment
over_limit apply_to_all matched more orders than one request can process Narrow the filters (by variant or date), or send order_ids in batches
conflict The offer’s state doesn’t allow the change Read the offer and pick a change its state allows
shopify_error Shopify refused the selling plan update partway Read the payments section before you retry
idempotency_key_in_progress A retry arrived while the first request is still running Wait, then retry with the same key to get the first answer
  1. GET /preorders/offers/:id/shipping shows the new ships_at, and GET /preorders/offers/:id/payments the new checkout_charge.

  2. 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/fulfillment for one of them.

  3. The shipping update job’s succeeded_count matches the orders the merchant expected, and failed holds only cancelled or refunded orders.

  4. 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.

Was this page helpful?

Still stuck? Ask Quinn or chat with support