price_rule_id
path parameter is the ID of the price rule that the discount code belongs to.discount_code_id
path parameter is the ID of the discount code to retrieve for the associated price rule.curl --location --request GET 'https://demo.myshopify.com//admin/api//price_rules//discount_codes/.json'
{
"discount_code": {
"id": 507328175,
"price_rule_id": 507328175,
"code": "SUMMERSALE10OFF",
"usage_count": 0,
"created_at": "2023-01-03T12:21:36-05:00",
"updated_at": "2023-01-03T12:21:36-05:00"
}
}