DiscountsCodeApp
Returns a list of discounts.
Table-Specific Information
Select
The 本製品 uses the Shopify API to process WHERE clause conditions built with the following columns and operators. The 本製品 processes other filters client-side within the 本製品.
- Title supports the '=,!=' comparison operators.
- DiscountClass supports the '=,!=' comparison operators.
- StartsAt 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
SELECT * FROM DiscountsCodeApp WHERE Title = 'Val1'
SELECT * FROM DiscountsCodeApp WHERE DiscountClass = 'Val1'
SELECT * FROM DiscountsCodeApp WHERE StartsAt = '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 updated:
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 |
A globally-unique ID. | |
DiscountId | String | True |
The ID for the discount. | |
Title | String | False |
The title of the discount. | |
Status | String | True |
The status of the discount. | |
CodeCount | Int | True |
The number of redeem codes for the discount. | |
DiscountClass | String | True |
The class of the discount for combining purposes. | |
EndsAt | Datetime | False |
The date and time when the discount ends. For open-ended discounts, use 'null'. | |
StartsAt | Datetime | False |
The date and time when the discount starts. | |
UsageLimit | Int | False |
The maximum number of times that the discount can be used. | |
AsyncUsageCount | Int | True |
The number of times that the discount has been used. | |
HasTimelineComment | Bool | True |
Indicates whether there are any timeline comments on the discount. | |
RecurringCycleLimit | Int | True |
The number of times a discount applies on recurring purchases (subscriptions). | |
AppliesOncePerCustomer | Bool | False |
Whether the discount can be applied only once per customer. | |
CreatedAt | Datetime | True |
The date and time when the discount was created. | |
AppDiscountTypeFunctionId | String | False |
The ID of the function providing the app discount type. | |
AppDiscountTypeTitle | String | True |
The title of the app discount type. | |
AppDiscountTypeDescription | String | True |
A description of the app discount type. | |
AppDiscountTypeAppKey | String | True |
The client ID of the app providing the app discount type. | |
AppDiscountTypeDiscountClass | String | True |
The class of the app discount type. | |
AppDiscountTypeTargetType | String | True |
The target type of the app discount type. Possible values: 'SHIPPING_LINE' and 'LINE_ITEM'. | |
CombinesWithOrderDiscounts | Bool | False |
Combines with order discounts. | |
CombinesWithProductDiscounts | Bool | False |
Combines with product discounts. | |
CombinesWithShippingDiscounts | Bool | False |
Combines with shipping discounts. | |
DiscountCustomerAllAllCustomers | Bool | False |
Whether the discount can be applied by all customers. This value is always 'true'. | |
ErrorHistoryFirstOccurredAt | Datetime | True |
The date and time that the first error occurred. | |
ErrorHistoryErrorsFirstOccurredAt | Datetime | True |
The date and time that the first error occurred. | |
ErrorHistoryHasSharedRecentErrors | Bool | True |
Whether the merchant has shared all the recent errors with the developer. | |
ErrorHistoryHasBeenSharedSinceLastError | Bool | True |
Whether the merchant has shared all the recent errors with the developer. | |
TotalSalesAmount | Decimal | True |
Decimal money amount. | |
TotalSalesCurrencyCode | String | True |
Currency of the money. |
Pseudo-Columns
SELECT ステートメントのWHERE 句では、疑似カラムフィールドを使用して、データソースから返されるタプルを詳細に制御したり、INSERT ステートメントのパラメータとして使用したりすることができます。
Name | Type | Description |
Code | String |
The code to use the discount. |
AddAllCustomers | Bool |
Whether all customers can use this discount. |
CustomersToAdd | String |
A simple, comma-separated list of customers IDs to add. |
CustomersToRemove | String |
A simple, comma-separated list of customers IDs to remove. |
CustomerSegmentsToAdd | String |
A simple, comma-separated list of customers IDs to add. |
CustomerSegmentsToRemove | String |
A simple, comma-separated list of customers IDs to remove. |