> ## Documentation Index
> Fetch the complete documentation index at: https://developers.appstle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate a build-a-box bundle discount



## OpenAPI

````yaml /bundles/storefront-api-swagger.json put /bundles/bb/api/build-a-box/discount/{token}
openapi: 3.0.1
info:
  description: ''
  title: Storefront APIs
  version: 0.0.1
servers:
  - url: https://bundles-admin.appstle.com
security: []
tags:
  - description: Fetch build-a-box configuration and generate bundle discounts.
    name: Build-a-Box
  - description: Storefront-facing Bundles widget and visitor activity endpoints.
    name: Storefront
  - description: >-
      Storefront product and collection data, proxied through the Shopify
      Storefront API for build-a-box and bundle widgets.
    name: Product Catalog
paths:
  /bundles/bb/api/build-a-box/discount/{token}:
    put:
      tags:
        - Build-a-Box
      summary: Generate a build-a-box bundle discount
      operationId: generateDiscount
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscountCodeRequest'
        required: true
      responses:
        '200':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DiscountCodeResponse'
          description: OK
components:
  schemas:
    DiscountCodeRequest:
      properties:
        cart:
          $ref: '#/components/schemas/Cart'
      type: object
    DiscountCodeResponse:
      properties:
        discountAmount:
          format: double
          type: number
        discountCode:
          type: string
        discountMessage:
          type: string
        discountNeeded:
          type: boolean
        errorMessage:
          type: string
        id:
          type: string
      type: object
    Cart:
      properties:
        attributes:
          $ref: '#/components/schemas/Attributes'
        cart_level_discount_applications:
          items:
            type: object
          type: array
        currency:
          type: string
        item_count:
          format: int64
          type: integer
        items:
          items:
            $ref: '#/components/schemas/Item'
          type: array
        items_subtotal_price:
          format: int64
          type: integer
        note:
          type: object
        original_total_price:
          format: int64
          type: integer
        requires_shipping:
          type: boolean
        token:
          type: string
        total_discount:
          format: int64
          type: integer
        total_price:
          format: int64
          type: integer
        total_weight:
          format: int64
          type: integer
      type: object
    Attributes:
      type: object
    Item:
      properties:
        discounted_price:
          format: int64
          type: integer
        discounts:
          items:
            type: object
          type: array
        featured_image:
          $ref: '#/components/schemas/FeaturedImage'
        final_line_price:
          format: int64
          type: integer
        final_price:
          format: int64
          type: integer
        gift_card:
          type: boolean
        grams:
          format: int64
          type: integer
        handle:
          type: string
        id:
          format: int64
          type: integer
        image:
          type: string
        key:
          type: string
        line_level_discount_allocations:
          items:
            type: object
          type: array
        line_level_total_discount:
          format: int64
          type: integer
        line_price:
          format: int64
          type: integer
        options_with_values:
          items:
            $ref: '#/components/schemas/OptionsWithValue'
          type: array
        original_line_price:
          format: int64
          type: integer
        original_price:
          format: int64
          type: integer
        price:
          format: int64
          type: integer
        product_description:
          type: string
        product_has_only_default_variant:
          type: boolean
        product_id:
          format: int64
          type: integer
        product_title:
          type: string
        product_type:
          type: string
        properties:
          $ref: '#/components/schemas/Properties'
        quantity:
          format: int64
          type: integer
        requires_shipping:
          type: boolean
        sku:
          type: string
        taxable:
          type: boolean
        title:
          type: string
        total_discount:
          format: int64
          type: integer
        url:
          type: string
        variant_id:
          format: int64
          type: integer
        variant_options:
          items:
            type: string
          type: array
        variant_title:
          type: object
        vendor:
          type: string
      type: object
    FeaturedImage:
      properties:
        alt:
          type: string
        aspect_ratio:
          format: int64
          type: integer
        height:
          format: int64
          type: integer
        url:
          type: string
        width:
          format: int64
          type: integer
      type: object
    OptionsWithValue:
      properties:
        name:
          type: string
        value:
          type: string
      type: object
    Properties:
      type: object

````