Apis for discount redeem code id search

Currently there is not api for getting discount redeem code id by search . At best , you can get discount code node id . Anybody has found workaround for this ? like id in example

1 Like

Hey @Kaustubh, there isn’t a direct search API specifically for DiscountRedeemCode IDs. The best alternative to the query you’ve shared above would be using the codeDiscountNodeByCode query if you know the actual discount code string. This lets you retrieve the DiscountRedeemCode ID without needing the parent DiscountCodeNode ID first:

query {
  codeDiscountNodeByCode(code: "cIoCcZ4EAbzn2aIM") {
    id
    codeDiscount {
      ... on DiscountCodeBasic {
        codes(first: 10) {
          nodes {
            id    # This is your DiscountRedeemCode ID
            code
          }
        }
      }
    }
  }
}

Let me know if that helps!

Hey @Kaustubh, did the above help at all?

yes thanks . Figured out .

1 Like