> 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.

# Order Promotion Code Samples

## \$X off when you purchase two of X product or one of X product (OR operator)

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "$50 off when you buy two tiered wire baskets or a small purple towel",
  "redemption_type": "AUTOMATIC",
  "rules": [
    {
      "condition": {
        "or": [
          {
            "cart": {
              "items": {
                "products": [
                  118
                ]
              },
              "minimum_quantity": 2
            }
          },
          {
            "cart": {
              "items": {
                "variants": [
                  134
                ]
              },
              "minimum_quantity": 1
            }
          }
        ]
      },
      "action": {
        "cart_value": {
          "discount": {
            "fixed_amount": "50"
          }
        }
      },
      "apply_once": true
    }
  ]
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  "data": {
    "id": 53,
    "name": "$50 off when you buy two tiered wire baskets or a small purple towel",
    "created_from": "api",
    "customer": {
        "group_ids": [],
        "minimum_order_count": 0,
        "excluded_group_ids": [],
        "segments": null
    },
    "rules": [
      {
        "action": {
            "cart_value": {
                "discount": {
                    "fixed_amount": "50"
                }
            }
        },
        "apply_once": true,
        "stop": false,
        "condition": {
          "or": [
            {
              "cart": {
                "items": {
                  "products": [
                    118
                  ]
                },
                "minimum_quantity": 2
              }
            },
            {
              "cart": {
                "items": {
                  "variants": [
                    134
                  ]
                },
                "minimum_quantity": 1
              }
            }
          ]
        }
      }
    ],
    "notifications": [],
    "stop": false,
    "currency_code": "USD",
    "redemption_type": "AUTOMATIC",
    "shipping_address": null,
    "current_uses": 0,
    "max_uses": null,
    "start_date": "2022-07-22T18:12:50+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## Spend $X and get $X off order

#### Request

**`Example request`**

```json title="Example request" showLineNumbers={false}
{
  "name": "Spend $X and get $X off order",
  "redemption_type": "AUTOMATIC",
  "rules": [
    {
      "action": {
        "cart_value": {
          "discount": {
            "fixed_amount": "20"
          }
        }
      },
      "apply_once": true,
      "stop": true,
      "condition": {
        "cart": {
          "minimum_spend": "200"
        }
      }
    }
  ],
  "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",
  "status": "ENABLED"
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  "data": {
    "id": 28,
    "name": "Spend $X and get $X off order",
    "created_from": "api",
    "customer": {
      "group_ids": [],
      "minimum_order_count": 0,
      "excluded_group_ids": [],
      "segments": null
    },
    "rules": [
      {
        "action": {
          "cart_value": {
            "discount": {
              "fixed_amount": "20"
            }
          }
        },
        "apply_once": true,
        "stop": false,
        "condition": {
          "cart": {
            "minimum_spend": "200"
          }
        }
      }
    ],
    "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": "2022-07-21T16:39:16+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## Order at least \$X and get X item free

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "Order at least $X and get X item free",
  "redemption_type": "AUTOMATIC",
  "rules": [
    {
      "action": {
        "gift_item": {
          "product_id": 130,
          "quantity": 1
        }
      },
      "apply_once": true,
      "stop": false,
      "currency_code": "AUD",
      "condition": {
        "cart": {
          "minimum_spend": "200"
        }
      }
    }
  ],
  "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,
  "status": "ENABLED"
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  "data": {
    "id": 29,
    "name": "Order at least $X and get X item free",
    "created_from": "api",
    "customer": {
        "group_ids": [],
        "minimum_order_count": 0,
        "excluded_group_ids": [],
        "segments": null
    },
    "rules": [
      {
        "action": {
          "gift_item": {
            "quantity": 1,
            "product_id": 130
          }
        },
        "apply_once": true,
        "stop": false,
        "condition": {
          "cart": {
            "minimum_spend": "200"
          }
        }
      }
    ],
    "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": "2022-07-21T16:49:32+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## Take X% off items storewide except for X category (NOT operator)

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "15% off store except sale",
  "redemption_type": "AUTOMATIC",
  "rules": [
    {
      "action": {
        "cart_items": {
          "discount": {
            "percentage_amount": "15"
          },
          "items": {
            "not": {
              "categories": [
                24
              ]
            }
          }
        }
      },
      "apply_once": true,
      "stop": true
    }
  ],
  "notifications": [
    {
      "type": "UPSELL",
      "content": "15% off store except sale",
      "locations": [
        "HOME_PAGE",
        "PRODUCT_PAGE",
        "CART_PAGE"
      ]
    },
    {
      "type": "ELIGIBLE",
      "content": "15% off store except sale",
      "locations": [
        "CART_PAGE"
      ]
    },
    {
      "type": "APPLIED",
      "content": "15% off store except sale",
      "locations": [
        "CART_PAGE"
      ]
    }
  ]
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  "data": {
    "id": 30,
    "name": "15% off store except sale",
    "created_from": "api",
    "customer": {
      "group_ids": [],
      "minimum_order_count": 0,
      "excluded_group_ids": [],
      "segments": null
    },
    "rules": [
      {
        "action": {
          "cart_items": {
            "discount": {
              "percentage_amount": "15"
            },
            "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": [
      {
        "type": "UPSELL",
        "content": "15% off store except sale",
        "locations": [
          "HOME_PAGE",
          "PRODUCT_PAGE",
          "CART_PAGE"
        ]
      },
      {
        "type": "ELIGIBLE",
        "content": "15% off store except sale",
        "locations": [
          "CART_PAGE"
        ]
      },
      {
        "type": "APPLIED",
        "content": "15% off store except sale",
        "locations": [
          "CART_PAGE"
        ]
      }
    ],
    "stop": false,
    "currency_code": "USD",
    "redemption_type": "AUTOMATIC",
    "shipping_address": null,
    "current_uses": 0,
    "max_uses": null,
    "start_date": "2022-07-21T16:54:22+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## Get 10% off order subtotal up to \$25 (limited discount maximum)

#### Request

**`Example request`**

```json title="Example request"
{
  "can_be_used_with_other_promotions": true,
  "channels": [],
  "coupon_overrides_automatic_when_offering_higher_discounts": false,
  "currency_code": "USD",
  "current_uses": 0,
  "created_from": "api",
  "customer": {
    "group_ids": [],
    "minimum_order_count": 0,
    "segments": null,
    "excluded_group_ids": []
  },
  "end_date": null,
  "max_uses": null,
  "name": "Discount on order subtotal - percent",
  "notifications": [],
  "redemption_type": "AUTOMATIC",
  "rules": [
    {
      "action": {
        "cart_value": {
          "discount": {
            "percentage_amount": "10"
          },
          "maximum_allowed_discount_amount": "25"
        }
      },
      "apply_once": true,
      "stop": false
    }
  ],
  "schedule": null,
  "shipping_address": null,
  "start_date": "2025-10-15T00:00:00-05:00",
  "status": "ENABLED",
  "display_name": "Get 10% off order subtotal upto $25"
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  "data": {
    "id": 138,
    "name": "Discount on order subtotal - percent",
    "channels": [],
    "created_from": "api",
    "customer": {
      "group_ids": [],
      "minimum_order_count": 0,
      "excluded_group_ids": [],
      "segments": null
    },
    "rules": [
      {
        "action": {
          "cart_value": {
            "discount": {
              "percentage_amount": "10"
            },
            "maximum_allowed_discount_amount": "25"
          }
        },
        "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": "2025-10-15T05:00:00+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true,
    "display_name": "Get 10% off order subtotal upto $25"
  },
  "meta": {}
}
```