CouponCodes
Creates, retrieves, and deletes coupon codes for a promotion.
Table Specific Information
Select
The provider uses the BigCommerce API to process WHERE clause conditions built with the following columns and operators:
- PromotionId supports the = comparison. A value for PromotionId is required.
- Id supports the = comparison.
- Code supports the = comparison.
The rest of the filter is executed client-side within the provider.
For example, the following queries are processed server-side:
SELECT * FROM CouponCodes WHERE PromotionId = 10
SELECT * FROM CouponCodes WHERE PromotionId = 10 AND Id = 5
Insert
To insert a coupon code, specify PromotionId and Code.
INSERT INTO CouponCodes (PromotionId, Code, MaxUses) VALUES (10, 'SAVE10', 100)
Delete
DELETE FROM CouponCodes WHERE PromotionId = 10 AND Id = 5
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | Integer | True |
The unique identifier of the coupon code. |
| PromotionId [KEY] | Integer | False |
The Id of the promotion this coupon code belongs to. |
| Code | String | False |
A unique code customers can use to manually apply the discount. Only letters, numbers, spaces, underscores, and hyphens are allowed. |
| MaxUses | Integer | False |
The maximum number of times this code can be used in total. Defaults to 0 (unlimited). |
| MaxUsesPerCustomer | Integer | False |
The maximum number of times a single customer can use this code. Defaults to 0 (unlimited). |
| CurrentUses | Integer | True |
The number of times this code has been used. |
| Created | Datetime | True |
Date and time the coupon code was created. |