Read_orders scope not allowing me to read orders

Alright, so I have an app that creates discount codes automatically for Shopify stores, and registers them with the store. I want to be able to see if those discount codes have been used. I am requesting the read_orders scope. When I curl the endpoint to make sure that I have the scope it is there.

However, when I query the Admin Graphql with the following query that the shopify graphql dev assistant provided me:

query GetOrderByUniqueDiscountCode {
        orders(first: 1, query: "discount_codes:${discountCode}") {
          edges {
            node {
              id
              name
              currentTotalPriceSet {
                shopMoney {
                  amount
                  currencyCode
                }
              }
            }
          }
        }
      }

It fails as such:

"errors": [
    {
      "message": "This app is not approved to access the Order object. See https://partners.shopify.com/*******/apps/*******/customer_data for more details.",
      "locations": [
        {
          "line": 3,
          "column": 9
        }
      ],
      "path": [
        "orders"
      ],
      "extensions": {
        "code": "ACCESS_DENIED",
        "documentation": "https://partners.shopify.com/*******/apps/*********/customer_data"
      }
    }
  ],

So it’s wanting me to request access to sensitive customer data when I don’t need that. I just want the order total related to the discount code used. I could just be sorely misunderstanding the docs and scopes. I could also have misled the AI Assistant. Does anyone know the answer to this? I couldn’t find anything with the AI about it or in these forums.

Hey!

In order to access the APIs that can access customers. You would need to get your Level 1 access approved (even if you’re not accessing the customer object).

You can simply fill the form and mention that you are not using the customer object at all and your request should be approved.

External Note: In order to access orders that are older than 60 days, you need to get access to read_all_orders scope as well.

1 Like