Why can't discount codes be renamed after deleting all other redeem codes?

Hi there,

I’ve noticed that, after you’ve added new redeem codes to a discount, even if you delete all the redeem codes, you can’t ever rename the discount again.

Steps to reproduce:

  1. Create a discount code (for example, via discountCodeAppCreate) named EXAMPLE.
  2. Using discountRedeemCodeBulkAdd, add new redeem codes to your discount.
  3. Using discountRedeemCodeBulkDelete, delete the codes you created, except for EXAMPLE.
  4. Using discountCodeAppUpdate, try to update the code of the discount to EXAMPLE2. You’ll get this error: “Cannot update code for a bulk price rule.”

To prevent user confusion, in our app, we currently show users an info banner before they add redeem codes to inform them they won’t be able to rename the discount afterward.

Is there a specific reason why the code cannot be renamed, even if:

  • There is only 1 redeem code
  • The redeem code is the same as the code?

Thanks,
Tobe

1 Like

Hey @tobebuilds :waving_hand: - I did a bit of digging into this, but might need a bit more info to give you a solid answer. Would you be able to share the discount code node ID you’re seeing this error pop up on?

For the discountCodeAppUpdate mutation - could you share a full input example of how you’re trying to rename it? I just want to see if I can try to replicate the issue exactly on my test shop here.

Hope to hear from you soon!