Discount object is only accessable in notifications or in Order Print app
The discount object contains information about a discount, including its id, code, amount, savings, and type. Note that this object will display a value only if it’s accessed in notifications or in the Order Printer app.
Old question, but I don’t believe it was ever properly answered. I whipped up this function to be able to query the Shopify API to pull the entire discounts list, iterate through them to search for a specific discount (by discount code) and output the information accordingly. Hope this helps future devs!
Thank you, that works, but if you have automatic discount/price rules they won’t be listed. do you know a way to get the automatic discounts, or is it only possible with the GraphQL api?