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

# Customer Promotion Code Samples

## 10% off for VIP customers

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "10% off for VIP customers",
  "redemption_type": "AUTOMATIC",
  "customer": {
    "group_ids": [
      1
    ]
  },
  "rules": [
    {
      "action": {
        "cart_value": {
          "discount": {
            "percentage_amount": "10"
          }
        }
      }
    }
  ]
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  "data": {
    "id": 17,
    "name": "10% off for VIP customers",
    "created_from": "api",
    "customer": {
      "group_ids": [
        1
      ],
      "minimum_order_count": 0,
      "excluded_group_ids": [],
      "segments": null
    },
    "rules": [
      {
        "action": {
          "cart_value": {
            "discount": {
              "percentage_amount": "10"
            }
          }
        },
        "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-19T13:46:55+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## 5% off for non-VIP customers (including guest customers, and registered customers who are not assigned to any groups, and registered customers who are assigned to a non-VIP group)

#### Request

**`Example request`**

```json title="Example request" showLineNumbers={false}
{
  "name": "5% off for non-VIP customers",
  "redemption_type": "AUTOMATIC",
  "customer": {
    "excluded_group_ids": [
      1
    ]
  },
  "rules": [
    {
      "action": {
        "cart_value": {
          "discount": {
            "percentage_amount": "5"
          }
        }
      }
    }
  ]
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  "data": {
    "id": 18,
    "name": "5% off for non-VIP customers",
    "created_from": "api",
    "customer": {
      "group_ids": [],
      "minimum_order_count": 0,
      "excluded_group_ids": [
        1
      ],
      "segments": null
    },
    "rules": [
      {
        "action": {
          "cart_value": {
            "discount": {
              "percentage_amount": "5"
            }
          }
        },
        "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-19T13:55:11+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## 3% off for guest customers or customers not assigned to any group

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "3% off for guest customers or customers not assigned to any group",
  "redemption_type": "AUTOMATIC",
  "customer": {
    "group_ids": [
      0
    ]
  },
  "rules": [
    {
      "action": {
        "cart_value": {
          "discount": {
            "percentage_amount": "3"
          }
        }
      }
    }
  ]
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  "data": {
    "id": 19,
    "name": "3% off for guest customers or customers not assigned to any group",
    "created_from": "api",
    "customer": {
      "group_ids": [
          0
      ],
      "minimum_order_count": 0,
      "excluded_group_ids": [],
      "segments": null
    },
    "rules": [
      {
        "action": {
          "cart_value": {
            "discount": {
              "percentage_amount": "3"
            }
          }
        },
        "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-19T14:02:33+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## 10% off for customers with total order count of 10 or more

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "10% off for customers with total order count of 10 or more",
  "redemption_type": "AUTOMATIC",
  "customer": {
    "minimum_order_count": 10
  },
  "rules": [
    {
      "action": {
        "cart_value": {
          "discount": {
            "percentage_amount": "10"
          }
        }
      }
    }
  ]
}
```

#### Response

**`Example response`**

```json title="Example response"
{
  "data": {
    "id": 20,
    "name": "10% off for customers with total order count of 10 or more",
    "created_from": "api",
    "customer": {
      "group_ids": [],
      "minimum_order_count": 10,
      "excluded_group_ids": [],
      "segments": null
    },
    "rules": [
      {
        "action": {
          "cart_value": {
            "discount": {
              "percentage_amount": "10"
            }
          }
        },
        "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-19T14:14:12+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## 10% off for customers who belong to segment 1 or segment 2 (Closed Beta)

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "10% off for customers who belong to segment 1 or segment 2",
  "redemption_type": "AUTOMATIC",
  "customer": {
    "segments": {
      "isd": [
        "61fd72bc-7400-4a7b-ac64-96c0d315c464",
        "d52fb39d-6715-430e-a0bf-21a192d790f0"
      ]
    }
  },
  "rules": [
    {
      "action": {
        "cart_value": {
          "discount": {
            "percentage_amount": "10"
          }
        }
      }
    }
  ]
}
```

#### Response

**`Example response`**

```json title="Example response"
  // closed Beta
{
  "data": {
    "id": 48,
    "name": "10% off for customers who belong to segment 1 or segment 2",
    "created_from": "api",
    "customer": {
      "group_ids": [],
      "minimum_order_count": 0,
      "excluded_group_ids": [],
      "segments": {
        "id": [
          "61fd72bc-7400-4a7b-ac64-96c0d315c464",
          "d52fb39d-6715-430e-a0bf-21a192d790f0"
        ]
      }
    },
    "rules": [
      {
        "action": {
          "cart_value": {
            "discount": {
              "percentage_amount": "10"
            }
          }
        },
        "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-22T17:33:02+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## 10% off for customers who do NOT belong to segment 1, including those who do not belong to any segments(Closed Beta)

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "10% off for customers who do not belong to segment 1",
  "redemption_type": "AUTOMATIC",
  "customer": {
    "segments": {
      "not": {
        "id": [
          "61fd72bc-7400-4a7b-ac64-96c0d315c464"
        ]
      }
    }
  },
  "rules": [
    {
      "action": {
        "cart_value": {
          "discount": {
            "percentage_amount": "10"
          }
        }
      }
    }
  ]
}
```

#### Response

**`Example response`**

```json title="Example response"
  // closed Beta
{
  "data": {
    "id": 49,
    "name": "10% off for customers who do not belong to segment 1",
    "created_from": "api",
    "customer": {
      "group_ids": [],
      "minimum_order_count": 0,
      "excluded_group_ids": [],
      "segments": {
        "not": {
          "id": [
            "61fd72bc-7400-4a7b-ac64-96c0d315c464"
          ]
        }
      }
    },
    "rules": [
      {
        "action": {
          "cart_value": {
            "discount": {
              "percentage_amount": "10"
            }
          }
        },
        "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-22T17:41:30+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## 10% off for customers who belong to segment 1 and segment 2 (Closed Beta)

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "10% off for customers who belong to segment 1 and segment 2",
  "redemption_type": "AUTOMATIC",
  "customer": {
    "segments": {
      "and": [
        {
          "id": ["61fd72bc-7400-4a7b-ac64-96c0d315c464"]
        },
        {
          "id": ["d52fb39d-6715-430e-a0bf-21a192d790f0"]
        }
      ]
    }
  },
  "rules": [
    {
      "action": {
        "cart_value": {
          "discount": {
            "percentage_amount": "10"
          }
        }
      }
    }
  ]
}
```

#### Response

**`Example response`**

```json title="Example response"
  // closed Beta
{
  "data": {
    "id": 50,
    "name": "10% off for customers who belong to segment 1 and segment 2",
    "created_from": "api",
    "customer": {
      "group_ids": [],
      "minimum_order_count": 0,
      "excluded_group_ids": [],
      "segments": {
        "and": [
          {
            "id": [
              "61fd72bc-7400-4a7b-ac64-96c0d315c464"
            ]
          },
          {
            "id": [
              "d52fb39d-6715-430e-a0bf-21a192d790f0"
            ]
          }
        ]
      }
    },
    "rules": [
      {
        "action": {
          "cart_value": {
            "discount": {
              "percentage_amount": "10"
            }
          }
        },
        "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-22T17:44:16+00:00",
    "end_date": null,
    "status": "ENABLED",
    "schedule": null,
    "can_be_used_with_other_promotions": true
  },
  "meta": {}
}
```

## 10% off for customers who belong to segment 3 or customers who belong to segment 1 and segment 2 (Closed Beta)

#### Request

**`Example request`**

```json title="Example request"
{
  "name": "10% off for customers who belong to segment 3 or customers who belong to segment 1 and segment 2",
  "redemption_type": "AUTOMATIC",
  "customer": {
    "segments": {
      "or": [
        {
          "id": ["4d843892-d90c-4f01-a36e-ce810172c094"]
        },
        {
          "and": [
            {
              "id": ["61fd72bc-7400-4a7b-ac64-96c0d315c464"]
            },
            {
              "id": ["d52fb39d-6715-430e-a0bf-21a192d790f0"]
            }
          ]
        }
      ]
    }
  },
  "rules": [
    {
      "action": {
        "cart_value": {
          "discount": {
            "percentage_amount": "10"
          }
        }
      }
    }
  ]
}
```

#### Response

**`Example response`**

```json title="Example response"
  // closed Beta
  {
    "data": {
      "id": 51,
      "name": "10% off for customers who belong to segment 3 or customers who belong to segment 1 and segment 2",
      "created_from": "api",
      "customer": {
        "group_ids": [],
        "minimum_order_count": 0,
        "excluded_group_ids": [],
        "segments": {
          "or": [
            {
              "id": [
                "4d843892-d90c-4f01-a36e-ce810172c094"
              ]
            },
            {
              "and": [
                {
                  "id": [
                    "61fd72bc-7400-4a7b-ac64-96c0d315c464"
                  ]
                },
                {
                  "id": [
                    "d52fb39d-6715-430e-a0bf-21a192d790f0"
                  ]
                }
              ]
            }
          ]
        }
      },
      "rules": [
        {
          "action": {
            "cart_value": {
              "discount": {
                "percentage_amount": "10"
              }
            }
          },
          "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-22T17:48:59+00:00",
      "end_date": null,
      "status": "ENABLED",
      "schedule": null,
      "can_be_used_with_other_promotions": true
    },
    "meta": {}
  }
```