$config = [
"certificado" => "./gerenciamento.pem",
"client_id" => "XXXXX",
"client_secret" => "XXXXX"
];
$autorizacao = $chaveiro["access_token"];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-pix.gerencianet.com.br/v2/webhook/XXXXX',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_SSLCERT => $config["certificado"], // Caminho do certificado
CURLOPT_SSLCERTPASSWD => $chaveiro["access_token"],
CURLOPT_POSTFIELDS =>'{
"webhookUrl": "https://XXXXX/webhook.php"
}',
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer $autorizacao",
'x-client-cert-pem: ./gerenciamento.pem',
'x-skip-mtls-checking: false'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;