Access denied error for Grapth QL

Highlighted
Tourist
4 0 2

Hi all, 

I've faced the error when I am adding a Customer node to a request. Despite that  "read_customers" access is enabled for the account, error "acced_denied" appeared.  Please explain why it is happening?  What additional permission is needed?   

My request bellow 

{
  orders (first: 20, query:"processed_at:>2019-12-06 processed_at:<2019-12-20") {
    pageInfo {
      hasNextPage
      hasPreviousPage
    }
    edges {
      node {
        id
        name
        createdAt
        processedAt
        displayFinancialStatus
        cancelReason
        cancelledAt
        currencyCode
        test
        publication {
            name
        }
        customer 
        {
        id
        lastName
        firstName
        email
        }
        transactions (first:10) {
        id
        createdAt
        authorizationCode
        kind
        gateway
        amountSet
       {
         shopMoney 
                {
                    amount
                    currencyCode
                }
        }
        
        errorCode
        test
        status
        }
        customerJourney {
      moments {
        ... on CustomerVisit {
          utmParameters {
            source
            campaign
            content
            medium
            term
          }
        }
      }
    }
        refunds (first:10)
        {
        id
        createdAt
        
        totalRefundedSet
        {
         shopMoney 
                {
                    amount
                    currencyCode
                }
        }
        
        } 
        totalPriceSet 
           {
                shopMoney 
                {
                    amount
                    currencyCode
                }
             }
        subtotalPriceSet 
           {
                shopMoney 
                {
                    amount
                    currencyCode
                }
             }
        totalRefundedSet 
           {
                shopMoney 
                {
                    amount
                    currencyCode
                }
             }
      }
    }
  }
}

Piece of API response, where error is shown 

  {
            "message": "access denied",
            "locations": [
                {
                    "line": 21,
                    "column": 9
                }
            ],
            "path": [
                "orders",
                "edges",
                2,
                "node",
                "customer"
            ]
        },
        {
            "message": "access denied",
            "locations": [
                {
                    "line": 21,
                    "column": 9
                }
            ],
            "path": [
                "orders",
                "edges",
                3,
                "node",
                "customer"
            ]
        },

 Thanks for your attention! 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 170

Hey @Damir1,

 

Do you have read order permissions? Are you able to provide the shop URL or a request ID from the headers?

Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes
Highlighted
Tourist
4 0 2

Hi, 

yes sure, Shop URL: Helm.myshopify.com

All scopes that I have 

{
    "access_scopes": [
        {
            "handle": "read_orders"
        },
        {
            "handle": "read_products"
        },
        {
            "handle": "read_analytics"
        },
        {
            "handle": "read_product_listings"
        },
        {
            "handle": "write_customers"
        },
        {
            "handle": "write_checkouts"
        },
        {
            "handle": "read_content"
        },
        {
            "handle": "read_all_orders"
        },
        {
            "handle": "read_customers"
        },
        {
            "handle": "read_checkouts"
        }
    ]
}

I had got it with REST admin API endpoint /admin/oauth/access_scopes.json

I suppose that scopes the same both Graph and REST API. 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 170

Hey @Damir1,

 

Are you using the right key? The query is working on my end using the key from app 2839213.

 

If you're still stuck, please let me know a request ID from the response headers.

Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes
Highlighted
Tourist
4 0 2

Hey @SBD_,  

Seems that it somehow depends on the time when data requested.  

X-Request-Id was 1f9e9ce7-becd-4643-b6c9-a2ddac400688, where I saw the error last time. Today I've run the same request and actually, no errors appeared. 

But I've changed request params  to orders (first: 20, query:"processed_at:>2019-12-20 processed_at:<2019-12-23") and again seing the error 

New X-Request-Id = 66c70dee-ff5c-4537-96e4-e8f881316948

Full API response placed here https://drive.google.com/file/d/1RUCMsqf6R2bYP00qwbCHl8m-px_hPM8T/view?usp=sharing

Please advise! 

0 Likes