# Generate bundle-specific discount code Creates a Shopify discount code specifically for a subscription bundle. This endpoint generates unique, single-use or multi-use discount codes tied to bundle purchases. Key Features: - Bundle-Specific Codes: Discounts that apply only to specific bundles - Flexible Discount Types: Percentage off, fixed amount off, or free shipping - Usage Limits: Single-use, limited use, or unlimited codes - Expiration Dates: Set validity periods for promotional campaigns - Minimum Requirements: Minimum purchase amount or quantity thresholds - Customer Eligibility: Restrict to specific customer segments or tags Discount Configuration: - Code Format: Custom code or auto-generated random code - Discount Value: Percentage (e.g., 15%) or fixed amount (e.g., $10) - Start/End Dates: Campaign duration controls - Usage Limit: Max number of times code can be used - Once Per Customer: Prevent code reuse by same customer - Bundle Association: Links discount to specific bundle token Use Cases: - Create promotional codes for bundle launches - Generate unique codes for influencer campaigns - Offer first-time subscriber discounts on bundles - Seasonal or holiday bundle promotions - Referral program discount codes - Partner/affiliate exclusive bundle offers Authentication: Requires API key authentication via X-API-Key header or api_key parameter Endpoint: PUT /api/external/v2/subscription-bundlings/discount/{token} Version: 0.0.1 ## Path parameters: - `token` (string, required) Bundle token identifier Example: "abc123xyz" ## Query parameters: - `api_key` (string) API Key (Deprecated - Use Header X-API-Key instead) ## Header parameters: - `X-API-Key` (string) ## Request fields (application/json): - `cart` (object) - `cart.token` (string) - `cart.note` (object) - `cart.attributes` (object) - `cart.original_total_price` (integer) - `cart.total_price` (integer) - `cart.total_discount` (integer) - `cart.total_weight` (integer) - `cart.item_count` (integer) - `cart.items` (array) - `cart.items.id` (integer) - `cart.items.properties` (object) - `cart.items.quantity` (integer) - `cart.items.variant_id` (integer) - `cart.items.key` (string) - `cart.items.title` (string) - `cart.items.price` (integer) - `cart.items.original_price` (integer) - `cart.items.discounted_price` (integer) - `cart.items.line_price` (integer) - `cart.items.original_line_price` (integer) - `cart.items.discounts` (array) - `cart.items.sku` (string) - `cart.items.grams` (integer) - `cart.items.vendor` (string) - `cart.items.taxable` (boolean) - `cart.items.product_id` (integer) - `cart.items.product_has_only_default_variant` (boolean) - `cart.items.gift_card` (boolean) - `cart.items.final_price` (integer) - `cart.items.final_line_price` (integer) - `cart.items.url` (string) - `cart.items.featured_image` (object) - `cart.items.featured_image.aspect_ratio` (integer) - `cart.items.featured_image.alt` (string) - `cart.items.featured_image.height` (integer) - `cart.items.featured_image.width` (integer) - `cart.items.image` (string) - `cart.items.handle` (string) - `cart.items.requires_shipping` (boolean) - `cart.items.product_type` (string) - `cart.items.product_title` (string) - `cart.items.product_description` (string) - `cart.items.variant_title` (object) - `cart.items.variant_options` (array) - `cart.items.options_with_values` (array) - `cart.items.options_with_values.name` (string) - `cart.items.options_with_values.value` (string) - `cart.items.line_level_discount_allocations` (array) - `cart.items.line_level_total_discount` (integer) - `cart.currency` (string) - `cart.items_subtotal_price` (integer) - `cart.cart_level_discount_applications` (array) ## Response 200 fields (application/json): - `discountCode` (string) - `errorMessage` (string) - `discountNeeded` (boolean) ## Response 401 fields (*/*): - `discountCode` (string) - `errorMessage` (string) - `discountNeeded` (boolean) ## Response 404 fields (*/*): - `discountCode` (string) - `errorMessage` (string) - `discountNeeded` (boolean) ## Response 500 fields (*/*): - `discountCode` (string) - `errorMessage` (string) - `discountNeeded` (boolean) ## Response 400 fields