About the billing API access scope

About the billing API access scope

Alex1243
Shopify Partner
1 0 0
Replies 3 (3)

ShaunPic
Shopify Partner
1 0 1

I am curious about this answer now. When I run the mutations through GraphQL Explorer. I get 

{
  "errors": [
    {
      "message": "Access denied for appPurchaseOneTimeCreate field.",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "appPurchaseOneTimeCreate"
      ],
      "extensions": {
        "code": "ACCESS_DENIED",
        "documentation": "https://shopify.dev/api/usage/access-scopes"
      }
    }
  ],
  "data": {
    "appPurchaseOneTimeCreate": null
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 10,
      "actualQueryCost": 10,
      "throttleStatus": {
        "maximumAvailable": 2000,
        "currentlyAvailable": 1990,
        "restoreRate": 100
      }
    }
  }
}
YG1
Shopify Partner
3 0 0

Any update on this matter? I have the same problem.

YG1
Shopify Partner
3 0 0

After searching a little more, it might be possible that you're getting this error because your app is not a public app. 

When I was trying out my mutation on my app, I was getting no data:

Array ( [appPurchaseOneTimeCreate] => Array ( [appPurchaseOneTime] => [confirmationUrl] => ) )  

 

so I added 

userErrors {

        field

        message

}

to my mutation to have more information. Then I could see this message displaying: Apps without a public distribution cannot use the Billing API.

 

See these threads:

Hope it helps.