Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Get the discount code ID from the orders API

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