Skip to main content
Log inSign up

Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our privacy policy and our cookie policy.

object

Requires Apps must have read_discounts access scope.

The DiscountCodeNode object enables you to manage code discounts that are applied when customers enter a code at checkout. For example, you can offer discounts where customers have to enter a code to redeem an amount off discount on products, variants, or collections in a store. Or, you can offer discounts where customers have to enter a code to get free shipping. Merchants can create and share discount codes individually with customers.

Learn more about working with Shopify's discount model, including related queries, mutations, limitations, and considerations.

Anchor to Fields and connectionsFields and connections

•

The underlying code discount object.

•

The paginated list of events associated with the host subject.

•
ID!non-null

A globally-unique ID.

•

A custom field, including its namespace and key, that's associated with a Shopify resource for the purposes of adding and storing additional information.

•

A list of custom fields that a merchant associates with a Shopify resource.

Show
deprecated fields and connections Deprecated
Anchor to metafieldDefinitionsmetafieldDefinitions
•

List of metafield definitions. This field will be removed in a future version. Use the root metafieldDefinitions field instead.

•

Returns a private metafield by namespace and key that belongs to the resource. Metafields created using a reserved namespace are private by default. See our guide for migrating private metafields.

•
PrivateMetafieldConnection!non-nullDeprecated

List of private metafields that belong to the resource. Metafields created using a reserved namespace are private by default. See our guide for migrating private metafields.


Was this section helpful?

•
query

Returns a code discount resource by ID.

•
query

Returns a code discount identified by its discount code.

•
query

Returns a list of code-based discounts.


Was this section helpful?

•
mutation

Activates a code discount.

•
mutation

Creates an amount off discount that's applied on a cart and at checkout when a customer enters a code. Amount off discounts can be a percentage off or a fixed amount off.


Note

To create discounts that are automatically applied on a cart and at checkout, use the discountAutomaticBasicCreate mutation.


•
mutation

Updates an amount off discount that's applied on a cart and at checkout when a customer enters a code. Amount off discounts can be a percentage off or a fixed amount off.


Note

To update discounts that are automatically applied on a cart and at checkout, use the discountAutomaticBasicUpdate mutation.


•
mutation

Creates a buy X get Y discount (BXGY) that's applied on a cart and at checkout when a customer enters a code.


Note

To create discounts that are automatically applied on a cart and at checkout, use the discountAutomaticBxgyCreate mutation.


•
mutation

Updates a buy X get Y discount (BXGY) that's applied on a cart and at checkout when a customer enters a code.


Note

To update discounts that are automatically applied on a cart and at checkout, use the discountAutomaticBxgyUpdate mutation.


•
mutation

Deactivates a code discount.

•
mutation

Creates an free shipping discount that's applied on a cart and at checkout when a customer enters a code.


Note

To create discounts that are automatically applied on a cart and at checkout, use the discountAutomaticFreeShippingCreate mutation.


•
mutation

Updates a free shipping discount that's applied on a cart and at checkout when a customer enters a code.


Note

To update a free shipping discount that's automatically applied on a cart and at checkout, use the discountAutomaticFreeShippingUpdate mutation.



Was this section helpful?