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

# Update a bundle rule

> Updates an existing bundle rule's configuration including products, quantity, discount settings, and tag conditions.



## OpenAPI

````yaml /swagger/management-api.json put /api/v1/{team_slug}/{app_slug}/bundle-groups/{bundle_group_id}/bundles/{bundle_id}/rules/{rule_id}
openapi: 3.0.0
info:
  contact:
    email: support@enad.io
    name: API support
    url: http://enad.io/support
  description: This is the documentation for Public API v1
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://enad.io/terms/
  title: Public API
  version: '1.0'
servers:
  - url: //api.enad.io
security: []
paths:
  /api/v1/{team_slug}/{app_slug}/bundle-groups/{bundle_group_id}/bundles/{bundle_id}/rules/{rule_id}:
    put:
      tags:
        - Bundle Rules
      summary: Update a bundle rule
      description: >-
        Updates an existing bundle rule's configuration including products,
        quantity, discount settings, and tag conditions.
      parameters:
        - description: App slug
          in: path
          name: app_slug
          required: true
          schema:
            type: string
        - description: Team slug
          in: path
          name: team_slug
          required: true
          schema:
            type: string
        - description: Rule ID
          in: path
          name: rule_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/internal_pkg_webserver_v1.UpdateBundlePayload
        description: Bundle rule configuration
        required: true
      responses:
        '200':
          description: Bundle rule updated successfully
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/internal_pkg_webserver_v1.OkResponseProductBundleRule
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_pkg_webserver_v1.ErrorMessage'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_pkg_webserver_v1.ErrorMessage'
        '404':
          description: Bundle rule not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_pkg_webserver_v1.ErrorMessage'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_pkg_webserver_v1.ErrorMessage'
      security:
        - BearerAuth: []
components:
  schemas:
    internal_pkg_webserver_v1.UpdateBundlePayload:
      properties:
        discount_percentage:
          type: integer
        discount_type:
          type: string
        discounts:
          items:
            $ref: '#/components/schemas/internal_pkg_webserver_v1.BundleGroupDiscount'
          type: array
        exclude_discounted_price:
          description: If products with discounts should be excluded from the bundle
          type: boolean
        exclude_full_price:
          description: If products with no discounts should be excluded from the bundle
          type: boolean
        items:
          description: Ensure at least one element is present
          items:
            type: string
          type: array
        quantity:
          type: integer
        tag_conditions:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.TagConditionsReq
      required:
        - discounts
        - items
      type: object
    internal_pkg_webserver_v1.OkResponseProductBundleRule:
      properties:
        data:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.BundleRule
        details:
          description: >-
            Additional contextual information about the response. Used to
            provide supplementary details beyond the main data payload, such as
            validation warnings or processing notes
          items:
            type: string
          type: array
        success:
          type: boolean
      type: object
    internal_pkg_webserver_v1.ErrorMessage:
      properties:
        details:
          items:
            type: string
          type: array
        message:
          type: string
        success:
          type: boolean
      type: object
    internal_pkg_webserver_v1.BundleGroupDiscount:
      properties:
        amount_cents:
          minimum: 0
          type: integer
        currency_code:
          type: string
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.TagConditionsReq:
      properties:
        brands:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.SingleTagConditionReq
        categories:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.SingleTagConditionReq
        collections:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.SingleTagConditionReq
        series:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.SingleTagConditionReq
        tags:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.SingleTagConditionReq
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.BundleRule:
      properties:
        bundle_id:
          description: Bundle ID
          type: string
        discount_percentage:
          description: Discount percentage [1-100]
          type: integer
        discount_type:
          description: Discount type [fixed, relative]
          type: string
        discounts:
          additionalProperties:
            format: int64
            type: integer
          description: Discount for bundle. Amount is stored in cents
          type: object
        exclude_discounted_price:
          description: If products with discounted price should be excluded
          type: boolean
        exclude_full_price:
          description: If products with full price should be excluded
          type: boolean
        id:
          description: ID
          type: string
        items:
          description: Products associated with the bundle rule
          items:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.BundleItem
          type: array
        quantity:
          description: Quantity of products needed to trigger the bundle
          type: integer
        tag_conditions:
          allOf:
            - $ref: >-
                #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.TagConditionsResp
          description: Conditions for discount tags
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.SingleTagConditionReq:
      properties:
        ids:
          items:
            type: string
          minItems: 1
          type: array
          uniqueItems: true
        mode:
          allOf:
            - $ref: >-
                #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.DiscountTagEntityMode
          enum:
            - include
            - exclude
      required:
        - ids
        - mode
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.BundleItem:
      properties:
        description:
          type: string
        id:
          type: string
        image_urls:
          items:
            type: string
          type: array
        product_name:
          type: string
        product_number:
          type: string
        slug:
          type: string
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.TagConditionsResp:
      properties:
        brands:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.SingleTagConditionResp
        categories:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.SingleTagConditionResp
        collections:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.SingleTagConditionResp
        series:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.SingleTagConditionResp
        tags:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.SingleTagConditionResp
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.DiscountTagEntityMode:
      enum:
        - include
        - exclude
      type: string
      x-enum-varnames:
        - DiscountTagEntityModeInclude
        - DiscountTagEntityModeExclude
    github_com_enadhq_nabbit_internal_pkg_webserver_models.SingleTagConditionResp:
      properties:
        mode:
          $ref: >-
            #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.DiscountTagEntityMode
        values:
          items:
            $ref: >-
              #/components/schemas/github_com_enadhq_nabbit_internal_pkg_webserver_models.TagConditionTag
          type: array
      type: object
    github_com_enadhq_nabbit_internal_pkg_webserver_models.TagConditionTag:
      properties:
        id:
          type: string
        name:
          type: string
      type: object

````