---
title: "Create offer from template"
description: "Create a preorder offer from a template, optionally with a name and products. Returns the new offer."
url: https://docs.stoqapp.com/v2-reference/preorders-offer-templates/create-offer-from-template/
api: "API v2 reference"
method: POST
path: "/preorders/offer_templates/{id}/create_offer"
---

# Create offer from template

`POST https://app.stoqapp.com/api/v2/external/preorders/offer_templates/{id}/create_offer`

Create a preorder offer from a template, optionally with a name and products. Returns the new offer.

**Note:** The new offer has the template's settings, payment options, batches (without dates), markets and translations. It starts off, named after the template (&quot;&lt;name&gt; (2)&quot; and so on when taken) unless `internal_name` is sent, made unique the same way. A template keeps no dates. An offer that ships on an exact date, or charges its remaining balance on an exact date, keeps that setting with the date empty: `dates_to_set` lists each field to set (ships_at with PATCH .../shipping, partial.remaining_balance.charge_exact_time with PATCH .../payments), each also listed in also_changed. Until they are set the offer cannot be turned on or take products, so sending shopify_variant_ids or shopify_product_ids for such a template is a 422 and creates nothing. Products are added as [`POST /preorders/offers/:id/products/add_variants`](https://docs.stoqapp.com/v2-reference/preorders-offers/add-variants/) does, after the offer is created; if that add is refused (its pre-flight check, say), the offer is still created and `products` holds the error: add them with add_variants. Settings added to offers after the template was saved take their defaults. On a free plan the offer leaves every paid feature off (and keeps one payment option): reset_for_plan names them, each also listed in also_changed.

## Path parameters

- `id` (string, required): The offer template's ID, from [`GET /preorders/offer_templates`](https://docs.stoqapp.com/v2-reference/preorders-offer-templates/list-offer-templates/).

## Headers

- `Idempotency-Key` (string): 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.

## Request body

- `internal_name` (string): Dashboard name of the new offer. Defaults to the template's name. Made unique with &quot; (2)&quot; and so on when taken.
- `shopify_variant_ids` (array of anys): Shopify variant gids to attach to the new offer.
- `shopify_product_ids` (array of anys): Shopify product gids; every variant of each product is attached to the new offer.

## Returns

- `id` (string): Offer ID.
- `shopify_selling_plan_group_id` (null): The offer's Shopify selling plan group, as gid://shopify/SellingPlanGroup/&lt;id&gt;. Null until the offer has one in Shopify.
- `name` (string): Customer-facing name of the offer.
- `internal_name` (string): Label shown to staff in the dashboard only.
- `widget` (object): The preorder button, disclaimer and badge shown on product pages.
  - `button` (object): Text and colors of the preorder button.
    - `button_text` (string): Preorder button label.
    - `custom_colors_enabled` (boolean): true uses text_color and background_color; false uses the theme's own button colors.
    - `text_color` (string): Button text color, as hex. Used when custom_colors_enabled is true.
    - `background_color` (string): Button background color, as hex. Used when custom_colors_enabled is true.
  - `disclaimer` (object): The disclaimer line shown under the preorder button.
    - `show_disclaimer` (boolean): Whether the disclaimer line shows under the button.
    - `disclaimer_text` (string): Text of the disclaimer line.
    - `text_color` (string): Disclaimer text color, as hex.
    - `background_color` (string): Disclaimer background color, as hex.
    - `border_radius` (integer): Disclaimer corner radius in pixels.
  - `badge` (object): The preorder badge shown on product pages and product cards.
    - `show_badge` (boolean): Whether the preorder badge shows.
    - `badge_text` (string): Label printed on the preorder badge.
    - `text_color` (string): Badge text color, as hex.
    - `background_color` (string): Badge background color, as hex.
- `inventory` (object): When the Preorder button shows and when preorders take stock.
  - `stock_condition` (string): When the Preorder button shows: out_of_stock when the variant is out of stock with Continue selling on, in_stock only while it is in stock, any_stock_level whenever the variant can be bought. One of: `out_of_stock`, `in_stock`, `any_stock_level`.
  - `reserve` (string): When inventory is deducted: on_sale at checkout, on_fulfillment at fulfillment. One of: `on_sale`, `on_fulfillment`.
- `products` (object): Which variants are on the offer and the rule that puts them there.
  - `selection` (string): Rule that puts variants on the offer: all (every variant in the shop, minus exclusions), collection, custom (variants added by hand) or tags. One of: `all`, `collection`, `custom`, `tags`.
  - `shopify_collection_id` (null): Collection driving the variant list, as gid://shopify/Collection/&lt;id&gt;. Null unless selection is collection.
  - `tags` (array of anys): Product tags; products carrying any of them are on the offer. Empty unless selection is tags.
  - `eligible_inventory_policy` (string): continue_selling: STOQ turns Continue selling on for the rule's out-of-stock variants so all take preorders. all: only variants that already have Continue selling on take preorders. One of: `continue_selling`, `all`.
  - `excluded_shopify_variant_ids` (array of anys): Variants held back from the rule, as gid://shopify/ProductVariant/&lt;id&gt;.
  - `exclusion_tag` (null): Variants of products carrying this tag are held back. Null when none is set.
  - `variant_count` (integer): Number of variants on the offer, leaving out variants deleted from the catalog.
  - `variants_added` (array of strings)
  - `products_added` (array of anys)
  - `error` (string)
  - `code` (string)
- `shipping` (object): Shipping timeline, fulfillment status and fulfillment handling for preorder items.
  - `timeline` (object): The shipping timeline text shown with the preorder button.
    - `scope` (string): same shows one shipping text for every product; per_variant uses each variant's own shipping text. One of: `same`, `per_variant`.
    - `show_shipping_text` (boolean): Whether the shipping timeline shows on the widget.
    - `shipping_text` (string): The line under the preorder button. A {{ date }} placeholder is filled with variant_shipping_text.
    - `variant_shipping_text` (string): Ship date text for a variant that has no shipping text of its own, and for every variant when scope is same.
  - `delivery_timing` (string): Fulfillment status of preorder items: asap is Unfulfilled (ship now), exact_time is Scheduled (on ships_at or days_after_checkout), unknown is On hold (no date promised). One of: `asap`, `exact_time`, `unknown`.
  - `ships_at` (null): Ship date, ISO 8601 in UTC. Null unless delivery_timing is exact_time with a fixed date.
  - `days_after_checkout` (integer, nullable): Days after checkout that items ship. Null unless delivery_timing is exact_time with a delay instead of a date.
  - `fulfillment` (object): How preorder items are fulfilled: held, split, or moved to a separate order.
    - `handling` (string): none; hold_all holds every fulfillment (asap or unknown delivery only); split_fulfillments ships in-stock items first; separate_orders moves preorder items to their own order. One of: `none`, `hold_all`, `split_fulfillments`, `separate_orders`.
    - `hold_reason` (string): Hold reason shown in Shopify on held fulfillments.
    - `separate_orders` (object): Settings for separate orders, used when handling is separate_orders.
      - `grouping` (string): offer creates one separate order per offer, variant one per variant, ship_date one per ship date. One of: `offer`, `variant`, `ship_date`.
      - `number_format` (string): sequential gives each separate order its own order number; suffix appends suffix to the original order name. One of: `sequential`, `suffix`.
      - `suffix` (string): Suffix appended to the separate order name.
      - `hold_fulfillments` (boolean): Whether fulfillments on the separate order are held until released.
      - `tag` (string): Tag applied to the separate preorder order.
      - `transaction_gateway` (string): Payment gateway recorded on the separate order's transaction. Default &quot;Prepaid&quot;.
      - `original_order_hold_tag` (null): Tag on the original order while it is being split, removed once the split finishes. Null when none is set.
      - `original_order_split_tag` (null): Tag on the original order after its preorder items move to a separate order. Null when none is set.
  - `on_hold` (object): When held fulfillments are released.
    - `release_schedule` (string): scheduled releases held fulfillments on release_at; manual leaves them held. One of: `scheduled`, `manual`.
    - `release_at` (null): When held fulfillments are released, ISO 8601 in UTC. Null when not set.
    - `require_payment` (boolean): Only release once the balance is paid.
- `payments` (object): Payment options shown at checkout: full payment, partial payment (deposit) or both, with discounts and balance collection.
  - `options_offered` (string): Payment options the offer has. One of: `full`, `partial`, `full_and_partial`.
  - `default_option` (string): Payment option selected by default at checkout. One of: `full`, `partial`.
  - `full` (object): The full-payment option, where shoppers pay everything at checkout. Absent when the offer has no full-payment option.
    - `selling_plan_id` (null): This option's Shopify selling plan, as gid://shopify/SellingPlan/&lt;id&gt;. Null until it exists in Shopify.
    - `checkout_charge` (object): What is charged at checkout. Always 100 percent for full payment.
      - `charge_type` (string): Always percentage for full payment. One of: `percentage`, `price`.
      - `charge_amount` (integer): Always 100 for full payment.
    - `remaining_balance` (object): When the remaining balance is charged. Nothing remains on full payment.
      - `charge_trigger` (string): Always no_remaining_balance for full payment. One of: `exact_time`, `no_remaining_balance`, `time_after_checkout`.
      - `charge_exact_time` (null): Always null for full payment.
      - `days_after_checkout` (null): Always null for full payment.
    - `price_adjustment` (object): Discount on this option's price.
      - `adjustment_type` (null): percentage takes adjustment_amount percent off; fixed_amount and price take adjustment_amount off in the shop's currency. Null when there is no discount. One of: `percentage`, `price`, `fixed_amount`.
      - `adjustment_amount` (null): Discount size: a percent, or an amount in the shop's currency (not minor units), per adjustment_type. Null when there is no discount.
    - `option_title` (string): Title of the full-payment option in the payment widget.
    - `option_description` (string): Description of the full-payment option in the payment widget. Null when not set.
    - `discount_text` (string): Text describing the full-payment discount.
  - `collection_schedule` (string): How the remaining balance is collected: manual by the merchant, scheduled on its due date, or on_fulfillment. One of: `manual`, `scheduled`, `on_fulfillment`.
  - `show_payment_widget` (boolean): Whether the payment and discount savings widget shows on the product page.
  - `show_discounted_price` (null): Whether the discounted price shows. Null when never set.
  - `currency_code` (null): The shop's currency, as an ISO 4217 code such as USD. Amounts in this section are in it.
  - `partial` (object): The partial-payment option, where shoppers pay a deposit at checkout and the balance later. Absent when the offer has no partial-payment option.
    - `selling_plan_id` (null): This option's Shopify selling plan, as gid://shopify/SellingPlan/&lt;id&gt;. Null until it exists in Shopify.
    - `checkout_charge` (object): The deposit charged at checkout.
      - `charge_type` (string): percentage charges charge_amount percent of the price; price charges charge_amount in the shop's currency. One of: `percentage`, `price`.
      - `charge_amount` (integer): The deposit: a percent from 0 to 100 when charge_type is percentage, or an amount in the shop's currency (not minor units) when it is price. 0 charges nothing at checkout.
    - `remaining_balance` (object): When the remaining balance is charged.
      - `charge_trigger` (string): exact_time charges the balance on charge_exact_time; time_after_checkout charges it days_after_checkout days after checkout. One of: `exact_time`, `no_remaining_balance`, `time_after_checkout`.
      - `charge_exact_time` (null): When the balance is due, ISO 8601 in UTC. Null unless charge_trigger is exact_time.
      - `days_after_checkout` (integer, nullable): Days after checkout that the balance is due. Null unless charge_trigger is time_after_checkout.
    - `price_adjustment` (object): Discount on this option's price.
      - `adjustment_type` (null): percentage takes adjustment_amount percent off; fixed_amount and price take adjustment_amount off in the shop's currency. Null when there is no discount. One of: `percentage`, `price`, `fixed_amount`.
      - `adjustment_amount` (null): Discount size: a percent, or an amount in the shop's currency (not minor units), per adjustment_type. Null when there is no discount.
    - `option_title` (string): Title of the partial-payment option in the payment widget.
    - `option_description` (string): Description of the partial-payment option in the payment widget. Null when not set.
    - `discount_text` (string): Text describing the partial-payment discount.
- `availability` (object): Whether the offer is on, and its schedule.
  - `schedule` (string): enabled or disabled when the offer has no schedule; date_range, starts_on or ends_on when it follows starts_at and ends_at. One of: `enabled`, `disabled`, `date_range`, `starts_on`, `ends_on`.
  - `starts_at` (null): When a scheduled offer starts, ISO 8601 in UTC. Null when it has no start date.
  - `ends_at` (null): When a scheduled offer ends, ISO 8601 in UTC. Null when it has no end date.
  - `current_status` (string): Where the offer is now: live, scheduled (dated and waiting for its start), off, or deleted. One of: `live`, `scheduled`, `false`, `deleted`.
  - `time_zone` (string): The shop's time zone, as an IANA name such as America/New_York.
- `limits` (object): Quantity limits, the progress bar, the terms checkbox, mixed carts and order quantity.
  - `default_per_variant` (null): The same quantity limit for every variant, copied onto each one when set. Null when there is none.
  - `display_style` (string): How shoppers see the limit: none, disclaimer (remaining units in the disclaimer line) or progress_bar. One of: `none`, `disclaimer`, `progress_bar`.
  - `limit_text` (string): Text printed with the remaining-units count.
  - `show_icons` (boolean): Whether the widget uses icons for quantity and shipping details.
  - `progress_bar` (object): Look and text of the storefront progress bar toward the quantity limit.
    - `progress_text` (string): Progress bar text.
    - `fill_color` (string): Bar fill color, as hex.
    - `background_color` (string): Bar background color, as hex.
    - `box_background_color` (null): Color behind the bar, as hex. Null uses the disclaimer background.
    - `text_color` (string): Bar text color, as hex.
    - `border_radius` (integer): Bar corner radius in pixels.
    - `show_percentage` (boolean): Whether a percentage shows next to the bar.
  - `order_tags` (array of strings): Tags Shopify puts on orders containing this offer.
  - `terms` (object): The terms checkbox shoppers accept before preordering.
    - `require_acceptance` (boolean): Whether shoppers must accept the terms before preordering.
    - `terms_text` (string): Wording beside the terms checkbox.
    - `disable_button_until_accepted` (boolean): Whether the button stays disabled until the terms are accepted.
    - `record_acceptance` (boolean): Whether acceptance is recorded as a cart line property.
    - `acceptance_label` (string): Label of the cart line property that records acceptance.
  - `cart` (object): Whether a cart can mix preorder and regular items, and the error shown when it cannot.
    - `allowed_items` (string): mixed lets a cart hold preorder and regular items; preorder_only blocks the mix at checkout. One of: `mixed`, `preorder_only`.
    - `error_message` (string): Error shown when a blocked mixed cart reaches checkout.
  - `order_quantity` (object): Minimum and maximum quantity per order.
    - `minimum` (null): Minimum quantity per order. Null when there is none.
    - `maximum` (null): Maximum quantity per order. Null when there is none.
- `countdown` (object): The countdown timer shown on product pages.
  - `show_when` (string): disabled hides the timer; before_launch counts down to the start, during_preorder to the end, both to the start and then the end. One of: `disabled`, `before_launch`, `during_preorder`, `both`.
  - `date_source` (string): schedule counts to the offer's schedule dates; custom to starts_at and ends_at. One of: `schedule`, `custom`.
  - `starts_at` (null): Custom launch date, ISO 8601 in UTC. Used when date_source is custom; null when not set.
  - `ends_at` (null): Custom deadline, ISO 8601 in UTC. Used when date_source is custom; null when not set.
  - `starts_text` (null): Heading shown before launch. Null when not set.
  - `ends_text` (null): Heading shown during the preorder. Null when not set.
  - `labels` (object): Unit labels shown on the timer.
    - `days` (string): Days label.
    - `hours` (string): Hours label.
    - `minutes` (string): Minutes label.
    - `seconds` (string): Seconds label.
  - `text_color` (string): Timer text color, as hex.
  - `background_color` (string): Timer background color, as hex.
  - `border_radius` (integer): Timer corner radius in pixels.
  - `units` (array of strings): Time units the timer shows, any of days, hours, minutes and seconds.
  - `current` (object): What the timer shows right now, worked out from the settings, the dates and the offer's status. Read-only.
    - `visible_phase` (string): hidden when no timer shows now; before_launch while counting to the start; during_preorder while counting to the end. One of: `hidden`, `before_launch`, `during_preorder`.
    - `target_at` (null): The moment the timer counts down to now, ISO 8601 in UTC. Null when hidden.
    - `heading_text` (null): Heading shown above the timer now. Null when hidden or not set.
    - `starts_at` (null): Start date the timer uses, from the schedule or the custom dates per date_source, ISO 8601 in UTC. Null when none.
    - `ends_at` (null): End date the timer uses, from the schedule or the custom dates per date_source, ISO 8601 in UTC. Null when none.
- `markets` (object): Shopify markets the offer applies in.
  - `scope` (string): all applies the offer in every market; selected only in shopify_market_ids. One of: `all`, `selected`.
  - `shopify_market_ids` (array of anys): Markets the offer applies in when scope is selected, as gid://shopify/Market/&lt;id&gt;. Empty when scope is all.
- `advanced` (object): Purchase option and the attributes added to each preorder cart line.
  - `checkout_method` (string): selling_plan uses a Shopify purchase option (selling plan); line_item_property runs the offer without one. One of: `selling_plan`, `line_item_property`.
  - `cart_attributes` (object): What the offer adds to each preorder cart line.
    - `show_payment` (boolean): Whether payment details and savings show in the cart.
    - `show_shipping` (boolean): Whether the fulfillment timeline shows in the cart.
    - `custom_text` (null): Free text added to every preorder cart line. Null when not set.
- `integrations` (object): Point of Sale and B2B settings.
  - `pos` (object): Point of Sale settings.
    - `enable_pos` (boolean): Whether preorders can be sold on POS.
    - `inventory_check` (string): skip sells on POS without checking inventory; required keeps the inventory check. One of: `skip`, `required`.
  - `b2b` (object): B2B settings.
    - `enable_b2b` (boolean): Whether B2B customers can place preorders on this offer.
- `batches` (object): Selling in batches: one batch after another, each with its own quantity limit and ship text.
  - `release_strategy` (string): sequential sells the batches one after another; all_at_once means batches are off. One of: `sequential`, `all_at_once`.
  - `advance_schedule` (string): automatic moves to the next batch when one sells its quantity_limit; manual waits for the merchant. One of: `automatic`, `manual`.
  - `label_format` (string): Batch name format; {{ n }} is replaced by the position. Null uses &quot;Batch {{ n }}&quot;.
  - `status_text` (object): Words shown on the storefront for past, live and upcoming batches.
    - `past` (string): Word shown for a batch that has passed.
    - `live` (string): Word shown for the batch on sale now.
    - `upcoming` (string): Word shown for a batch still to come.
  - `widget` (object): Layout and content of the storefront batch widget.
    - `style` (string): Batch widget layout: roadmap, stacked, compact or segmented.
    - `progress` (string): counts shows units sold of the limit; percent shows a percentage. One of: `counts`, `percent`.
    - `show_other_ship_dates` (boolean): Whether the other batches' ship dates show on the storefront.
    - `show_names` (boolean): Whether batch names show on the storefront.
  - `items` (array of objects): The batches, in selling order. Archived batches are left out.
    - `id` (string): Batch ID, used as the key in a variant's batch_limits and batch_ship_texts.
    - `position` (integer): Place in the selling order, from 1.
    - `quantity_limit` (integer): Units the batch can sell. Null when unlimited.
    - `shipping_text` (string): Ship text shown while this batch is on sale.
    - `label` (string): Batch name, from label_format with its position filled in.
- `translations` (object): Saved translations of the offer's text, keyed by locale, each in the same shape as the offer. Only locales and fields with saved text appear; the offer's own values are the fallback.
- `line_item_revenue` (string): Revenue from this offer's preorder line items, as a decimal string with two places in the shop's currency, such as &quot;1250.00&quot;. Cancelled and refunded units are left out.
- `order_revenue` (string): Total price of the orders that hold at least one of this offer's preorder items, counted once per order, as a decimal string in the shop's currency.
- `created_at` (string): When the offer was created, ISO 8601 in UTC.
- `updated_at` (string): When the offer was last changed, ISO 8601 in UTC.
- `dates_to_set` (array of strings): Exact dates the new offer still needs: ships_at (PATCH /preorders/offers/:id/shipping) and partial.remaining_balance.charge_exact_time (PATCH /preorders/offers/:id/payments). The offer cannot be turned on or take products until each is set. Absent when none.
- `also_changed` (array of objects): Settings this write changed on its own because they depend on what you changed (turning one option off can reset another). Absent when nothing else changed.
  - `setting` (string): The setting that changed, as the dashboard names it.
  - `from` (string): Its value before the write.
  - `to` (string): Its value after the write.
  - `reason` (string): Why it changed.
- `reset_for_plan` (array of strings): Paid features the copy leaves off because the shop is on a free plan. Absent when none.

Rate limit: this call costs 2 points ([rate limits](https://docs.stoqapp.com/docs/rate-limits/)).

## Example request

```sh
curl -X POST "https://app.stoqapp.com/api/v2/external/preorders/offer_templates/{id}/create_offer" \
  -H "X-Auth-Token: $STOQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "internal_name": "Winter drop"
  }'
```

## 202

Success: example response shown.

```json
{
  "id": "4b7a1c90-5d2e-4f83-9a61-0c3e8f2d7b54",
  "shopify_selling_plan_group_id": null,
  "name": "Summer Sneaker Drop",
  "internal_name": "Winter drop",
  "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,
    "variant_count": 0
  },
  "shipping": {
    "timeline": {
      "scope": "same",
      "show_shipping_text": true,
      "shipping_text": "Shipping: As soon as possible",
      "variant_shipping_text": "ASAP"
    },
    "delivery_timing": "exact_time",
    "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/109",
      "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": "disabled",
    "starts_at": null,
    "ends_at": null,
    "current_status": "off",
    "time_zone": "America/New_York"
  },
  "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,
      "starts_at": null,
      "ends_at": 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": {},
  "line_item_revenue": "0.00",
  "order_revenue": "0.00",
  "created_at": "2026-07-05T11:00:02Z",
  "updated_at": "2026-07-05T11:00:02Z",
  "dates_to_set": [
    "ships_at"
  ],
  "also_changed": [
    {
      "setting": "Ship date",
      "from": "exact date",
      "to": "exact date, not set yet",
      "reason": "A template keeps no dates. Set ships_at with PATCH /preorders/offers/:id/shipping before turning the offer on or adding products."
    }
  ]
}
```

## 401

Missing or invalid `X-Auth-Token`.

```json
{
  "errors": [
    "Invalid API key"
  ],
  "code": "auth_invalid",
  "details": [
    {
      "code": "auth_invalid",
      "message": "Invalid API key",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

## 404

The resource does not exist for this shop, or the action path is not registered.

```json
{
  "errors": [
    "Offer not found"
  ],
  "code": "not_found",
  "details": [
    {
      "code": "not_found",
      "message": "Offer not found",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

## 409

An earlier request with the same Idempotency-Key is still running. Wait, then resend the same request with the same key.

```json
{
  "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
    }
  ]
}
```

## 422

The request failed validation.

```json
{
  "errors": [
    "name is required"
  ],
  "code": "validation_failed",
  "details": [
    {
      "code": "validation_failed",
      "message": "name is required",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

## 429

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

```json
{
  "errors": [
    "Rate limit exceeded"
  ],
  "code": "rate_limited",
  "details": [
    {
      "code": "rate_limited",
      "message": "Rate limit exceeded",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

