Skip to main content
Anchor to discountCodeActivate

discountCodeActivate

mutation

Requires Apps must have write_discounts access scope.

Activates a previously created code discount, making it available for customers to use during checkout. This mutation transitions inactive discount codes into an active state where they can be applied to orders.

For example, after creating a "SUMMER20" discount code but leaving it inactive during setup, merchants can activate it when ready to launch their summer promotion campaign.

Use DiscountCodeActivate to:

  • Launch scheduled promotional campaigns
  • Reactivate previously paused discount codes
  • Enable discount codes after configuration changes
  • Control the timing of discount availability

The mutation returns the updated discount code node with its new active status and handles any validation errors that might prevent activation, such as conflicting discount rules or invalid date ranges.

•ID!
required

The ID of the code discount to activate.


Was this section helpful?

Anchor to DiscountCodeActivatePayload returnsDiscountCodeActivatePayload returns

•DiscountCodeNode

The activated code discount.

•[DiscountUserError!]!
non-null

The list of errors that occurred from executing the mutation.


Was this section helpful?