Emitting Boletos for third-parties
This a Beta version. Avaliable since version 2.7.x
Beta Version
This is Beta version feature. It must be unavaliable unintentionally. Avaliable for tests.
A Boleto can also be issued with a third party as payer.
In this case it is necessary to provide additionally the payer details such as name, taxId (CPF or CNPJ), phone and address.
curl --location --request POST 'https://homolog-bit.btcore.app/boletos/emission/emit' \
--header 'Content-Type: application/json' \
--header 'X-Request-Signature: XXX SIGNATURE' \
--header 'X-Request-Timestamp: 1603285426872' \
--header 'Authorization: Bearer TOKEN' \
--data-raw '{
"destination": "9fefbf29-97f9-4d4b-9a8a-95c72d6f1502",
"asset": "BRLP",
"provider":"boleto-provider",
"amount": "10.00",
"expiresAt": "2021-11-15T12:00:00.000Z",
"extra":{
"dueDate": "2025-10-10",
"expiresAt": "2025-10-10"
}
}'
const me = await bitcapital.users().me();
const myWallet = me.wallets[0];
// Prepare the payer data for the Third Part
const source = {
firstName: "The",
lastName: "Firm",
email: "[email protected]",
role: "consumer",
consumer: {
type: "corporate",
taxId: "60523459000100",
birthday: "1985-11-12",
phones: [{
code: "19",
number: "991044444",
type: "mobile"
}],
addresses: [{
country: "Brasil",
state: "SP",
city: "São Paulo",
code: "01310200",
street: "Rua Caqui Natal",
number: "501",
neighborhood: "Vila Natal",
complement: "Ap. 14",
}]
}
};
// Emit the boleto with a custom source
const boleto = await bitcapital.boletos().emit({
amount: "100.00",
destination: myWallet.id,
extra: { source, expiresAt: "2019-10-19" }
});
// Once the payer account is created, which occurs after issuing the first
// boleto in its name, you only need to provide the payer's taxId (CNPJ),
// as shown below.
const boleto = await bitcapital.boletos().emit({
amount: "100.00",
destination: myWallet.id,
extra: {
expiresAt: "2019-10-19",
source: {
consumer: { taxId: "60523459000100" }
}
}
});
// Get boleto information, such as the payment code and bar code
console.log(boleto);
Upon confirmation of payment by the custody provider, a deposit-type transaction will be created and recorded on the Stellar blockchain, resulting in the account balance being updated.
Available Providers
The following providers supports Boleto emissions, with its asset codes:
- Banco BS2:
BRLB
BRLB
deprecated in version 2.6.x
- DOCK (Bradesco):
BRLD
(deprecated in 2.3.0)
BRLD
deprecated in version 2.6.x
- Celcoin Boleto Provider:
BRLP
(beta version)*
Updated about 3 years ago