We are using the priceRuleCreate (https://shopify.dev/docs/api/admin-graphql/2023-04/mutations/priceRuleCreate) GraphQL mutation to create a discount code. There is a mandatory argument called "customerSelection" and here we are only passing "forAllCustomers: true". Please note, we are not passing any customer data here.
We find that this GraphQL mutation requests fails with error message saying: "This app is not approved to access the PriceRule object. See https://partners.shopify.com/<partner_id>/apps/<app_id>/customer_data for more details."
Why does the priceRuleCreate endpoint require customer protected data? And it's fully failing even when we do not use and customer data fields?
Thanks for your post. We've been able to replicate this issue in a test store, however the priceRuleCreate mutation is marked as deprecated so can you please use the mutations that start with the word 'discount' instead like discountCodeBasicCreate? That one worked when testing with the same app that failed with priceRuleCreate.
There are links to the other discount creation mutations in the chart on this doc page about creating a discount app:
Thanks and hope you have a great day,
Hi Jon551, Thank you for your response. As you suggested discountCodeBasicCreate works fine. However, we came across another similar problem. We subscribe to the orders/create webhook topic, and we include only customer-unrelated fields. Yet the webhook subscription create fails. Why can't the webhook send the payload excluding customer data to apps that don't require customer protected data access? Hoping you could take a look at this case too. Thank you!