Get the discount code ID from the orders API

WebMedic
Shopify Partner
15 1 0

Hi all,

 

Orders REST API returns the discount codes applied on the order.


But it seems there is no way to get the discount code ID?

 


Which doesn't make sense because there is no way to get the discount code ID from the DiscountCode API as well using the discount code it self.


Is there something I am missing to get the discount code ID used in orders?

Thank you

Helping beauty and personal care brands increase their online sales without more advertising @ WebMedic.com
Reply 1 (1)

WebMedic
Shopify Partner
15 1 0

UPDATE: Found out we can lookup a discount by the discount code

 

/discount_codes/lookup.json?code=

But the part that doesn't make sense is why there is a discount_code ID in there

 

While in the price_rules listing it only has a price_rule ID and no discount_code ID

 

And there is no way to list all discount codes, only all price rules, which has a discount code... but no discount code ID lol

 

Discount codes vs price rules is messy in the API

Helping beauty and personal care brands increase their online sales without more advertising @ WebMedic.com