DiscountsCodeBxgy
Lists buy-X-get-Y discount codes.
Table-Specific Information
Select
The driver uses the Shopify API to process WHERE clause conditions built with the following columns and operators. The driver processes other filters client-side within the driver.
- Title supports the '=, !=' comparison operators.
- DiscountClass supports the '=, !=' comparison operators.
- EndsAt supports the '=, !=, <, >, >=, <=' comparison operators.
- StartsAt supports the '=, !=, <, >, >=, <=' comparison operators.
- CreatedAt supports the '=, <, >, >=, <=' comparison operators.
- UpdatedAt supports the '=, <, >, >=, <=' comparison operators.
For example, the following queries are processed server-side:
SELECT * FROM DiscountsCodeBxgy WHERE Title = 'Val1'
SELECT * FROM DiscountsCodeBxgy WHERE DiscountClass = 'Val1'
SELECT * FROM DiscountsCodeBxgy WHERE EndsAt = '2023-01-01 11:10:00'
SELECT * FROM DiscountsCodeBxgy WHERE StartsAt = '2023-01-01 11:10:00'
SELECT * FROM DiscountsCodeBxgy WHERE CreatedAt = '2023-01-01 11:10:00'
SELECT * FROM DiscountsCodeBxgy WHERE UpdatedAt = '2023-01-01 11:10:00'
Insert
The following columns can be used to create a new record:
Title, EndsAt, StartsAt, UsageLimit, AppliesOncePerCustomer, UsesPerOrderLimit, CombinesWithOrderDiscounts, CombinesWithProductDiscounts, CombinesWithShippingDiscounts
The following pseudo-columns can be used to create a new record:
Code, DiscountOnQuantity, DiscountPercentage, ProductsToAdd, ProductsToRemove, DiscountAmountToBuy, DiscountQuantityToBuy, ProductsBuysToAdd, ProductsBuysToRemove, AddAllCustomers, CustomersToAdd, CustomersToRemove, CustomerSegmentsToAdd, CustomerSegmentsToRemove
Update
The following columns can be updated:
Title, EndsAt, StartsAt, UsageLimit, AppliesOncePerCustomer, UsesPerOrderLimit, CombinesWithOrderDiscounts, CombinesWithProductDiscounts, CombinesWithShippingDiscounts
The following pseudo-columns can be used to update a record:
Code, DiscountOnQuantity, DiscountPercentage, ProductsToAdd, ProductsToRemove, DiscountAmountToBuy, DiscountQuantityToBuy, ProductsBuysToAdd, ProductsBuysToRemove, AddAllCustomers, CustomersToAdd, CustomersToRemove, CustomerSegmentsToAdd, CustomerSegmentsToRemove
Delete
You can delete entries by specifying the following column:
Id
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | String | True |
The globally unique identifier of the discount code record. | |
| Title | String | False |
The display title of the discount. | |
| Status | String | True |
The current status of the discount, such as active or expired. | |
| Summary | String | True |
A detailed summary of the discount and how it is applied. | |
| CodesCount | Int | True |
The number of unique discount codes generated for this discount. | |
| CodesCountPrecision | String | True |
The level of precision applied to the discount code count value. | |
| DiscountClass | String | True |
The classification of the discount, used for determining compatibility with other discounts. | |
| EndsAt | Datetime | False |
The date and time when the discount ends. Returns null for open-ended discounts. | |
| StartsAt | Datetime | False |
The date and time when the discount becomes active. | |
| UsageLimit | Int | False |
The maximum number of times this discount can be used across all customers. | |
| AsyncUsageCount | Int | True |
The number of times the discount has been used. This value is updated asynchronously and might differ from the actual usage count. | |
| HasTimelineComment | Bool | True |
Indicates whether timeline comments have been added to the discount record. | |
| AppliesOncePerCustomer | Bool | False |
Indicates whether the discount can be redeemed only once per customer. | |
| UsesPerOrderLimit | Int | False |
The maximum number of times this discount can be applied within a single order. | |
| CreatedAt | Datetime | True |
The date and time when the discount record was created. | |
| UpdatedAt | Datetime | True |
The date and time when the discount was last updated. | |
| CombinesWithOrderDiscounts | Bool | False |
Indicates whether the discount can be combined with order-level discounts. | |
| CombinesWithProductDiscounts | Bool | False |
Indicates whether the discount can be combined with product-level discounts. | |
| CombinesWithShippingDiscounts | Bool | False |
Indicates whether the discount can be combined with shipping-level discounts. | |
| CustomerGetsAppliesOnSubscription | Bool | True |
Indicates whether the discount applies to subscription items. | |
| CustomerGetsAppliesOnOneTimePurchase | Bool | True |
Indicates whether the discount applies to regular one-time purchase items. | |
| DiscountCustomerAllAllCustomers | Bool | True |
Indicates whether the discount can be applied by all customers. This value is always true. | |
| TotalSalesAmount | Decimal | True |
The total sales amount attributed to this discount, expressed as a decimal money value. | |
| TotalSalesCurrencyCode | String | True |
The currency code of the total sales amount attributed to this discount. |
Pseudo-Columns
Pseudo-columns are fields that can only be used in the types of statements under which they are explicitly listed. They are not standard columns but instead provide additional functionality for specific operations.
| Name | Type | Description |
| Code | String |
The code customers must enter to redeem the discount. |
| DiscountOnQuantity | String |
The number of items discounted as part of the Buy X, Get Y promotion. |
| DiscountPercentage | Double |
The percentage value of the discount applied to eligible items. |
| ProductsToAdd | String |
A comma-separated list of product Ids to include in the discount. |
| ProductsToRemove | String |
A comma-separated list of product Ids to exclude from the discount. |
| DiscountAmountToBuy | String |
The amount or value associated with the prerequisite purchase for the discount. |
| DiscountQuantityToBuy | Double |
The quantity of prerequisite items that must be purchased for the discount to apply. |
| ProductsBuysToAdd | String |
A comma-separated list of product Ids to add as eligible prerequisites for the discount. |
| ProductsBuysToRemove | String |
A comma-separated list of product Ids to remove from eligible prerequisites for the discount. |
| AddAllCustomers | Bool |
Indicates whether all customers are automatically eligible for the discount. |
| CustomersToAdd | String |
A comma-separated list of customer Ids to include as eligible for the discount. |
| CustomersToRemove | String |
A comma-separated list of customer Ids to remove from discount eligibility. |
| CustomerSegmentsToAdd | String |
A comma-separated list of customer segment Ids to include as eligible for the discount. |
| CustomerSegmentsToRemove | String |
A comma-separated list of customer segment Ids to remove from discount eligibility. |