CData Python Connector for Shopify

Build 25.0.9454

DiscountsCodeApp

Tracks app-generated discount codes, including associated price rules and redemption limits.

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 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 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 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

A globally unique identifier for the discount code app record.

DiscountId String True

The unique identifier of the parent discount that this code belongs to.

Title String False

The name or label of the discount as displayed in the Shopify admin or storefront.

Status String True

The current operational state of the discount, such as active, scheduled, or expired.

CodesCount Int True

The total number of unique redemption codes generated for this discount.

CodesCountPrecision String True

Indicates the precision of the codes count, showing how exact or estimated the total is.

DiscountClass String True

Defines how this discount interacts with others when combined, such as order-level, product-level, or shipping-level classification.

EndsAt Datetime False

The date and time when the discount expires. Returns 'null' for open-ended or ongoing discounts.

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 value is updated asynchronously and may differ from the real-time count.

HasTimelineComment Bool True

Indicates whether any timeline comments or admin notes exist for this discount record.

RecurringCycleLimit Int True

Specifies the number of recurring billing cycles during which the discount remains applicable for subscription purchases.

AppliesOncePerCustomer Bool False

If true, each customer can only redeem this discount code once.

CreatedAt Datetime True

The date and time when the discount code app entry was created in Shopify.

AppDiscountTypeFunctionId String False

The unique identifier of the app function responsible for calculating or managing this discount.

AppDiscountTypeTitle String True

The name or title of the app discount type defining how the discount operates.

AppDiscountTypeDescription String True

A detailed explanation of the logic or purpose behind the app discount type.

AppDiscountTypeAppKey String True

The unique client ID of the app providing the discount type.

AppDiscountTypeDiscountClass String True

Defines the classification of the app discount type, such as order-level, product-level, or shipping-level.

AppDiscountTypeTargetType String True

Specifies what the discount applies to, such as 'SHIPPING_LINE' for shipping costs or 'LINE_ITEM' for products.

CombinesWithOrderDiscounts Bool False

Indicates whether this discount can be combined with other order-level discounts.

CombinesWithProductDiscounts Bool False

Indicates whether this discount can be combined with other product-level discounts.

CombinesWithShippingDiscounts Bool False

Indicates whether this discount can be combined with shipping-related discounts.

DiscountCustomerAllAllCustomers Bool False

Specifies whether the discount is available to all customers. This field always returns 'true'.

ErrorHistoryFirstOccurredAt Datetime True

The timestamp of the first error that occurred during discount processing or validation.

ErrorHistoryErrorsFirstOccurredAt Datetime True

The timestamp of the earliest recorded error for this discount record.

ErrorHistoryHasSharedRecentErrors Bool True

Indicates whether the merchant has shared all recent error logs with the app developer.

ErrorHistoryHasBeenSharedSinceLastError Bool True

Indicates whether the merchant has shared the latest error logs since the most recent failure.

TotalSalesAmount Decimal True

The total sales revenue generated through 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 specific discount code string customers can enter to apply the discount.

AddAllCustomers Bool

If true, the discount will automatically be available to all customers without restriction.

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 from this discount.

CustomerSegmentsToAdd String

A comma-separated list of customer segment IDs to include in the eligibility for this discount.

CustomerSegmentsToRemove String

A comma-separated list of customer segment IDs to exclude from the eligibility for this discount.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9454