finding Price_rule_id

4 0 1


I just recently started developing with shopify and I have a question regarding Discounts and the Price_rule_id.

Can i see the Price_rule_id in the backoffice when i click on the Discount code.

The problem i have is i want to retieve all Discount Codes with the Admin API:


But i dont know the price_rule_id.

EDIT:Nevermind, found out that pricerules are the discounts.

Shopify Partner
472 36 74

Hi Kai,

Yep the relationship is one price rule to many discount codes. The price rule always comes first when creating and retrieving discount codes. Also I your edit made me smile so thank you for that. It's nice to see developers finding their way around Shopify. 

Best regards,

Sam - Owner @ Achieve Applabs

Install Approovly to create and track order approvals | We want to hear from you | Follow us on Twitter @achieveapplabs | Custom Shopify Apps