POST:: Criar nova cobrança imediata
Essa API possibilita que seja realizado o vinculo de um QR Code a uma cobrança imediata.
Endpoint de request
https://sandbox.agilspotpay.financehub.com.br/pix/v1/brcode/static
Exemplo com as principais linguagem
Retorno em JSON com os dados do cadastro.
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.agilspotpay.financehub.com.br/pix/v1/brcode/static",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"key\":\"testepix@btgpactual.com\",\"merchant\":{\"postalCode\":\"01201005\",\"merchantCategoryCode\":0,\"name\":\"AgilSpot Pay\"},\"withdrawal\":false}",
CURLOPT_HTTPHEADER => [
"accept: application/json",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
curl --request POST \
--url https://sandbox.agilspotpay.financehub.com.br/pix/v1/brcode/static \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"key": "testepix@btgpactual.com",
"merchant": {
"postalCode": "01201005",
"merchantCategoryCode": 0,
"name": "AgilSpot Pay"
},
"withdrawal": false
}
'
const axios = require('axios');
const options = {
method: 'POST',
url: 'https://sandbox.agilspotpay.financehub.com.br/pix/v1/brcode/static',
headers: {accept: 'application/json', 'content-type': 'application/json'},
data: {
key: 'testepix@btgpactual.com',
merchant: {postalCode: '01201005', merchantCategoryCode: 0, name: 'AgilSpot Pay'},
withdrawal: false
}
};
axios
.request(options)
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.error(error);
});
Modelo de retorno 200 OK
{
"transactionId": 9192233,
"emvqrcps": "00020126450014br.gov.bcb.pix0123testepix@agilspotpay.com.br5204000053039865802BR5907Celcoin6007Barueri61080120100562070503***6304FD53",
"transactionIdentification": "***"
}
Last updated