DiscountsCodeBasic
Contains standard discount code data, including percentage or fixed-value discounts and usage metrics.
Table-Specific Information
Select
The connector uses the Shopify API to process WHERE clause conditions built with the following columns and operators. The connector processes other filters client-side within the connector.
- Title supports the '=, !=' comparison operators.
- DiscountClass supports the '=' comparison operator.
- StartsAt supports the '=, !=, <, >, >=, <=' comparison operators.
For example, the following queries are processed server-side:
SELECT * FROM DiscountsCodeBasic WHERE Title = 'Val1'
SELECT * FROM DiscountsCodeBasic WHERE DiscountClass = 'Val1'
SELECT * FROM DiscountsCodeBasic WHERE StartsAt = '2023-01-01 11:10:00'
Insert
The following columns can be used to create a new record:
Title, EndsAt, StartsAt, UsageLimit, RecurringCycleLimit, AppliesOncePerCustomer, CombinesWithOrderDiscounts, CombinesWithProductDiscounts, CombinesWithShippingDiscounts, CustomerGetsAppliesOnSubscription, CustomerGetsAppliesOnOneTimePurchase, DiscountCustomerAllAllCustomers, DiscountMinimumQuantityGreaterThanOrEqualToQuantity
The following pseudo-columns can be used to create a new record:
Code, AppliesOnEachItem, DiscountAmount, ProductsToAdd, ProductsToRemove, AddAllCustomers, CustomersToAdd, CustomersToRemove, CustomerSegmentsToAdd, CustomerSegmentsToRemove
Update
The following columns can be updated:
Title, EndsAt, StartsAt, UsageLimit, RecurringCycleLimit, AppliesOncePerCustomer, CombinesWithOrderDiscounts, CombinesWithProductDiscounts, CombinesWithShippingDiscounts, CustomerGetsAppliesOnSubscription, CustomerGetsAppliesOnOneTimePurchase, DiscountCustomerAllAllCustomers, DiscountMinimumQuantityGreaterThanOrEqualToQuantity
The following pseudo-columns can be used to update a record:
Code, AppliesOnEachItem, DiscountAmount, ProductsToAdd, ProductsToRemove, 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 |
A globally unique identifier for the discount code record. | |
| Title | String | False |
The display name or title of the discount as shown in the Shopify admin and storefront. | |
| Status | String | True |
The current operational state of the discount, such as active, scheduled, or expired. | |
| Summary | String | True |
A detailed description summarizing the purpose, scope, and conditions of the discount. | |
| CodesCount | Int | True |
The total number of individual redemption codes associated with this discount. | |
| CodesCountPrecision | String | True |
Specifies how precise or approximate the total count of redemption codes is. | |
| DiscountClass | String | True |
Defines the classification of the discount, indicating how it can combine with other discounts (for example, product-level or order-level). | |
| EndsAt | Datetime | False |
The date and time when the discount expires. Returns 'null' for discounts with no defined end date. | |
| ShortSummary | String | True |
A concise summary highlighting the main details of the discount. | |
| StartsAt | Datetime | False |
The date and time when the discount becomes active and available for use. | |
| UsageLimit | Int | False |
The maximum number of times this discount code can be redeemed across all customers. | |
| AsyncUsageCount | Int | True |
The total number of times the discount has been used. This count is updated asynchronously and may not reflect real-time usage. | |
| HasTimelineComment | Bool | True |
Indicates whether any timeline comments or internal notes have been added to this discount record. | |
| RecurringCycleLimit | Int | False |
Specifies the number of billing cycles during which the discount applies for recurring purchases or subscriptions. | |
| AppliesOncePerCustomer | Bool | False |
If true, each customer can redeem the discount code only once. | |
| CreatedAt | Datetime | True |
The date and time when the discount was created within Shopify. | |
| CombinesWithOrderDiscounts | Bool | False |
Indicates whether this discount can be used in combination with other order-level discounts. | |
| CombinesWithProductDiscounts | Bool | False |
Indicates whether this discount can be used in combination with product-level discounts. | |
| CombinesWithShippingDiscounts | Bool | False |
Indicates whether this discount can be used in combination with shipping-related discounts. | |
| CustomerGetsAppliesOnSubscription | Bool | False |
Specifies whether the discount applies to subscription-based items that are billed on a recurring schedule. | |
| CustomerGetsAppliesOnOneTimePurchase | Bool | False |
Specifies whether the discount applies to standard one-time purchase items. | |
| DiscountCustomerAllAllCustomers | Bool | False |
Indicates whether all customers are eligible to use this discount. This value is always 'true'. | |
| DiscountMinimumQuantityGreaterThanOrEqualToQuantity | String | False |
The minimum quantity of items required for the discount to be applied. | |
| TotalSalesAmount | Decimal | True |
The total amount of sales revenue associated with orders that used this discount code. | |
| TotalSalesCurrencyCode | String | True |
The ISO currency code representing the currency of the total sales amount. |
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 alphanumeric discount code that customers enter at checkout to apply the discount. |
| AppliesOnEachItem | Bool |
If true, the discount applies individually to each eligible item; if false, the discount amount is distributed across all eligible items. |
| DiscountAmount | Decimal |
The monetary value or percentage of the discount being applied. |
| ProductsToAdd | String |
A comma-separated list of product IDs to include in the discount's eligibility. |
| ProductsToRemove | String |
A comma-separated list of product IDs to exclude from the discount's eligibility. |
| AddAllCustomers | Bool |
If true, the discount automatically applies to all customers without restrictions. |
| CustomersToAdd | String |
A comma-separated list of customer IDs to grant access to this discount. |
| CustomersToRemove | String |
A comma-separated list of customer IDs to revoke access to this discount. |
| CustomerSegmentsToAdd | String |
A comma-separated list of customer segment IDs to include in the discount's eligibility. |
| CustomerSegmentsToRemove | String |
A comma-separated list of customer segment IDs to exclude from the discount's eligibility. |