Comunidade

Ask a Question
Back to All

Erro 403 pix

[03-Oct-2023 04:47:48 UTC] PHP Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: POST https://api.sandbox.empresas.btgpactual.com/v1/companies/30306294000145/pix-cash-in/locations resulted in a 401 Unauthorized response:
{"fault":{"faultstring":"Invalid token: policy(VerifyJWT)","detail":{"errorcode":"steps.jwt.InvalidToken"}}}
in /home/evolute1/***/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /home/evolute1//vendor/guzzlehttp/guzzle/src/Middleware.php(72): GuzzleHttp\Exception\RequestException::create()
#1 /home/evolute1//vendor/guzzlehttp/promises/src/Promise.php(209): GuzzleHttp\Middleware::GuzzleHttp{closure}()
#2 /home/evolute1/vendor/guzzlehttp/promises/src/Promise.php(158): GuzzleHttp\Promise\Promise::callHandler()
#3 /home/evolute1//vendor/guzzlehttp/promises/src/TaskQueue.php(52): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}()
#4 /home/evolute1//vendor/guzzlehttp/promises/src/Promise.php(251): GuzzleHttp\Promise\TaskQueue->run()
#5 /home/evolute1//vendor/guzzlehttp/promises/src/Promise.php(227): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 /home/evolute1//vendor/guzzlehttp/promises/src/Promise.php(272): GuzzleHttp\Promise\Promise->waitIfPending()
#7 /home/evolute1//vendor/guzzlehttp/promises/src/Promise.php(229): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 /home/evolute1//vendor/guzzlehttp/promises/src/Promise.php(69): GuzzleHttp\Promise\Promise->waitIfPending()
#9 /home/evolute1//vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\Promise\Promise->wait()
#10 /home/evolute1//teste.php(9): GuzzleHttp\Client->request()
#11 {main}
thrown in /home/evolute1//vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 113

Código exemplo:

request('POST', ', \[ 'body' => '{"type":"cob","description":"teste wes"}', 'headers' => [ 'accept' => 'application/json', 'authorization' => '*****', 'content-type' => 'application/json', ], ]); echo $response->getBody();