automatic discount code usage count not incrementing

Shopify Partner
6 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 

Reply 1 (1)

Shopify Staff (Retired)
193 36 54

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.

To learn more visit the Shopify Help Center or the Community Blog.