Development discussions around Shopify APIs
How can I apply discount on line_items when im create a new order using REST Admin Order API?
I've tried to set almost every possible keys available in the line_items. And my requirement must be an Order, not DraftOrder.
I've even tried to create first, then later update the line_items with discount but still no avail.
I'm open for GraphQL API solution as I'm using this package in my application >> https://github.com/MONEI/Shopify-api-node
Hope someone has done similar thing. Thanks
Hey there @ikkifujiwara
I've looked into this and presently this is not possible using the Orders API. In Storefront API, (checkoutDiscountCodeApplyV2 mutation would apply an existing discount to a checkout) - that's seemingly the closest we've got to what you're looking for.
It's mentioned that Discounts can't be applied to specific items within an Order in the Orders CSV docs strangely enough, I'll look at getting this same mention into the API docs.
I've noted that there are other partners who are looking for the same functionality and I've made this known to the product team today. If there's any future updates, they'll be communicated via the Shopify Community forums and via our Developer Changelog. Hope that explains things at least!
thanks so much for your reply. i'm trying out your method and finger-crossed i can make it.
As a business owner, have you ever wondered when your customer's first impression of yo...By Skye Jun 6, 2023
We're excited to announce improvements to the threaded messaging experience in our communi...By TyW May 31, 2023
Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...By Jacqui May 30, 2023