Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Using Discount function without any configuration from the merchant ?

Solved

Using Discount function without any configuration from the merchant ?

SPEAZ
Shopify Partner
31 3 17

Hi, just tried to play a little with the new function API.

I want to set a discount, by using some products metafields from my app and without any (more) configuration  than the merchant already set trough.

i tought it was possible, (and for me it's the purpose of using function) but even after deploy it on my dev store / and tested it with https://github.com/Shopify/function-runner nothing happens, and nothing too on extensions dashboard, nothing is triggered !

I've read this post https://community.shopify.com/c/shopify-functions/how-do-i-test-my-shopify-function/td-p/1802721 seems to have the same problem.

So it's mandatory to have some configuration from the merchant ? it would drastically reduce the point of using Shopify Functions in my opinion ? or am i missing something ? 

Thanks

Accepted Solution (1)

SPEAZ
Shopify Partner
31 3 17

This is an accepted solution.

Finally found out i just needed to create a discount code from app with function ID 🙂 

 

https://shopify.dev/api/admin-graphql/2023-01/mutations/discountAutomaticAppCreate

View solution in original post

Replies 2 (2)

SPEAZ
Shopify Partner
31 3 17

This is an accepted solution.

Finally found out i just needed to create a discount code from app with function ID 🙂 

 

https://shopify.dev/api/admin-graphql/2023-01/mutations/discountAutomaticAppCreate

paulsocal
Shopify Partner
3 0 0

Where do you add this mutation?