---
search:
  tags:
    - Bundle Rules
    - POST
seo:
  description: >-
    Creates a new… Reference for the POST
    /api/v1/{team_slug}/{app_slug}/bundle-groups/{bundle_group_id}/bundles/{bundle_id}/rules
    endpoint in the Management API.
sidebar:
  label: Create a bundle rule
  badge: POST
title: Create a bundle rule
type: openapi-operation
---
Creates a new bundle rule within a bundle, specifying products, quantity, discount settings, and optional tag conditions for product matching.

`POST /api/v1/{team_slug}/{app_slug}/bundle-groups/{bundle_group_id}/bundles/{bundle_id}/rules`

**Request body** (`application/json`, required)

Bundle rule configuration

- `discount_percentage` (integer)
- `discount_type` (string)
- `discounts` (internal_pkg_webserver_v1.BundleGroupDiscount[])
- `exclude_discounted_price` (boolean) — If products with discounts should be excluded from the bundle
- `exclude_full_price` (boolean) — If products with no discounts should be excluded from the bundle
- `items` (string[], required) — Ensure at least one element is present
- `quantity` (integer)
- `tag_conditions` (github_com_enadhq_nabbit_internal_pkg_webserver_models.TagConditionsReq)

Request body example:

```json
{
  "discount_percentage": 0,
  "discount_type": "string",
  "discounts": [
    {
      "amount_cents": 0,
      "currency_code": "string"
    }
  ],
  "exclude_discounted_price": true,
  "exclude_full_price": true,
  "items": [
    "string"
  ],
  "quantity": 0,
  "tag_conditions": {
    "brands": {
      "ids": [
        "string"
      ],
      "mode": "include"
    },
    "categories": {
      "ids": [
        "string"
      ],
      "mode": "include"
    },
    "collections": {
      "ids": [
        "string"
      ],
      "mode": "include"
    },
    "series": {
      "ids": [
        "string"
      ],
      "mode": "include"
    },
    "tags": {
      "ids": [
        "string"
      ],
      "mode": "include"
    }
  }
}
```

**Responses**

- `200` — Bundle rule created successfully
- `201` — Successful response
- `400` — Invalid request
- `401` — Unauthorized access
- `404` — Bundle not found
- `500` — Internal server error

Response example, 200:

```json
{
  "data": {
    "bundle_id": "string",
    "discount_percentage": 0,
    "discount_type": "string",
    "discounts": {
      "property1": 0,
      "property2": 0
    },
    "exclude_discounted_price": true,
    "exclude_full_price": true,
    "id": "string",
    "items": [
      {
        "description": "string",
        "id": "string",
        "image_urls": [
          "string"
        ],
        "product_name": "string",
        "product_number": "string",
        "slug": "string"
      }
    ],
    "quantity": 0,
    "tag_conditions": {
      "brands": {
        "mode": "include",
        "values": [
          {
            "id": "string",
            "name": "string"
          }
        ]
      },
      "categories": {
        "mode": "include",
        "values": [
          {
            "id": "string",
            "name": "string"
          }
        ]
      },
      "collections": {
        "mode": "include",
        "values": [
          {
            "id": "string",
            "name": "string"
          }
        ]
      },
      "series": {
        "mode": "include",
        "values": [
          {
            "id": "string",
            "name": "string"
          }
        ]
      },
      "tags": {
        "mode": "include",
        "values": [
          {
            "id": "string",
            "name": "string"
          }
        ]
      }
    }
  },
  "details": [
    "string"
  ],
  "success": true
}
```
