skip to Main Content

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


  1. Your app should have write_payment_gateways and write_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

    Login or Signup to reply.
  2. 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.

    {
        "query": "mutation {  paymentsAppConfigure(externalHandle : "Activation request at 2020-04-09 11:24:14.785868848" ,ready: true) {   paymentsAppConfiguration {      externalHandle      ready    }    userErrors {    field      message    }  } }",
        "variables": {}
    }
    

    Below are the header details that I send with the request

    X-Shopify-Access-Token -> Your token
    Content-Type -> application/json
    Cookie -> request_method=POST
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search