automatic discount code usage count not incrementing

ravimobifyi
New Member
4 0 0

I am creating order using order post API. I am using automatic discount and I can see discount amount reduced on order page in admin. Discount is successfully getting applied on order. Here the problem is automatic  discount usage count is not incrementing after order post api. I waited few hours but still it has not updated. 

 

"discount_codes": [
{'code': '20RSOFFONALLSHOES', 'amount': '20', 'type': 'fixed_amount'}
]

 

 

 

 

Screenshot 2021-06-14 173358.png 

0 Likes
GrahamS
Shopify Staff
Shopify Staff
83 16 16

Hello @ravimobifyi ,

This would be an expected outcome for an order generated via orders API. As it stands, when creating your order, the discount fields include no option for citing a Price Rule ID, which would be necessary in order to associate your order discount with the discount you have configured in the admin. Because of this, submitting a discount through the API will always be interpreted as a custom line item discount, even if it shares the same name and value as a discount that you have created in the admin. 

For the moment, the tally will only increment for uses that come through the Shopify Checkout, rather than including API based usages.

Graham S | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes