Discount code usage is not getting incremented

Solved
Tourist
12 0 0

I'm using the Admin API (2019-04) to create discounted draft orders with this `applied_discount` property:

"applied_discount":{
  "value_type":"percentage",
  "value":20,
  "amount":1.19,
  "title":"TEST20"
}

It works ok. But the actual discount code's usage is not incrementing after the draft order is completed. 

I followed this documentation.

 

Annotation 2019-11-28 002604.pngThe completed order

Annotation 2019-11-28 002756.pngThe discount info

0 Likes

Success.

Shopify Staff
Shopify Staff
222 28 27

Hey @Zolbayar 

 

I see the confusion here. What looks to be happening is you are applying a discount called "TEST20" but this is not actually linked/related to the discount code you have also called "TEST20". With a draft order, if you go through the UI you will see you can add a discount, but it functions as a custom discount vs. adding an existing customer-facing discount code. This means, that there is no relation or link between the two codes with the same names, which is why you are not seeing the amount increment. 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


1 Like
Tourist
12 0 0

Hi @vix 

 

Thank you for your response. 

So, is there a way to manually increment the usage count? I tried updating it with this API. But it's not getting changed.

0 Likes
Shopify Staff
Shopify Staff
222 28 27

That value is read-only, so you will not be able to update that through the API. Are you ideally attempting to track draft order discount usage?

 

26-56-t7r9g-h0nip

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes
Tourist
12 0 0

Oh, didn't notice the READ-ONLY part and yeah I'd like to track that usage.

0 Likes