We created a Shopify payment App, and we already set the scope as follows in our PHP code
$scopes = ‘write_payment_gateways,write_payment_sessions,write_orders,write_products,write_customers’;
Now, when we try to call GraphQL API mutation PaymentsAppConfigure, we are always getting "You do not have permission to access this website"
```php
'')); // Remove hmac from params
ksort($params); // Sort params lexographically
$computed_hmac = hash_hmac('sha256', http_build_query($params), $shared_secret);
// Use hmac data to check that the response is from Shopify or not
if (!hash_equals($hmac, $computed_hmac)) {
die('Error: invalid authentication!');
}
// Validate request is from valid shopify website
if (!preg_match("/\A[a-zA-Z0-9][a-zA-Z0-9\-]*\.myshopify\.com\z/", $_GET['shop'])) {
die('Error: invalid Shop!');
}
// Set variables for our request
$query = array(
"client_id" => $api_key, // Your API key
"client_secret" => $shared_secret, // Your app credentials (secret key)
"code" => $params['code'] // Grab the access key from the URL
);
// Generate access token URL
$access_token_url = "https://" . $params['shop'] . "/admin/oauth/access_token";
// Configure curl client and execute request
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $access_token_url);
curl_setopt($ch, CURLOPT_POST, count($query));
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($query));
$result = curl_exec($ch);
curl_close($ch);
// Store the access token
$result = json_decode($result, true);
error_log(PHP_EOL . date('d.m.Y h:i:s') . ' - ' . 'access token: ' . print_r($result, 1), 3, 'test.log');
if (!empty($result['access_token'])) {
// Should call an API to connect the payment app !!!
// https://{shop_domain}/payments_apps/api/2021-07/graphql.json
$url = 'https://' . $params['shop'] . '/payments_apps/api/2021-07/graphql.json';
$queryArr = [
'query' => 'mutation PaymentsAppConfigure($externalHandle: String, $ready: Boolean!) {
paymentsAppConfigure(externalHandle: $externalHandle, ready: $ready) {
paymentsAppConfiguration {
externalHandle
ready
}
userErrors{
field
message
}
}
}',
'variables' => [
'externalHandle' => 'API_token_key',
'ready' => true
]
];
$query = json_encode($queryArr);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Shopify-Access-Token:' . $result['access_token'], 'Content-Type: application/json'));
$result = curl_exec($ch);
$err = curl_error($ch);
curl_close($ch);
echo "
~~~
";
// print_r($err);
print_r($result);
die;
} else {
die('Error: No response!');
}
Moreover, we tried to install GraphQL APP, and called the same mutation. We got "message": "PaymentsAppConfigure access denied",

Meanwhile, when calling any rest API using the same code or even using GraphQL, we got a successful response.
We need to know, Is there any extra scope that should be added in our Payment App implementation or we should have specific permission from Shopify partner account??