Discounts API?

Highlighted
Tourist
13 0 0

Is there a Discounts API? If so, where?

We want to implement to our own coupon code functionality and not use an app, can we do that? How? 

0 Likes
Highlighted
Shopify Partner
2294 116 353

https://shopify.dev/search?query=discount&search_uuid=095181b4-c6a2-4008-8403-170efdf1eaec&search%5B...

https://shopify.dev/docs/admin-api/graphql/reference/object/pricerule?api[version]=2020-07

 

Also see Draft Orders API https://shopify.dev/docs/admin-api/graphql/reference/object/draftorder

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
1 Like
Highlighted
Tourist
13 0 0

Thanks. I don't think I was able to find those API's via Google. Odd. 

The other thing I noticed, as I tried to work though this, is that using this:

https://help.shopify.com/en/manual/discounts/managing-discount-codes#promote-a-discount-using-a-shar...

I was not able to retreive that status via the site - and again - do some magic. But it would show up once I got to the checkout page. If the client / customer uses a discount via link. Where is that stored code having been applied store? It wasn't on the order object.  

I'm not in a postion to dive into GraphQL ATM. We've gotta stick to standard Ajax. Maybe it's not possible? 

This seems fairly routine to me. That is, discount on the cart prior to checkout. Maybe there's a tutorial? Or perhaps it's not so routine? 

0 Likes
Highlighted
Tourist
13 0 0

Aahhh. I think it's coming back to me

Once I have a code, how do I apply it to the order?  And then where is that stored? 

As I mentioned, I started w/ the discount code via URL but wasn't able to find that on an object, tho' once I went to checkout the discount was applied. 

0 Likes
Highlighted
Shopify Partner
2294 116 353

The


@mfs-mindsize wrote:

Thanks. I don't think I was able to find those API's via Google. Odd. 


The API docs are poorly worded for newcomers , how are they supposed to know they need to translate Discount into PriceRule /shrug

 

https://help.shopify.com/en/manual/discounts/managing-discount-codes#promote-a-discount-using-a-shar...

I was not able to retreive that status via the site


What status? there is no status data customers would get when adding a discount to their order.

That is a front end url api why would it expose that type of information publicly the discount is either accepted or rejected.

There are liquid objects for displaying discount information to customers https://shopify.dev/tutorials/develop-theme-discounts

I'm not in a position to dive into GraphQL ATM. We've gotta stick to standard Ajax. Maybe it's not possible? 

This seems fairly routine to me. That is, discount on the cart prior to checkout. Maybe there's a tutorial? Or perhaps it's not so routine? 


Maybe what's not possible? You have to describe what the goal is to get there.

REST backend API https://shopify.dev/docs/admin-api/rest/reference/discounts/pricerule?api[version]=2020-07

To apply a discount use the parameter ?discount=

To have dynamic generated discounts means backend apis.

 

 

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes