DiscountsCodeApp
Lists discount codes managed by apps.
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.
- AppDiscountTypeTitle supports the '=, !=' comparison operators.
- AppDiscountTypeDiscountClass supports the '=, !=' comparison operators.
For example, the following queries are processed server-side:
SELECT * FROM DiscountsCodeApp WHERE Title = 'Val1'
SELECT * FROM DiscountsCodeApp WHERE DiscountClass = 'Val1'
SELECT * FROM DiscountsCodeApp WHERE EndsAt = '2023-01-01 11:10:00'
SELECT * FROM DiscountsCodeApp WHERE StartsAt = '2023-01-01 11:10:00'
SELECT * FROM DiscountsCodeApp WHERE CreatedAt = '2023-01-01 11:10:00'
SELECT * FROM DiscountsCodeApp WHERE UpdatedAt = '2023-01-01 11:10:00'
SELECT * FROM DiscountsCodeApp WHERE AppDiscountTypeTitle = 'Val1'
SELECT * FROM DiscountsCodeApp WHERE AppDiscountTypeDiscountClass = 'Val1'
Insert
The following columns can be used to create a new record:
Title, EndsAt, StartsAt, UsageLimit, AppliesOncePerCustomer, AppDiscountTypeFunctionId, CombinesWithOrderDiscounts, CombinesWithProductDiscounts, CombinesWithShippingDiscounts, DiscountCustomerAllAllCustomers
The following pseudo-columns can be used to create a new record:
Code, AddAllCustomers, CustomersToAdd, CustomersToRemove, CustomerSegmentsToAdd, CustomerSegmentsToRemove
Update
The following columns can be updated:
Title, EndsAt, StartsAt, UsageLimit, AppliesOncePerCustomer, AppDiscountTypeFunctionId, CombinesWithOrderDiscounts, CombinesWithProductDiscounts, CombinesWithShippingDiscounts, DiscountCustomerAllAllCustomers
The following pseudo-columns can be used to update a record:
Code, 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 app record. | |
| DiscountId | String | True |
The globally unique identifier of the discount associated with this app discount. | |
| Title | String | False |
The display title of the discount. | |
| Status | String | True |
The current status of the discount, such as active or expired. | |
| 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. | |
| RecurringCycleLimit | Int | True |
The maximum number of billing cycles in which this discount can apply to subscriptions. | |
| AppliesOncePerCustomer | Bool | False |
Indicates whether the discount can be redeemed only once per customer. | |
| 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. | |
| AppDiscountTypeFunctionId | String | False |
The globally unique identifier of the function providing the app discount type. | |
| AppDiscountTypeTitle | String | True |
The display title of the app discount type. | |
| AppDiscountTypeDescription | String | True |
The description of the app discount type. | |
| AppDiscountTypeAppKey | String | True |
The client identifier of the app providing the app discount type. | |
| AppDiscountTypeDiscountClass | String | True |
The classification of the app discount type, used for combining logic. | |
| AppDiscountTypeTargetType | String | True |
The target type of the app discount type. Possible values include 'SHIPPING_LINE' and 'LINE_ITEM'. | |
| 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. | |
| DiscountCustomerAllAllCustomers | Bool | False |
Indicates whether the discount can be applied by all customers. This value is always true. | |
| ErrorHistoryFirstOccurredAt | Datetime | True |
The date and time when the first error related to this discount occurred. | |
| ErrorHistoryErrorsFirstOccurredAt | Datetime | True |
The date and time when the first error entry was recorded in the error history. | |
| ErrorHistoryHasSharedRecentErrors | Bool | True |
Indicates whether the merchant has shared recent errors with the app developer. | |
| ErrorHistoryHasBeenSharedSinceLastError | Bool | True |
Indicates whether the merchant has shared errors with the app developer since the most recent error occurred. | |
| 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. |
| AddAllCustomers | Bool |
Indicates whether the discount should apply to all customers automatically. |
| 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. |