Boa tarde, @iilordxss!
Sim, segue o exemplo usando o fetch:
js
var myHeaders = new Headers();
myHeaders.append("authorization", "Bearer ");
myHeaders.append("x-client-cert-pem", "{{X-Certificate-Pem}}");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"calendario": {
"expiracao": 1
},
"valor": {
"original": "0.01"
},
"chave": ""
});
var requestOptions = {
method: 'PUT',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("
https://api-pix.gerencianet.com.br/v2/cob/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));