# Create a new selling plan

## POST /preorders

> Create a new selling plan

```json
{"openapi":"3.0.3","info":{"title":"Preorders API","version":"1.0.0"},"servers":[{"url":"https://app.stoqapp.com/api/v1/external","description":"Production server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Auth-Token"}},"schemas":{"SellingPlanInput":{"type":"object","description":"Input schema for creating or updating selling plans","properties":{"name":{"type":"string","description":"Display name of the selling plan"},"internal_name":{"type":"string","description":"Internal name for the selling plan"},"enabled":{"type":"boolean","description":"Whether the selling plan is enabled"},"billing_type":{"type":"string","enum":["exact_time","no_remaining_balance","time_after_checkout"],"description":"Type of billing for the selling plan"},"billing_at":{"type":"string","format":"date-time","description":"Exact billing time if billing_type is exact_time"},"billing_after_n_intervals":{"type":"integer","description":"Number of intervals after checkout to bill"},"billing_after_interval_type":{"type":"string","enum":["day"],"description":"Type of interval for billing"},"billing_checkout_charge_amount":{"type":"number","description":"Fixed amount to charge at checkout"},"billing_checkout_charge_percentage":{"type":"number","description":"Percentage to charge at checkout"},"billing_checkout_charge_type":{"type":"string","enum":["percentage","price"],"description":"Type of checkout charge"},"billing_title":{"type":"string","description":"Title for billing section"},"billing_description":{"type":"string","description":"Description for billing section"},"delivery_type":{"type":"string","enum":["anchor","asap","exact_time","unknown"],"description":"Type of delivery for the selling plan"},"delivery_at":{"type":"string","format":"date-time","description":"Exact delivery time if delivery_type is exact_time"},"delivery_after_n_intervals":{"type":"integer","description":"Number of intervals after checkout for delivery"},"delivery_after_interval_type":{"type":"string","enum":["day"],"description":"Type of interval for delivery"},"inventory_reserve_type":{"type":"string","enum":["on_sale","on_fulfillment"],"description":"When to reserve inventory"},"inventory_provider":{"type":"string","enum":["stoq","shopify"],"description":"Inventory provider"},"pricing_type":{"type":"string","enum":["percentage","price","fixed_amount","no_discount"],"description":"Type of pricing discount"},"pricing_amount":{"type":"number","description":"Fixed discount amount"},"pricing_percentage":{"type":"number","description":"Percentage discount"},"quantity_limit_text":{"type":"string","description":"Text to display for quantity limits"},"preorder_button_text":{"type":"string","description":"Text for the preorder button"},"preorder_button_text_color":{"type":"string","description":"Text color for the preorder button"},"preorder_button_background_color":{"type":"string","description":"Background color for the preorder button"},"preorder_button_colors_enabled":{"type":"boolean","description":"Whether custom colors are enabled for the preorder button"},"preorder_discounted_price_enabled":{"type":"boolean","description":"Whether to show discounted price on the preorder button"},"preorder_button_description":{"type":"string","description":"Description text for the preorder button"},"preorder_button_description_background_color":{"type":"string","description":"Background color for the preorder button description"},"preorder_button_description_border_radius":{"type":"string","description":"Border radius for the preorder button description"},"preorder_button_description_quantity_limit_suffix":{"type":"string","description":"Suffix text for quantity limit in button description"},"preorder_button_description_shipping_text_prefix":{"type":"string","description":"Prefix text for shipping information in button description"},"preorder_button_description_show_quantity_limit":{"type":"boolean","description":"Whether to show quantity limit in button description"},"preorder_button_description_show_shipping":{"type":"boolean","description":"Whether to show shipping information in button description"},"preorder_button_description_text_color":{"type":"string","description":"Text color for the preorder button description"},"preorder_badge_enabled":{"type":"boolean","description":"Whether preorder badge is enabled"},"preorder_badge_text":{"type":"string","description":"Text for the preorder badge"},"preorder_badge_text_color":{"type":"string","description":"Text color for the preorder badge"},"preorder_badge_background_color":{"type":"string","description":"Background color for the preorder badge"},"preorder_shipping_text":{"type":"string","description":"Shipping text specific to preorders"},"shipping_text":{"type":"string","description":"Shipping information text"},"shipping_line_item_property_enabled":{"type":"boolean","description":"Whether to enable shipping line item properties"},"shipping_applies_to_all_products":{"type":"boolean","description":"Whether shipping settings apply to all products"},"discount_text":{"type":"string","description":"Discount information text"},"preorder_tags":{"type":"string","description":"Tags to apply to preorder items"},"product_variants_source":{"type":"string","enum":["all","collection","custom"],"description":"Source of product variants for this selling plan"},"product_variants_source_id":{"type":"integer","description":"ID of the source (e.g., collection ID)"},"markets_enabled":{"type":"boolean","description":"Whether market-specific settings are enabled for this selling plan"},"shopify_market_ids":{"type":"array","items":{"type":"integer"},"description":"List of Shopify market IDs where this selling plan is available. Required if markets_enabled is true."},"auto_collect_payment":{"type":"boolean","description":"Whether to automatically collect payment when the order is ready to fulfill"},"use_shopify_selling_plan":{"type":"boolean","description":"Whether to use Shopify's native selling plan functionality for this preorder offer. When true, this enables advanced selling plan features in Shopify."},"enable_billing_widget":{"type":"boolean","description":"Whether to display the payment/billing widget on the product page"},"split_fulfillments_enabled":{"type":"boolean","description":"Whether to enable split fulfillments for preorders. When enabled, preorder items can be shipped separately from regular items in the same order."},"require_preorder_acknowledgement":{"type":"boolean","description":"Whether customers must accept terms and conditions before adding a preorder item to their cart."},"preorder_acknowledgement_text":{"type":"string","description":"The terms and conditions text that customers must acknowledge when require_preorder_acknowledgement is enabled."},"allow_mixed_cart":{"type":"boolean","description":"Whether to allow customers to mix preorder items with regular items in the same cart. When false, customers must purchase preorders separately."},"mixed_cart_error_message":{"type":"string","description":"Error message displayed to customers when they attempt to mix preorder and regular items in their cart (when allow_mixed_cart is false)."},"preorder_min_quantity":{"type":"integer","description":"Minimum quantity required per order for preorder items. When set, customers must purchase at least this many units."},"preorder_max_quantity":{"type":"integer","description":"Maximum quantity allowed per order for preorder items. When set, customers cannot purchase more than this many units."},"payment_line_item_property_enabled":{"type":"boolean","description":"Whether to add payment information as a line item property (e.g., \"Payment - Pay in full\")."},"custom_line_item_property_text":{"type":"string","description":"Custom text to add as a line item property for preorder items. Useful for adding custom order notes or metadata."},"auto_collect_payment_on_fulfillment":{"type":"boolean","description":"Whether to automatically collect remaining payment when the order is fulfilled (for partial payment preorders)."},"hold_fulfillments_enabled":{"type":"boolean","description":"Whether to automatically hold fulfillments for preorder items. When enabled, fulfillments will be held until manually released."},"hold_fulfillments_reason_note":{"type":"string","description":"The reason note displayed when fulfillments are held (when hold_fulfillments_enabled is true)."},"disable_button_until_acknowledged":{"type":"boolean","description":"Whether to disable the add to cart button until the customer acknowledges the preorder terms (when require_preorder_acknowledgement is true)."}}},"SellingPlan":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the selling plan"},"name":{"type":"string","description":"Display name of the selling plan"},"internal_name":{"type":"string","description":"Internal name for the selling plan"},"enabled":{"type":"boolean","description":"Whether the selling plan is enabled"},"billing_type":{"type":"string","enum":["exact_time","no_remaining_balance","time_after_checkout"],"description":"Type of billing for the selling plan"},"billing_at":{"type":"string","format":"date-time","nullable":true,"description":"Exact billing time if billing_type is exact_time"},"billing_after_n_intervals":{"type":"integer","nullable":true,"description":"Number of intervals after checkout to bill"},"billing_after_interval_type":{"type":"string","enum":["day"],"description":"Type of interval for billing"},"billing_checkout_charge_amount":{"type":"number","nullable":true,"description":"Fixed amount to charge at checkout"},"billing_checkout_charge_percentage":{"type":"number","nullable":true,"description":"Percentage to charge at checkout"},"billing_checkout_charge_type":{"type":"string","enum":["percentage","price"],"description":"Type of checkout charge"},"billing_title":{"type":"string","description":"Title for billing section"},"billing_description":{"type":"string","description":"Description for billing section"},"delivery_type":{"type":"string","enum":["anchor","asap","exact_time","unknown"],"description":"Type of delivery for the selling plan"},"delivery_at":{"type":"string","format":"date-time","nullable":true,"description":"Exact delivery time if delivery_type is exact_time"},"delivery_after_n_intervals":{"type":"integer","nullable":true,"description":"Number of intervals after checkout for delivery"},"delivery_after_interval_type":{"type":"string","enum":["day"],"description":"Type of interval for delivery"},"inventory_reserve_type":{"type":"string","enum":["on_sale","on_fulfillment"],"description":"When to reserve inventory"},"inventory_provider":{"type":"string","enum":["stoq","shopify"],"description":"Inventory provider"},"pricing_type":{"type":"string","enum":["percentage","price","fixed_amount","no_discount"],"description":"Type of pricing discount"},"pricing_amount":{"type":"number","nullable":true,"description":"Fixed discount amount"},"pricing_percentage":{"type":"number","nullable":true,"description":"Percentage discount"},"quantity_limit_text":{"type":"string","description":"Text to display for quantity limits"},"preorder_button_text":{"type":"string","description":"Text for the preorder button"},"preorder_button_text_color":{"type":"string","description":"Text color for the preorder button"},"preorder_button_background_color":{"type":"string","description":"Background color for the preorder button"},"preorder_button_colors_enabled":{"type":"boolean","description":"Whether custom colors are enabled for the preorder button"},"preorder_discounted_price_enabled":{"type":"boolean","description":"Whether to show discounted price on the preorder button"},"preorder_button_description":{"type":"string","description":"Description text for the preorder button"},"preorder_button_description_background_color":{"type":"string","description":"Background color for the preorder button description"},"preorder_button_description_border_radius":{"type":"string","description":"Border radius for the preorder button description"},"preorder_button_description_quantity_limit_suffix":{"type":"string","description":"Suffix text for quantity limit in button description"},"preorder_button_description_shipping_text_prefix":{"type":"string","description":"Prefix text for shipping information in button description"},"preorder_button_description_show_quantity_limit":{"type":"boolean","description":"Whether to show quantity limit in button description"},"preorder_button_description_show_shipping":{"type":"boolean","description":"Whether to show shipping information in button description"},"preorder_button_description_text_color":{"type":"string","description":"Text color for the preorder button description"},"preorder_badge_enabled":{"type":"boolean","description":"Whether preorder badge is enabled"},"preorder_badge_text":{"type":"string","description":"Text for the preorder badge"},"preorder_badge_text_color":{"type":"string","description":"Text color for the preorder badge"},"preorder_badge_background_color":{"type":"string","description":"Background color for the preorder badge"},"preorder_shipping_text":{"type":"string","description":"Shipping text specific to preorders"},"shipping_text":{"type":"string","description":"Shipping information text"},"shipping_line_item_property_enabled":{"type":"boolean","description":"Whether to enable shipping line item properties"},"shipping_applies_to_all_products":{"type":"boolean","description":"Whether shipping settings apply to all products"},"discount_text":{"type":"string","description":"Discount information text"},"preorder_tags":{"type":"string","description":"Tags to apply to preorder items"},"product_variants_source":{"type":"string","enum":["all","collection","custom"],"description":"Source of product variants for this selling plan"},"product_variants_source_id":{"type":"integer","nullable":true,"description":"ID of the source (e.g., collection ID)"},"selling_plan_product_variants_count":{"type":"integer","description":"Number of product variants associated with this selling plan"},"shopify_selling_plan_id":{"type":"integer","nullable":true,"description":"Shopify selling plan ID"},"shopify_selling_plan_group_id":{"type":"integer","nullable":true,"description":"Shopify selling plan group ID"},"use_shopify_selling_plan":{"type":"boolean","description":"Whether to use Shopify's native selling plan functionality for this preorder offer. When true, this enables advanced selling plan features in Shopify."},"enable_billing_widget":{"type":"boolean","description":"Whether to display the payment/billing widget on the product page"},"split_fulfillments_enabled":{"type":"boolean","description":"Whether to enable split fulfillments for preorders. When enabled, preorders will be separted into its own fulfillment order."},"require_preorder_acknowledgement":{"type":"boolean","description":"Whether customers must accept terms and conditions before adding a preorder item to their cart."},"preorder_acknowledgement_text":{"type":"string","description":"The terms and conditions text that customers must acknowledge when require_preorder_acknowledgement is enabled."},"allow_mixed_cart":{"type":"boolean","description":"Whether to allow customers to mix preorder items with regular items in the same cart. When false, customers must purchase preorders separately."},"mixed_cart_error_message":{"type":"string","description":"Error message displayed to customers when they attempt to mix preorder and regular items in their cart (when allow_mixed_cart is false)."},"preorder_min_quantity":{"type":"integer","nullable":true,"description":"Minimum quantity required per order for preorder items. When set, customers must purchase at least this many units."},"preorder_max_quantity":{"type":"integer","nullable":true,"description":"Maximum quantity allowed per order for preorder items. When set, customers cannot purchase more than this many units."},"payment_line_item_property_enabled":{"type":"boolean","description":"Whether to add payment information as a line item property (e.g., \"Payment - Pay in full\")."},"custom_line_item_property_text":{"type":"string","nullable":true,"description":"Custom text to add as a line item property for preorder items. Useful for adding custom order notes or metadata."},"auto_collect_payment_on_fulfillment":{"type":"boolean","description":"Whether to automatically collect remaining payment when the order is fulfilled (for partial payment preorders)."},"hold_fulfillments_enabled":{"type":"boolean","description":"Whether to automatically hold fulfillments for preorder items. When enabled, fulfillments will be held until manually released."},"hold_fulfillments_reason_note":{"type":"string","description":"The reason note displayed when fulfillments are held (when hold_fulfillments_enabled is true)."},"disable_button_until_acknowledged":{"type":"boolean","description":"Whether to disable the add to cart button until the customer acknowledges the preorder terms (when require_preorder_acknowledgement is true)."},"shop_id":{"type":"integer","description":"Shop ID this selling plan belongs to"},"market_id":{"type":"integer","nullable":true,"description":"Market ID for multi-market stores"},"created_at":{"type":"string","format":"date-time","description":"Timestamp when the selling plan was created"},"updated_at":{"type":"string","format":"date-time","description":"Timestamp when the selling plan was last updated"},"discarded_at":{"type":"string","format":"date-time","nullable":true,"description":"Timestamp when the selling plan was soft deleted"},"ongoing_job":{"type":"boolean","description":"Whether there is an ongoing job for this selling plan"},"shopify_variant_ids":{"type":"array","items":{"type":"integer"},"description":"List of Shopify variant IDs associated with this selling plan"}}}}},"paths":{"/preorders":{"post":{"summary":"Create a new selling plan","tags":["Preorders"],"parameters":[{"in":"header","name":"X-Auth-Token","required":true,"schema":{"type":"string"},"description":"API key for authentication"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"selling_plan":{"$ref":"#/components/schemas/SellingPlanInput"}}}}}},"responses":{"201":{"description":"Selling plan created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SellingPlan"}}}},"401":{"description":"Unauthorized"},"422":{"description":"Validation errors","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object"}}}}}}}}}}}
```
