finding Price_rule_id

Kai_Yu
Tourist
4 0 1

Hi

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:

'/admin/api/2021-01/price_rules/{price_rule_id}/discount_codes.json'

But i dont know the price_rule_id.

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

achieveapplabs
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 hello@achieveapplabs.com | Follow us on Twitter @achieveapplabs | Custom Shopify Apps achieveapplabs.com
0 Likes