How do I apply line_item discount using REST Admin Order API

ikkifujiwara
New Member
2 0 1

Hi,

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

Replies 2 (2)
L_J_K
Shopify Staff
363 54 65

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!

| API Support @ Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
ikkifujiwara
New Member
2 0 1

@L_J_K 

thanks so much for your reply. i'm trying out your method and finger-crossed i can make it.