> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Code Samples for Multiple Rule Promotions

## Tiered \$ off order based on order value

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "Tiered $ off order based on order value",
  "redemption_type": "AUTOMATIC",
  "rules": [
    {
      "action": {
        "cart_value": {
          "discount": {
            "fixed_amount": "45"
          }
        }
      },
      "apply_once": true,
      "stop": true,
      "currency_code": "AUD",
      "condition": {
        "cart": {
          "minimum_spend": "175"
        }
      }
    },
    {
      "action": {
        "cart_value": {
          "discount": {
            "fixed_amount": "30"
          }
        }
      },
      "apply_once": true,
      "stop": true,
      "condition": {
        "cart": {
          "minimum_spend": "150"
        }
      }
    },
    {
      "action": {
        "cart_value": {
          "discount": {
            "fixed_amount": "15"
          }
        }
      },
      "apply_once": true,
      "stop": true,
      "condition": {
        "cart": {
          "minimum_spend": "100"
        }
      }
    }
  ],
  "notifications": [
    {
      "type": "UPSELL",
      "content": "<div>&nbsp;</div>",
      "locations": [
        "CART_PAGE"
      ]
    },
    {
      "type": "ELIGIBLE",
      "content": "<div>&nbsp;</div>",
      "locations": [
        "CART_PAGE"
      ]
    },
    {
      "type": "APPLIED",
      "content": "<div>&nbsp;</div>",
      "locations": [
        "CART_PAGE"
      ]
    }
  ],
  "stop": false,
  "start_date": "2019-02-01T05:00:00+00:00",
  "status": "ENABLED"
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  "data": {
    "id": 24,
    "name": "Tiered $ off order based on order value",
    "created_from": "api",
    "customer": {
      "group_ids": [],
      "minimum_order_count": 0,
      "excluded_group_ids": [],
      "segments": null
    },
    "rules": [
      {
        "action": {
          "cart_value": {
            "discount": {
              "fixed_amount": "45"
            }
          }
        },
        "apply_once": true,
        "stop": true,
        "condition": {
          "cart": {
            "minimum_spend": "175"
          }
        }
      },
      {
        "action": {
          "cart_value": {
            "discount": {
              "fixed_amount": "30"
            }
          }
        },
        "apply_once": true,
        "stop": true,
        "condition": {
          "cart": {
            "minimum_spend": "150"
          }
        }
      },
      {
        "action": {
          "cart_value": {
            "discount": {
              "fixed_amount": "15"
            }
          }
        },
        "apply_once": true,
        "stop": true,
        "condition": {
          "cart": {
            "minimum_spend": "100"
          }
        }
      }
    ],
    "notifications": [
      {
        "type": "UPSELL",
        "content": "<div>&nbsp;</div>",
        "locations": [
          "CART_PAGE"
        ]
      },
      {
        "type": "ELIGIBLE",
        "content": "<div>&nbsp;</div>",
        "locations": [
          "CART_PAGE"
        ]
      },
      {
        "type": "APPLIED",
        "content": "<div>&nbsp;</div>",
        "locations": [
          "CART_PAGE"
        ]
      }
    ],
    "stop": false,
    "currency_code": "USD",
    "redemption_type": "AUTOMATIC",
    "shipping_address": null,
    "current_uses": 0,
    "max_uses": null,
    "start_date": "2019-02-01T05:00:00+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## Apply a tiered discount to X products based on the quantity of items ordered within X

#### Request

**`Example request`**

```json title="Example request" showLineNumbers={false}
{
  "name": "Apply a tiered discount to applicable products based on the quantity of items ordered within X ",
  "redemption_type": "AUTOMATIC",
  "rules": [
    {
      "action": {
        "cart_items": {
          "discount": {
            "fixed_amount": "20"
          },
          "strategy": "LEAST_EXPENSIVE",
          "as_total": true,
          "include_items_considered_by_condition": true,
          "items": {
            "categories": [
              24
            ]
          }
        }
      },
      "apply_once": true,
      "stop": true,
      "condition": {
        "cart": {
          "items": {
            "categories": [
              35
            ]
          },
          "minimum_quantity": 4
        }
      }
    },
    {
      "action": {
        "cart_items": {
          "discount": {
            "fixed_amount": "15"
          },
          "strategy": "LEAST_EXPENSIVE",
          "as_total": true,
          "include_items_considered_by_condition": true,
          "items": {
            "categories": [
              25
            ]
          }
        }
      },
      "apply_once": true,
      "stop": true,
      "condition": {
        "cart": {
          "items": {
            "categories": [
              25
            ]
          },
          "minimum_quantity": 3
        }
      }
    },
    {
      "action": {
        "cart_items": {
          "discount": {
            "fixed_amount": "10"
          },
          "strategy": "LEAST_EXPENSIVE",
          "as_total": true,
          "include_items_considered_by_condition": true,
          "items": {
            "categories": [
              30
            ]
          }
        }
      },
      "apply_once": true,
      "stop": true,
      "condition": {
        "cart": {
          "items": {
            "categories": [
              36
            ]
          },
          "minimum_quantity": 2
        }
      }
    }
  ],
  "notifications": [
    {
      "type": "UPSELL",
      "content": "<div>&nbsp;</div>",
      "locations": [
        "CART_PAGE"
      ]
    },
    {
      "type": "ELIGIBLE",
      "content": "<div>&nbsp;</div>",
      "locations": [
        "CART_PAGE"
      ]
    },
    {
      "type": "APPLIED",
      "content": "<div>&nbsp;</div>",
      "locations": [
        "CART_PAGE"
      ]
    }
  ],
  "stop": true,
  "start_date": "2019-02-01T05:00:00+00:00",
  "status": "ENABLED"
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  "data": {
    "id": 25,
    "name": "Apply a tiered discount to applicable products based on the quantity of items ordered within X ",
    "created_from": "api",
    "customer": {
      "group_ids": [],
      "minimum_order_count": 0,
      "excluded_group_ids": [],
      "segments": null
    },
    "rules": [
      {
        "action": {
          "cart_items": {
            "discount": {
              "fixed_amount": "20"
            },
            "strategy": "LEAST_EXPENSIVE",
            "add_free_item": true,
            "as_total": true,
            "include_items_considered_by_condition": true,
            "exclude_items_on_sale": false,
            "items": {
              "categories": [
                24
              ]
            }
          }
        },
        "apply_once": true,
        "stop": true,
        "condition": {
          "cart": {
            "items": {
              "categories": [
                35
              ]
            },
            "minimum_quantity": 4
          }
        }
      },
      {
        "action": {
          "cart_items": {
            "discount": {
              "fixed_amount": "15"
            },
            "strategy": "LEAST_EXPENSIVE",
            "add_free_item": true,
            "as_total": true,
            "include_items_considered_by_condition": true,
            "exclude_items_on_sale": false,
            "items": {
              "categories": [
                25
              ]
            }
          }
        },
        "apply_once": true,
        "stop": true,
        "condition": {
          "cart": {
            "items": {
              "categories": [
                25
              ]
            },
            "minimum_quantity": 3
          }
        }
      },
      {
        "action": {
          "cart_items": {
            "discount": {
              "fixed_amount": "10"
            },
            "strategy": "LEAST_EXPENSIVE",
            "add_free_item": true,
            "as_total": true,
            "include_items_considered_by_condition": true,
            "exclude_items_on_sale": false,
            "items": {
              "categories": [
                30
              ]
            }
          }
        },
        "apply_once": true,
        "stop": true,
        "condition": {
          "cart": {
            "items": {
              "categories": [
                36
              ]
            },
            "minimum_quantity": 2
          }
        }
      }
    ],
    "notifications": [
      {
        "type": "UPSELL",
        "content": "<div>&nbsp;</div>",
        "locations": [
          "CART_PAGE"
        ]
      },
      {
        "type": "ELIGIBLE",
        "content": "<div>&nbsp;</div>",
        "locations": [
          "CART_PAGE"
        ]
      },
      {
        "type": "APPLIED",
        "content": "<div>&nbsp;</div>",
        "locations": [
          "CART_PAGE"
        ]
      }
    ],
    "stop": true,
    "currency_code": "USD",
    "redemption_type": "AUTOMATIC",
    "shipping_address": null,
    "current_uses": 0,
    "max_uses": null,
    "start_date": "2019-02-01T05:00:00+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## Up to 50% off storewide (50% off category X items and 40% off everything else)

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "Up to 50% off storewide (50% off category X items and 40% off everything else)",
  "redemption_type": "AUTOMATIC",
  "rules": [
    {
      "action": {
        "cart_items": {
          "discount": {
            "percentage_amount": 50
          },
          "items": {
            "categories": [
              36
            ]
          }
        }
      },
      "apply_once": true
    },
    {
      "action": {
        "cart_items": {
          "discount": {
            "percentage_amount": 40
          },
          "items": {
            "not": {
              "categories": [
                24
              ]
            }
          }
        }
      },
      "apply_once": true
    }
  ]
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  {
    "data": {
      "id": 26,
      "name": "Up to 50% off storewide (50% off category X items and 40% off everything else)",
      "created_from": "api",
      "customer": {
        "group_ids": [],
        "minimum_order_count": 0,
        "excluded_group_ids": [],
        "segments": null
      },
      "rules": [
        {
          "action": {
            "cart_items": {
              "discount": {
                "percentage_amount": "50"
              },
              "strategy": "LEAST_EXPENSIVE",
              "add_free_item": true,
              "as_total": false,
              "include_items_considered_by_condition": false,
              "exclude_items_on_sale": false,
              "items": {
                "categories": [
                  36
                ]
              }
            }
          },
          "apply_once": true,
          "stop": false
        },
        {
          "action": {
            "cart_items": {
              "discount": {
                "percentage_amount": "40"
              },
              "strategy": "LEAST_EXPENSIVE",
              "add_free_item": true,
              "as_total": false,
              "include_items_considered_by_condition": false,
              "exclude_items_on_sale": false,
              "items": {
                "not": {
                  "categories": [
                    24
                  ]
                }
              }
            }
          },
          "apply_once": true,
          "stop": false
        }
      ],
      "notifications": [],
      "stop": false,
      "currency_code": "USD",
      "redemption_type": "AUTOMATIC",
      "shipping_address": null,
      "current_uses": 0,
      "max_uses": null,
      "start_date": "2022-07-21T14:54:01+00:00",
      "end_date": null,
      "status": "ENABLED",
      "schedule": null,
      "can_be_used_with_other_promotions": true
    },
    "meta": {}
  }
}
```

## Buy X products, get free shipping, and 10% off order

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "Buy two of product X, get free shipping to all zones, and 10% off order",
  "redemption_type": "AUTOMATIC",
  "rules": [
    {
      "condition": {
        "cart": {
          "items": {
            "products": [
              118
            ]
          },
          "minimum_quantity": 2
        }
      },
      "action": {
        "shipping": {
          "free_shipping": true,
          "zone_ids": "*"
        }
      }
    },
    {
      "condition": {
        "cart": {
          "items": {
            "products": [
              130
            ]
          },
          "minimum_quantity": 2
        }
      },
      "action": {
        "cart_value": {
          "discount": {
            "percentage_amount": 10
          }
        }
      }
    }
  ]
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  "data": {
    "id": 27,
    "name": "Buy two of product X, get free shipping to all zones, and 10% off order",
    "created_from": "api",
    "customer": {
      "group_ids": [],
      "minimum_order_count": 0,
      "excluded_group_ids": [],
      "segments": null
    },
    "rules": [
      {
        "action": {
          "shipping": {
            "free_shipping": true,
            "zone_ids": "*"
          }
        },
        "apply_once": true,
        "stop": false,
        "condition": {
          "cart": {
            "items": {
              "products": [
                118
              ]
            },
            "minimum_quantity": 2
          }
        }
      },
      {
        "action": {
          "cart_value": {
            "discount": {
              "percentage_amount": "10"
            }
          }
        },
        "apply_once": true,
        "stop": false,
        "condition": {
          "cart": {
            "items": {
              "products": [
                130
              ]
            },
            "minimum_quantity": 2
          }
        }
      }
    ],
    "notifications": [],
    "stop": false,
    "currency_code": "USD",
    "redemption_type": "AUTOMATIC",
    "shipping_address": null,
    "current_uses": 0,
    "max_uses": null,
    "start_date": "2022-07-21T16:17:01+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```