Admin API Discount Code By Customer Segment Query

Admin API Discount Code By Customer Segment Query

leesharon
Shopify Partner
3 0 0

Hi!
I'm trying to make an api request to the shopify admin api, in the request I would like to query for all active discount codes where the customer segments is for a specific customer, and to get that by that customer id, does anyone know if it is possbile or not?

 

thanks! 

  • !
Replies 2 (2)

Tal19
Shopify Partner
123 22 23

To query all active discount codes for a specific customer segment in Shopify Admin API, you can use the price_rules endpoint.

Retrieve all price rules and then filter by customer segment.

Need Shopify Development, Customization, or POS Support? PM Me!
leesharon
Shopify Partner
3 0 0

Thanks for the fast response! can I already include the price rule in the query instead of filtering once i get the response? how should such a query should look like and how to get discount codes with the price rule indicates thats only 1 specific customer can use it? 

Please if you can provide more details it would be of a great help