On Shopify, I’m getting paymentsAppConfigure error (You do not have permission to access this website).
$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:<My_token>', 'Content-Type: application/json'));
$result = curl_exec($ch);
$err = curl_error($ch);
curl_close($ch);
// echo "<pre>";
// print_r($err);
print_r($result);
This query is giving the following error:
You do not have permission to access this website
Also, what is the externalHandle API_token_key? I have used the App API key but it’s not working.
2
Answers
Your app should have
write_payment_gateways
andwrite_payment_sessions
permissions in order to make that call. You need to contact Shopify support to enable these permissions.Reference: https://shopify.dev/apps/payments/onboarding-a-merchant-payments-apps#permissions
As mentioned by Mehar above, you app should have requested permissions.
Below is payload that I’m sending and works as expected, you can try that if you want.
Below are the header details that I send with the request