I'm developing an app for a Shopify Plus client, and it has to do with creating discount codes for customers.
So far I'm able to create a price rule and an associated discount code using the API just fine. But when I enter that API-created discount code at checkout like a normal consumer would, and finish checking out, the usage_count of the price rule/discount code never increases. Even if I go into orders and fulfill it etc.
Further, I can also see that if I create a discount code manually in the admin section, and then use that as a normal consumer, the usage count also does not increase? So is this a test store only thing, or am I missing something?
The usage count never seems to increase no matter what I do. I know I can't increase it using the API, that's fine, but I don't understand why when I use the code, it doesn't show that it's been used in the admin section.
Is this just because I'm using a test store? Or is it because I'm using the test payments method? If it is just a test flag or something, when does the discount code usage count normally increment? Is it upon payment? Upon fulfillment?
Why won't the usage count of a discount code increase, even though I am able to apply the discount code at checkout?
Solved! Go to the solution
This is an accepted solution.
These can sometimes take a a short moment to catch up - has the usage count increased? If not, can you provide the test store url? (in reply or DM).
Hey @SBD_, thanks for the reply!
You're right, I see now that they've caught up and display correctly now.
It also looks like that even if the admin site doesn't show the correct usage count i.e it still shows 0/1 even if I've used it once, that I am unable to use it again, which is correct (since it should be 1/1), and so it looks like it has been at least validated on Shopify's side.
Thanks for the response.