Automatic Discounts API

Highlighted
New Member
1 0 0

I know someone has ask this, but I seen a response from 4/19/19 that said that Shopify developers are working on creating a automatic discount API. Is there any update on this? Has it been publiched?

 

https://community.shopify.com/c/Shopify-APIs-SDKs/Is-API-available-for-getting-automatic-discount-co...

 

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 102 129

Hi @rapidpos ,

 

Yes this is available in the Shopify GraphQL Admin API. Feel free to follow this guide: https://shopify.dev/tutorials/create-and-manage-discounts-with-admin-api

 

Or reference the GraphQL Admin API documentation directly:

https://shopify.dev/docs/admin-api/graphql/reference/object/discountautomaticbasic

https://shopify.dev/docs/admin-api/graphql/reference/object/discountautomaticbxgy

https://shopify.dev/docs/admin-api/graphql/reference/object/discountautomaticnode

 

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

0 Likes
Highlighted
New Member
1 0 0

Hi @hassain,

 

We are developing an app and wondering how can we define multiple automatic discounts rules preferably using the GraphQL api. I see that there's any app who helps merchants to to that - https://apps.shopify.com/automatic-discount-rules, so I guess it is possible doing it as an app using api's.

 

We've tried to create multiple automatic discounts using the GraphQL api and got the following error message - "message": "The active period overlaps with that of another price rule", "code": "ACTIVE_PERIOD_OVERLAP".

 

In short, we'd like to know what is the best way to create multiple discounts as an app.

 

Thanks!

Ohad

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 102 129

Hi @ohadz ,

 

That error you are seeing is expected. Right now Shopify only allows that at any given time, only one automatic discount can be active. Shopify does not allow you to have multiple active automatic discounts running at the same time, you have to schedule your automatic discount so they are not active at the same time. 

 

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

0 Likes