Create a bundle rule
# Create a bundle rule
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
PurposeCreates a new bundle rule within a bundle, specifying products, quantity, discount settings, and optional tag conditions for product matching.
Required inputsapp_slug path team_slug path bundle_id path
Primary response200 ยท Bundle rule created successfully
Operation keymanagement-api:POST:/api/v1/{team_slug}/{app_slug}/bundle-groups/{bundle_group_id}/bundles/{bundle_id}/rules
## API ownership
- API family: Management API
- Best for: Trusted back-office workflows that create, update, organize, or delete merchant-owned data.
- Do not use from: Browser-only storefront code or public clients.
- Guide route: [/apis/management/latest](/apis/management/latest)
The OpenAPI contract defines the method, path, parameters, request body, and responses for this operation.
## Operation
- Method: `POST`
- Path: `/api/v1/{team_slug}/{app_slug}/bundle-groups/{bundle_group_id}/bundles/{bundle_id}/rules`
- Summary: Create a bundle rule
- Description: Creates a new bundle rule within a bundle, specifying products, quantity, discount settings, and optional tag conditions for product matching.
- OpenAPI contract:
management-api
- Operation ID: Not documented in the OpenAPI contract.
- Stable operation key: `management-api:POST:/api/v1/{team_slug}/{app_slug}/bundle-groups/{bundle_group_id}/bundles/{bundle_id}/rules`
Operation key uses API family, method, and path because this OpenAPI contract does not publish an operation ID.
## Parameters
| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| app_slug | path | Yes | string | App slug |
| team_slug | path | Yes | string | Team slug |
| bundle_id | path | Yes | string | Bundle ID |
## Request body
- Required: Yes
- Description: Bundle rule configuration
- Content: application/json (object)
### Create Bundle Rule Payload
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `discount_percentage` | integer | No | - |
| `discount_type` | string | No | - |
| `discounts` | object[] | Yes | - |
| `exclude_discounted_price` | boolean | No | If products with discounts should be excluded from the bundle |
| `exclude_full_price` | boolean | No | If products with no discounts should be excluded from the bundle |
| `items` | string[] | Yes | Ensure at least one element is present |
| `quantity` | integer | No | - |
| `tag_conditions` | object | No | - |
#### Bundle Group Discount
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `amount_cents` | integer | No | min: 0 |
| `currency_code` | string | No | - |
#### Tag Conditions Req
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `brands` | object | No | - |
| `categories` | object | No | - |
| `collections` | object | No | - |
| `series` | object | No | - |
| `tags` | object | No | - |
#### Single Tag Condition Req
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `ids` | string[] | Yes | minItems: 1, uniqueItems |
| `mode` | enum("include", "exclude") | Yes | - |
Generated example (synthetic)
```json
{
"discount_percentage": 0,
"discount_type": "string",
"discounts": [
{
"amount_cents": 0,
"currency_code": "string"
}
],
"exclude_discounted_price": false,
"exclude_full_price": false,
"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
| Status | Description | Content |
| --- | --- | --- |
| 200 | Bundle rule created successfully | application/json (object) |
| 400 | Invalid request | application/json (object) |
| 401 | Unauthorized access | application/json (object) |
| 404 | Bundle not found | application/json (object) |
| 500 | Internal server error | application/json (object) |
### 200 - object
#### Product Bundle Rule Response
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `data` | object | No | - |
| `details` | string[] | No | Additional contextual information about the response. Used to provide supplementary details beyond the main data payload, such as validation warnings or processing notes |
| `success` | boolean | No | - |
##### Bundle Rule
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `bundle_id` | string | No | Bundle ID |
| `discount_percentage` | integer | No | Discount percentage [1-100] |
| `discount_type` | string | No | Discount type [fixed, relative] |
| `discounts` | object | No | Discount for bundle. Amount is stored in cents |
| `exclude_discounted_price` | boolean | No | If products with discounted price should be excluded |
| `exclude_full_price` | boolean | No | If products with full price should be excluded |
| `id` | string | No | ID |
| `items` | object[] | No | Products associated with the bundle rule |
| `quantity` | integer | No | Quantity of products needed to trigger the bundle |
| `tag_conditions` | object | No | Conditions for discount tags |
##### Bundle Item
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `description` | string | No | - |
| `id` | string | No | - |
| `image_urls` | string[] | No | - |
| `product_name` | string | No | - |
| `product_number` | string | No | - |
| `slug` | string | No | - |
##### Tag Conditions Resp
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `brands` | object | No | - |
| `categories` | object | No | - |
| `collections` | object | No | - |
| `series` | object | No | - |
| `tags` | object | No | - |
##### Single Tag Condition Resp
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `mode` | enum("include", "exclude") | No | - |
| `values` | object[] | No | - |
Generated example (synthetic)
```json
{
"data": {
"bundle_id": "string",
"discount_percentage": 0,
"discount_type": "string",
"discounts": {},
"exclude_discounted_price": false,
"exclude_full_price": false,
"id": "string",
"items": [
{
"description": "string",
"id": "string",
"image_urls": [],
"product_name": "string",
"product_number": "string",
"slug": "string"
}
],
"quantity": 0,
"tag_conditions": {
"brands": {
"mode": "include",
"values": []
},
"categories": {
"mode": "include",
"values": []
},
"collections": {
"mode": "include",
"values": []
},
"series": {
"mode": "include",
"values": []
},
"tags": {
"mode": "include",
"values": []
}
}
},
"details": [
"string"
],
"success": false
}
```
### 400 - object
#### Error Message
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `details` | string[] | No | - |
| `message` | string | No | - |
| `success` | boolean | No | - |
**Generated example (synthetic):**
```json
{
"details": [
"string"
],
"message": "string",
"success": false
}
```
### 401 - object
#### Error Message
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `details` | string[] | No | - |
| `message` | string | No | - |
| `success` | boolean | No | - |
**Generated example (synthetic):**
```json
{
"details": [
"string"
],
"message": "string",
"success": false
}
```
### 404 - object
#### Error Message
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `details` | string[] | No | - |
| `message` | string | No | - |
| `success` | boolean | No | - |
**Generated example (synthetic):**
```json
{
"details": [
"string"
],
"message": "string",
"success": false
}
```
### 500 - object
#### Error Message
| Property | Type | Required | Details |
| --- | --- | --- | --- |
| `details` | string[] | No | - |
| `message` | string | No | - |
| `success` | boolean | No | - |
**Generated example (synthetic):**
```json
{
"details": [
"string"
],
"message": "string",
"success": false
}
```
## Contract identity
Use these fields to confirm you are implementing the intended endpoint contract.
- API family: Management API
- Method: `POST`
- Path: `/api/v1/{team_slug}/{app_slug}/bundle-groups/{bundle_group_id}/bundles/{bundle_id}/rules`
- Operation ID: Not documented in the OpenAPI contract.
- Stable operation key: `management-api:POST:/api/v1/{team_slug}/{app_slug}/bundle-groups/{bundle_group_id}/bundles/{bundle_id}/rules`
- OpenAPI tag: Bundle Rules
- OpenAPI summary: Create a bundle rule