Endpoints

On this page you will find all the endpoints available in the Gerencianet's Pix API. We recommend that you join our community on Discord to track api developments, including the release of new endpoints.

Use the table of contents on the right to quickly navigate between API endpoint groups.


Charges


The following set of endpoints is responsible for the billing management. Charges in the context of the Pix API represent a financial transaction between a payer and a receiver whose payment method is Pix.


Creating instant charges (without txid)

POST/v2/cob

Endpoint to create an instant charge without the field txid.

In general, the txid is created by the receiving user and is under his responsibility.This endpoint is an exception to this rule, and in this case, the txid will be set by Gerencianet.

Requires authorization for the scope: cob.write

Request

{
"calendario": {
"expiracao": 3600
},
"devedor": {
"cpf": "12345678909",
"nome": "Francisco da Silva"
},
"valor": {
"original": "123.45"
},
"chave": "71cdf9ba-c695-4e3c-b010-abb521a3f1be",
"solicitacaoPagador": "Informe o número ou identificador do pedido."
}

Data for billing generation.

(*) Required attribute

AttributeDescriptionRequiredType
calendarioFields located in the calendar identifier organizes the information about billing time control.

calendario:
criacao*// Timestamp that indicates the time the charge was created. Respects the format set in RFC 3339.
Minimum of 1 character and maximum of 255 characters (String).


apresentacao*// Timestamp hat indicates the time when the JSON payload wich represents the charge was recvered. That means it is the time when the user took the QR Code capture to check the payment data. Respects the format defined in RFC 3339.
string date-time (QR Code presentation timestamp)


expiracao// Charge's time life, specified in seconds counted from the charge's creation day (Calendario.criacao).
integer <int32>
Yesobject (Calendar)
devedorThe fields located in the debtor object are optional and identify the debtor, that is, the person or institution to whom the charge is addressed. It does not necessarily identify who will actually make the payment. A CPF may be the debtor of a charge, but it can happen that another CPF actually performs the payment of the document. The pagador.cpf and pagador.cnpj field are not allowed to be filled in the same time. If the pagador.cnpj field is filled in, then the pagador.cpf field cannot be filled in, and vice versa. If the pagador.nome is filled in, then there must exist either a pagador.cpf or a pagador.cnpj field filled in too.

devedor:
cpf*// payer CPF.
string /^\d{11}$/


nome*// Payer name.
string (Name) ≤ 200 characters
NoNatural person (object) or Legal entity (object)
valorAll fields that indicate monetary values comply with the ID 54 format of the EMV/BR Code specification for QR Codes. The decimal separator is the point character. It is not applicable to use thousand separator. Examples of values adhering to the standard: “0.00”, “1.00”, “123.99”, “123456789.23”

valor:
original*// Original billing amount.
string \d{1,10}\.\d{2}
Yesobject
chaveThe chave field, required, determines the Pix key registered in DICT wich will be used for the charge. This key will be read by the payer's PSP application for DICT searches, which will return the information that will identify the receiver of the charge.Yesstring (receiver's DICT key) ≤ 77 characters
solicitacaoPagador The field solicitacaoPagador, optional, determines a text to be presented to the payer so that he can enter a related information, in free format, to be sent to the recipient. This text will be filled in, in pacs.008, by the payer's PSP, in the RemittanceInformation field. The size of the field in pacs.008 is limited to 140 characters.Nostring (Payer request)
≤ 140 characters
infoAdicionaisEach additional information contained in the list (nome and valor) must be presented to the payer.

infoAdicionais:
nome*// Field's name
string (Name)
≤ 50 characters


valor*// Field's data
string (Amount)
≤ 200 characters
NoArray of objects (Additional information) ≤ 50

Response

{
"calendario": {
"criacao": "2020-09-09T20:15:00.358Z",
"expiracao": 3600
},
"txid": "7978c0c97ea847e78e8849634473c1f1",
"revisao": 0,
"loc": {
"id": 789,
"location": "pix.example.com/qr/v2/9d36b84fc70b478fb95c12729b90ca25",
"tipoCob": "cob"
},
"location": "pix.example.com/qr/v2/9d36b84fc70b478fb95c12729b90ca25",
"status": "ATIVA",
"devedor": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"valor": {
"original": "567.89"
},
"chave": "a1f4102e-a446-4a57-bcce-6fa48899c1d1",
"solicitacaoPagador": "Informe o número ou identificador do pedido."
}

Creating instant charges (with txid)

PUT/v2/cob/:txid

Endpoint to create an instant charge with a transaction identifier (txid).

Requires authorization for the scope: cob.write

Request

{
"calendario": {
"expiracao": 3600
},
"devedor": {
"cpf": "12345678908",
"nome": "Francisco da Silva"
},
"valor": {
"original": "123.45"
},
"chave": "71cdf9ba-c695-4e3c-b010-abb521a3f1be",
"solicitacaoPagador": "Informe o número ou identificador do pedido."
}

AttributeDescriptionRequiredType
txidTransaction identifier
The txid field, required, determines the identifier of the transaction. The purpose of this field is to be an element that allows the PSP of the recipient to present to the receiving user the functionality of payments reconciliation, more details click here.
Yesstring (Transaction Id) [A-Z0-9-]{26,35}

Data used for creating charges.

(*) Required attribute

AttributeDescriptionRequiredType
calendarioFields nested under the calendar identifier organize information about billing time control.

calendario:
criacao*// Timestamp that indicates when the charge was created. Respects the format defined in RFC 3339.
Minimum of 1 character and maximum of 255 characters (String).


apresentacao*// Timestamp that indicates the time when the JSON payload wich presents the charge was recovered. That is the time when the user took the QR Code capture to check the payment data. Respects the format defined in RFC 3339.
string date-time (QR Code presentation timestamp)


expiracao// Billing lifetime, specified in seconds from the creation date (Calendario.criacao).
integer <int32>
Yesobject (Calendario)
devedorFields nested in the debtor object are optional and identify the debtor, that is, the person or institution to whom the billing is addressed. It does not necessarily identify who will actually make the payment. A CPF may be the debtor of a charge, but it can happen that another CPF actually performs the payment of the document. The pagador.cpf and pagador.cnpj field are not allowed to be filled in at the same time. If the pagador.cnpj field is filled in, then the pagador.cpf field cannot be filled in, and vice versa. If the pagador.name is filled in, then there must exist either a pagador.cpf or a pagador.cnpj field filled in too.

devedor:
cpf*// Payer document.
string /^\d{11}$/


nome*// Payer name.
string (Name) ≤ 200 characters
NoNatural Person (object) or Legal entity (object)
valorAll fields that indicate monetary values comply with the ID 54 format of the EMV/BR Code specification for QR Codes. The decimal separator is the point character. It is not applicable to use thousand separator. Examples of values adhering to the standard: “0.00”, “1.00”, “123.99”, “123456789.23”

valor:
original*// Original billing amount.
string \d{1,10}\.\d{2}
Yesobject
chaveThe chave field, required, determines the Pix key registered in DICT wich will be used for the charge. This key will be read by the payer's PSP application for DICT searches, which will return the information that will identify the receiver of the charge.Yesstring (receiver's DICT key) ≤ 77 characters
solicitacaoPagador The field solicitacaoPagador, optional, determines a text to be presented to the payer so that he can enter a related information, in free format, to be sent to the recipient. This text will be filled in, in pacs.008, by the payer's PSP, in the RemittanceInformation field. The size of the field in pacs.008 is limited to 140 characters.Nostring (Payer request)
≤ 140 characters
infoAdicionaisEach additional information contained in the list (name and value) must be presented to the payer.

infoAdicionais:
nome*// Field's name
string (Name)
≤ 50 characters


valor*// Field's data
string (Amount)
≤ 200 characters
NoArray of objects (Additional information) ≤ 50

Responses

{
"calendario": {
"criacao": "2020-09-09T20:15:00.358Z",
"expiracao": 3600
},
"txid": "7978c0c97ea847e78e8849634473c1f1",
"revisao": 0,
"loc": {
"id": 789,
"location": "pix.example.com/qr/v2/9d36b84fc70b478fb95c12729b90ca25",
"tipoCob": "cob"
},
"location": "pix.example.com/qr/v2/9d36b84fc70b478fb95c12729b90ca25",
"status": "ATIVA",
"devedor": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"valor": {
"original": "567.89"
},
"chave": "a1f4102e-a446-4a57-bcce-6fa48899c1d1",
"solicitacaoPagador": "Informe o número ou identificador do pedido."
}

Review charge

PATCH/v2/cob/:txid

Endpoint to review (modify) a charge using the txid.

Requires authorization for the scope: cob.write

Request

{
"loc": {
"id": 7768
},
"devedor": {
"cpf": "12345678909",
"nome": "Francisco da Silva"
},
"valor": {
"original": "123.45"
},
"solicitacaoPagador": "Informe o número ou identificador do pedido."
}

AttributeDescriptionRequiredType
txidTransaction identifier
The txid field determines the identifier of the transaction. For more details click here.
yesstring (Transaction id)
[A-Z0-9-]{26,35}

Charge review data

(*) Required attribute

AttributeDescriptionRequiredType
calendarioFields in the calendar identifier organize information about billing time control.

calendario:
criacao*// Timestamp that indicates when the charge was created. Respects the format defined in RFC 3339.
Minimum of 1 character and maximum of 255 characters (String).


apresentacao*// Timestamp that indicates the time when the JSON payload representing the charge was recovered. That is the time when the user took the QR Code capture to check the payment data. Respects the format defined in RFC 3339.
string date-time (QR Code presentation timestamp)


expiracao// Billing lifetime, specified in seconds from the creation date (Calendario.criacao).
integer <int32>
Noobject (Calendário)
statusEnum: "ATIVA","CONCLUIDA"

"REMOVIDA_PELO_USUARIO_RECEBEDOR",

"REMOVIDA_PELO_PSP"
Nostring (Charge Status)
devedorFields under the devedor object are optional and identify the debtor, that is, the person or institution to whom the collection is addressed. It does not necessarily identify who will actually make the payment. A CPF may be the debtor of a charge, but it can happen that another CPF actually performs the payment of the document. The pagador.cpf and pagador.cnpj field are not allowed to be filled in at the same time. If the pagador.cnpj field is filled in, then the pagador.cpf field cannot be filled in, and vice versa. If the field pagador.name is filled in, then there must exist either a pagador.cpf or a pagador.cnpj field filled in.

devedor:
cpf*// Payer user CPF.
string /^\d{11}$/


nome*// Name of the paying user.
string (Name) ≤ 200 characters
NoNatural person (object) or Legal entity (object)
valorAll fields that indicate monetary values comply with the ID 54 format of the EMV/BR Code specification for QR Codes. The decimal separator is the dot character. It is not applicable to use as thousand separator. Examples of values adhering to the pattern: “0.00”, “1.00”, “123.99”, “123456789.23”

valor:
original*// Original billing amount.
string \d{1,10}\.\d{2}
{26,35}
Noobject
locIdentifier of the location's payload.

loc:
id*// Location ID to associate with billing.
int32
Noobject
chaveThe chave field, required, determines the Pix key registered in DICT that will be used for billing. This key will be read by the payer's PSP application for DICT consultation, which will return the information that will identify the recipient of the charge.Nostring (recipient's DICT key) ≤ 77 characters
solicitacaoPagadorThe optional solicitacaoPagador field determines a text to be presented to the payer so that it can enter a related information, in free format, to be sent to the recipient. This text will be filled in, in pacs.008, by the payer's PSP, in the RemittanceInformation field. The size of the field in pacs.008 is limited to 140 characters.Nostring (Payer's request)
≤ 140 characters
infoAdicionaisEach additional information in the list (nome and valor) must be presented to the payer.

infoAdicionais:
nome*// Field's name
string (Name)
≤ 50 characters


valor*// Field's data
string (Amount)
≤ 200 characters
NoArray of objects (Additional information) ≤ 50

Responses

{
"status": "ATIVA",
"calendario": {
"criacao": "2020-09-09T20:15:00.358Z",
"expiracao": 3600
},
"location": "pix.example.com/qr/9d36b84f-c70b-478f-b95c-12729b90ca25",
"txid": "7978c0c97ea847e78e8849634473c1f1",
"revisao": 1,
"devedor": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"valor": {
"original": "567.89"
},
"chave": "a1f4102e-a446-4a57-bcce-6fa48899c1d1",
"solicitacaoPagador": "Informe o número ou identificador do pedido."
}

Get charge

GET/v2/cob/:txid

Endpoint to get charge's information using the txid.

You can also see information for a specific review of a charge. To do this, it is necessary to inform the query param revisao. Exemplo: /v2/cob/:txid/?revisao=1. When the parameter is not reported, the most recent review is returned as the default.

Requires authorization for the scope: cob.read

Request

AttributeDescriptionRequiredType
txidTransaction identifier
The txid field determines the identifier of the transaction. For more details click here.
Yesstring (Transaction Id)
[A-Z0-9-]{26,35}
revisaoAllows the recovering previous reviews from a charge. In the absence of this parameter, the charge will always be returned as it is in your last review.NoInteger <int32> (Review)

Respostas

The answers below presents Success(200) and Consumption failures/errors.

{
"status": "ATIVA",
"calendario": {
"criacao": "2020-09-09T20:15:00.358Z",
"expiracao": "3600"
},
"location": "pix.example.com/qr/9d36b84f-c70b-478f-b95c-12729b90ca25",
"txid": "7978c0c97ea847e78e8849634473c1f1",
"revisao": 1,
"devedor": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"valor": {
"original": "567.89"
},
"chave": "a1f4102e-a446-4a57-bcce-6fa48899c1d1",
"solicitacaoPagador": "Informe o número ou identificador do pedido."
}

Get list of charges

GET/v2/cob/

Endpoint to get a list of charges.

This endpoint has filters to ensure better search results, such as CPF/CNPJ and status. In all available filters, the inicio and fim filters are required and represent the range of dates in which the charges consulted must be inserted.

Requires authorization for the scope: cob.read

Request

The code below illustrates the consumption of the endpoint in a request with as few parameters as possible (the range of 'start' and 'end' dates) and the format in which these parameters should be passed on.

/v2/cob?inicio=2021-10-22T16:01:35Z&fim=2021-11-30T20:10:00Z

(*) Required attribute

AttributeDescriptionRequiredType
inicioFilters records whose creation date is greater than or equal to the start date. Respects RFC 3339Yesstring
<date-time>
fimFilters records whose creation date is less than or equal to the end date. Respects RFC 3339Yesstring
<date-time>
cpfFilter for payer's CPF. It cannot be used at the same time as the CNPJ.Nostring /^\d{11}$/
cnpjFilter for payer's CNPJ. It cannot be used at the same time as the CPF.Nostring /^\d{14}$/
statusEnum: "ATIVA","CONCLUIDA"

"REMOVIDA_PELO_USUARIO_RECEBEDOR"

"REMOVIDA_PELO_PSP"

Filter by billing status.
Nostring
paginacao.paginaAtualDefault: 0
Page to be returned by query. If not reported, the PSP assumes it will be 0.
Nointeger <int32> (Current page) ≥ 0
paginacao.itensPorPaginaDefault: 100
Maximum number of records returned on each page. Only the last page can contain a smaller number of records.
Nointeger <int32>(Items per Page)[1 .. 1000]

Responses

{
"parametros": {
"inicio": "2020-04-01T00:00:00Z",
"fim": "2020-04-02T10:00:00Z",
"paginacao": {
"paginaAtual": 0,
"itensPorPagina": 100,
"quantidadeDePaginas": 1,
"quantidadeTotalDeItens": 2
}
},
"cobs": [
{
"status": "ATIVA",
"calendario": {
"criacao": "2020-09-09T20:15:00.358Z",
"expiracao": "3600"
},
"location": "qrcodes-pix.gerencianet.com.br/9d36b84f-c70b-478f-b95c-12729b90ca25",
"txid": "7978c0c97ea847e78e8849634473c1f1",
"revisao": 1,
"devedor": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"valor": {
"original": "567.89"
},
"chave": "a1f4102e-a446-4a57-bcce-6fa48899c1d1",
"solicitacaoPagador": "Informe o número ou identificador do pedido."
},
{
"status": "CONCLUIDA",
"calendario": {
"criacao": "2020-09-09T20:15:00.358Z",
"expiracao": "3600"
},
"location": "qrcodes-pix.gerencianet.com.br/1dd7f893-a58e-4172-8702-8dc33e21a403",
"txid": "655dfdb1a4514b8fbb58254b958913fb",
"revisao": 1,
"devedor": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"valor": {
"original": "100.00"
},
"chave": "40a0932d-1918-4eee-845d-35a2da1690dc",
"solicitacaoPagador": "Informe o número ou identificador do pedido.",
"pix": [
{
"endToEndId": "E12345678202009091221kkkkkkkkkkk",
"txid": "655dfdb1a4514b8fbb58254b958913fb",
"valor": "110.00",
"horario": "2020-09-09T20:15:00.358Z",
"pagador": {
"cnpj": "12345678000195",
"nome": "Empresa de Serviços SA"
},
"infoPagador": "0123456789",
"devolucoes": [
{
"id": "123ABC",
"rtrId": "Dxxxxxxxx202009091221kkkkkkkkkkk",
"valor": "10.00",
"horario": {
"solicitacao": "2020-09-09T20:15:00.358Z"
},
"status": "EM_PROCESSAMENTO"
}
]
}
]
}
]
}

Pix


The following endpoints bring the features available for managing Pix transactions, this is maintaining receipts and sending amounts through the Pix payment arrangement.


Get Pix.

GET/v2/pix/:e2eId

Endpoint to consult a Pix through an End to End ID (e2eid).

Requires authorization for the scope: pix.read

caution

This endpoint returns only informations about Received Pix.


Request


AttributeDescriptionRequiredType
e2eidEndToEndIdentification that transits on PACS002, PACS004 e PACS008Yesstring 32 characters[A-Z0-9-]{32}

Respostas

The answers below presents Success(200) and Consumption failures/errors.

{
"endToEndId": "E12345678202009091221abcdef12345",
"txid": "cd1fe328c875481285a6f233ae41b662",
"valor": "100.00",
"horario": "2020-09-10T13:03:33.902Z",
"infoPagador": "Reforma da casa",
"devolucoes": [
{
"id": "000AAA111",
"rtrId": "D12345678202009091000abcde123456",
"valor": "11.00",
"horario": {
"solicitacao": "2020-09-10T13:03:33.902Z"
},
"status": "EM_PROCESSAMENTO"
}
]
}

Get list of received Pix.

GET/v2/pix

Endpoint to get a list of received Pix.

Requires authorization for the scope: pix.read


Request

This endpoint has filters to narrow down the results. All filters are of the query params type, so they must be sent by the URL, as exemplified in the code below.

/v2/pix?inicio=2020-04-01T00:00:00Z&fim=2020-04-01T23:59:59Z

The filters inicio and fim defines a range of dates in which the Pix must be included to be returned. These are required filters.


AttributeDescriptionRequiredType
inicioFilters the records whose creation date is greater than or equal to the start date. Respects RFC 3339.Yesstring
<date-time>
fimFilters the records whose creation date is less than or equal to the end date. Respects RFC 3339.Yesstring
<date-time>
txidTransaction ID
The txid field determines the identifier of the transaction. The purpose of this field is to be an element that allows the recipient's PSP to present to the receiving user the functionality of reconciliation of payments.

In pacs.008, it is referenced as TransactionIdentification <txid> or idConciliacaoRecebedor.

In terms of operating flow, the txid is read by the payer's PSP application and, after the payment is confirmed, it is sent to the SPI via pacs.008. A pacs.008 is also sent to the recipient's PSP, containing, in addition to all the user payment information, the txid. Upon noticing a receipt with the txid, the PSP of the recipient is able to communicate with the receiving user, informing that a specific payment has been settled.

Txid is created exclusively by the receiving user and is under their responsibility. The txid, in the context of presenting a charge, is unique per CPF/CNPJ of the receiving user. It is up to the receiving PSP to validate this rule in the Pix API.
Nostring [A-Z0-9-]{26,35}
txidPresenteBoolean.No
devolucaoPresenteBoolean.No
cpfFilter for the payer's CPF. It can't be used in the same time as the filter CNPJ.Nostring /^\d{11}$/
cnpjFilter for the payer's CNPJ. It can't be used in the same time as the filter CPF.Nostring /^\d{14}$/
paginacao.paginaAtualDefault: 0
Page to be returned by query. If not reported, the PSP assumes it will be 0.
Nointeger <int32> (Current page) ≥ 0
paginacao.itensPorPaginaDefault: 100
Maximum number of records returned on each page. Only the last page can contain a smaller number of records.
Nointeger <int32>(Items per Page)[1 .. 1000]

Responses

{
"parametros": {
"inicio": "2020-04-01T00:00:00Z",
"fim": "2020-04-01T23:59:59Z",
"paginacao": {
"paginaAtual": 0,
"itensPorPagina": 100,
"quantidadeDePaginas": 1,
"quantidadeTotalDeItens": 2
}
},
"pix": [
{
"$ref": "/bacen/gn-pix-api/-/raw/master/docs/api.swagger.yaml#/components/examples/pixResponse1/value"
},
{
"$ref": "/bacen/gn-pix-api/-/raw/master/docs/api.swagger.yaml#/components/examples/pixResponse2/value"
}
]
}

Request for Pix sending

PUT/v2/gn/pix/:idEnvio

Endpoint to directly send a Pix to a Pix Key registered on a PSP or bank account data, either from Gerencianet or another bank.

caution

To enable the pix/send endpoint you need to fill in this form. After filling out, just wait for us to contact you.

We release a 15-day trial that can be requested by both individuals and legal entities. The procedure is the same, fill out the indicated form.

note

In order to use the Require Pix Sending endpoint, in addition to releasing the pix.send scope, the payer's Pix key must have a webhook associated with it, as it will be through the webhook that Gerencianet will inform you if the sending of pix was performed successfully or not.

For better performance of the use of the service, and aiming to avoid the collision of balance movements, we suggest that the sending of Pix by API is conditioned to the conclusion of the previous transaction, which takes place through the webhook. If the aforementioned practice is not adopted, when multiple submission requests are made simultaneously, the integrator may experience submission failures.


The endpoint may change when it enters in the BACEN patterning scope. Enabled customers will be notified in advance.

Requires authorization for the scope: pix.send

Request

{
"valor": "12.34",
"pagador": {
"chave": "19974764017"
},
"favorecido": {
"chave": "joão@meuemail.com"
}
}

(*) Required attribute
AttributeDescriptionRequiredType
idEnviotransaction identifier: The idEnvio field determines the transaction identifier..Yesstring ^[a-zA-Z0-9]{1,35}

(*) Required attribute for body

AttributeDescriptionRequiredType
valorMonetary amounts related to the charge.Yesstring \d{1,10}.\d{2}
pagadorThe required payer field contains the Pix key associated with the authenticated account that will be debited the amount you set.

pagador:

chave* // The chave field, required, determines the Pix key registered in DICT that will be used to identify the Pix payer (Payer's DICT key) ≤ 77 characters

infoPagador // payer information about the Pix to be sent. string ≤ 140 characters

Yesobject
favorecidoThe favorecido field, required, contains the Pix key that will be credited the set amount.

Favorecido attributes:

chave // The chave field, required, determines the Pix key registered in DICT that will be used to identify the Pix recipient. string (recipient's DICT Key)
≤ 77 characters

chave attributes:

cpf // The cpf field validates if the Pix key registered in the DICT belongs to the holder of the informed document ^[0-9]{11}$

cnpj // The cnpj field validates if the Pix key registered in the DICT belongs to the holder of the informed document ^[0-9]{14}$
Note: The cpf and cnpj attributes are optional, but once inserted in the schema, the filling becomes mandatory.



contaBanco // The contaBanco field, required, determines the bank account details of the Pix recipient.
contaBanco attributes:

nome (Required) // ISPB of the receiver bank account (string) ≤ 200 characters

cpf // Receiver's CPF (string) ^[0-9]{11}$

cnpj // Receiver's CNPJ (string) ^[0-9]{14}$

codigoBanco (Required) // ISPB of the receiver bank account (string) ^[0-9]{8}$

agencia (Required) // Recipient's agency at their Bank (string) ^[0-9]{1,4}$

conta (Required) // Recipient's account at their Bank (string)^[0-9]+

tipoConta (Required) // Type of the recipient's account at your Bank (string)^[0-9]+
* Enum: "cacc"(Checking account), "svgs"(Saving account)
Yesobject
statusThe status field on the return of the webhook represents the situation of the direct send request from a Pix to a Pix key, and can assume the following states: "EM_PROCESSAMENTO", "REALIZADO", "NAO_REALIZADO"

Nostring

Responses

{
"e2eId": "E09089356202011251226APIff82f2e5",
"valor": "12.31",
"horario": {
"solicitacao": "2020-11-25T12:26:42.905Z"
},
"status": {
"type": "EM_PROCESSAMENTO"
}
}

Refund request.

PUT/v2/pix/:e2eId/devolucao/:id

Endpoint to request a return via a Pix e2eid and devolution ID. The reason that will be assigned to PACS.004 will be "Return requested by the receiving user of the original payment" whose acronym is "MD06" according to the RTReason tab of PACS.004 that appears in the Pix Message Catalog.

Requires authorization for the scope: pix.write

Request

(*) Required attribute


AttributeDescriptionRequiredType
e2eidEndToEndIdentification that transits in PACS002, PACS004 e PACS008Yesstring (Ent to end id of the transaction)32 characters[A-Z0-9-]{32}
idCustomer-generated ID to represent only one return.Yesstring (Return Id )[A-Z0-9-]{1,35}

Data for refund request.

(*) Required attribute

AttributeDescriptionRequiredType
valorAmount requested for return. The sum of the values of all refunds cannot exceed the total value of the Pix.Yesstring (Amount)\d{1,10}\.\d{2}

Responses

{
"id": "123456",
"rtrId": "D12345678202009091000abcde123456",
"valor": "7.89",
"horario": {
"solicitacao": "2020-09-11T15:25:59.411Z"
},
"status": "EM_PROCESSAMENTO"
}


Get refund.

GET/v2/pix/:e2eId/devolucao/:id

Endpoint to check a return through a Pix End To End ID and return ID.

Requires authorization for the scope: pix.read

Request

(*) Required attribute

AttributeDescriptionRequiredType
e2eidEndToEndIdentification that transits in the PACS002, PACS004 e PACS008Yesstring (End to end Id of the transaction) 32 characters[A-Z0-9-]{32}
idCustomer-generated ID to represent only one return.Yesstring (Return Id)[A-Z0-9-]{1,35}

Responses

The responses below represent Success(200) and Consumption failures/errors.

{
"id": "123456",
"rtrId": "D12345678202009091000abcde123456",
"valor": "7.89",
"horario": {
"solicitacao": "2020-09-11T15:25:59.411Z"
},
"status": "EM_PROCESSAMENTO"
}

Payload Locations


The set of endpoints below are intended to handle configuration and removal of locations for the use of the payloads.

Creating location from a payload

POST/v2/loc

Endpoint to create a location from the payload.

Requires authorization for the scope: payloadlocation.write


Request

{
"tipoCob": "cob"
}

Responses

The responses below represent Success(200) and Consumption failures/errors.

{
"id": 66,
"location": "qrcodes-pix.gerencianet.com.br/v2/7796e273b8e447c2b2c0ac2c58fe1a13",
"tipoCob": "cob",
"criacao": "2021-01-15T20:13:39.462Z"
}

Get locations

GET/v2/loc

Endpoint to get registered locations.

Requires authorization for the scope: payloadlocation.read

Request

To obtain the result of the locations query it is necessary to inform the parameters inicio e fim ("start" and "end") , as shown in the code snippet below. These parameters restrict the results to the locations within this date range.

/v2/loc/?inicio=2020-10-22T16:01:35Z&fim=2020-10-23T16:01:35Z

(*) Required attribute

AttributeDescriptionRequiredType
inicioFilters records whose creation date is greater than or equal to the start date. Respects RFC 3339.Yesstring <date-time>
fimFilters records whose creation date is less than or equal to the end date. Respects RFC 3339.Yesstring <date-time>

Responses

The responses below represent Success(200) and Consumption failures/errors.

{
"parametros": {
"inicio": "2020-04-01T00:00:00Z",
"fim": "2020-04-01T23:59:59Z",
"paginacao": {
"paginaAtual": 0,
"itensPorPagina": 100,
"quantidadeDePaginas": 1,
"quantidadeTotalDeItens": 3
}
},
"loc": [
{
"$ref": "/bacen/gn-pix-api/-/raw/master/docs/api.swagger.yaml#/components/examples/payloadLocationResponse1/value"
},
{
"$ref": "/bacen/gn-pix-api/-/raw/master/docs/api.swagger.yaml#/components/examples/payloadLocationResponse2/value"
},
{
"$ref": "/bacen/gn-pix-api/-/raw/master/docs/api.swagger.yaml#/components/examples/payloadLocationResponse3/value"
}
]
}

Recover payload location

GET/v2/loc/:id

Endpoint to get registered locations.

Requires authorization for the scope: payloadlocation.read

Request

(*) Required attribute

AttributeDescriptionRequiredType
idLocation id registered to serve a payload.Yesstring

Response

The responses below represent Success(200) and Consumption failures/errors.

{
"id": 7716,
"txid": "fda9460fe04e4f129b72863ae57ee22f",
"location": "pix.example.com/qr/v2/cobv/2353c790eefb11eaadc10242ac120002",
"tipoCob": "cobv",
"criacao": "2020-03-11T21:19:51.013Z"
}

Generate QRCode from location

GET/v2/loc/:id/qrcode

Endpoint to generate QRCode and copy/paste code from a location.

Requires authorization for the scope: payloadlocation.read

Request

(*) Required attribute

AttributeDescriptionRequiredType
idLocation id registered to serve a payload.Yesstring

Responses

The responses below represent Success(200) and Consumption failures/errors.

{
"qrcode": "00020126880014BR.GOV.BCB.PIX2566qrcodes-pix.gerencianet.com.b...",
"imagemQrcode": "data:image/png;base64,iVBORw0KGgoAAAAOQAAADkCAYAAACIV4s..."
}

Unlink a txid from location

DELETE/v2/loc/:id/txid

Endpoint used to unlink a txid from location.

Send successfully executed, the entity loc will no longer display a txid if it was displayed before the call of the function. In addition, the entity cob or cobv associated with the unlinked txid will also no longer display a location. This operation does not change the status of the cob or cobv.

Requires authorization for the scope: payloadlocation.write

Request

(*) Required attribute

AttributeDescriptionRequiredType
idLocation id registered to serve a payload.Yesstring

Responses

The responses below represent Success(200) and Consumption failures/errors.

{
"id": 2316,
"location": "qrcodes-pix.gerencianet.com.br/v2/a8534e273ecb47d3ac30613104544466",
"tipoCob": "cob",
"criacao": "2020-05-31T19:39:54.013Z"
}

Webhook


This section brings together endpoints for managing notifications by the receiving PSP to the receiving user.


Understanding the mTLS pattern

As a rule by the Central Bank, it will be necessary to insert a Gerencianet public key on its server so that the communication complies with the mTLS pattern. In your domain that represents your server, a configuration must be made to require the public key (mTLS) that we are providing for mutual authentication to occur.

Gerencianet will make 2 requests for your domain (server):

  1. First Request: Let's make sure your server is demanding a public key from Gerencianet. This will be done when sending a request without a certificate and your server should not accept the request. Once answered with the refusal, the 2nd request will be sent.
  2. Second Request: We will send the notification together with our public key, your server, which must contain the public key available, must perform the "Hand-Shake" and thus the communication will be established.

Your server must have the minimum version of TLS 1.2. You can check about your TLS here

On your server you must configure a 'POST' route with a default response as a string "200". Our production certificate or homologation must be inserted in your server, below we have some examples.

Dedicated Servers

It is recommended that you have a dedicated server to be able to configure the webhook, since it is necessary to have access to some files to perform the configurations as in the examples below.

Shared hosting

For hosting on shared servers, there may be restrictions regarding the insertion of certificates generated by another entity, such as our CA for example. If you have problems, we advise you to opening a ticket with the subject: mTLS on shared hosting or contact us through our channel #api-pix no Discord. We will analyze the situation so that we can act together to help you.


Examples of server settings

To configure your server, you will need the Gerencianet public keys. Below are the key addresses for the Production and Homologation environments. These keys must be downloaded and placed on your server.

AttributeDescription
Productionhttps://pix.gerencianet.com.br/webhooks/chain-pix-prod.crt
Homologationhttps://pix.gerencianet.com.br/webhooks/chain-pix-sandbox.crt

The code snippets below seek to exemplify the necessary settings on your server so that it is possible to perform the hand-shake with our servers.

from flask import Flask, jsonify
import ssl
import json
app = Flask(__name__)
@app.route("/")
def hello():
return "<h1 style='color:blue'>Hello There!</h1>"
@app.route("/", methods=["PUT"])
def hello_put():
response = {"status": 200}
return jsonify(response)
@app.route("/", methods=["POST"])
def imprimir():
imprime = print(request.json)
data = request.json
with open('data.txt', 'a') as outfile:
outfile.write("\n")
json.dump(data, outfile)
return jsonify(imprime)
def hello_post():
response = {"status": 200}
return jsonify(response)
if __name__ == "__main__":
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
context.verify_mode = ssl.CERT_REQUIRED
context.load_verify_locations('path-certificate/Gerencianet-public-cert.crt')
context.load_cert_chain(
'path-certificate/server_ssl.crt.pem',
'path-certificate/server_ssl.key.pem')
app.run(ssl_context=context, host='0.0.0.0')
#Desenvolvido pela Consultoria Técnica da Gerencianet

To have a valid SSL, you must contact a Certificate Authority and generate a private key server_ssl.key.pem and a public key server_ssl.crt.pem, so you can validate the integrity of the connection. You can do this for free using a utility like Certbot for example.


Setting Pix Webhook

PUT/v2/webhook/:chave

Endpoint for configuring the notification service about Pix received and Pix send. Pix from static charges will only be notified if they are associated with a txid.

Requires authorization for the scope: webhook.write

Request

(*) Required attribute

AttributeDescriptionRequiredType
chaveThe chave field determines the Pix key registered in the DICT that will be used for billing. This key will be read by the payer's PSP application for consultation with the DICT, which will return information that will identify the recipient of the charge.Yesstring (DICT Key) ≤ 77 characters;

Data for webhook configuration.

{
"webhookUrl": "https://exemplo-pix/webhook"
}

(*) Required attribute

AttributeDescriptionRequiredType
webhookUrlUrl where the notification will be sentYesstring <uri>

Responses

The responses below represent Success(200) and Consumption failures/errors.

Webhook notifications about received Pix associated to a txid

Get webhook information

GET/v2/webhook/:chave

Endpoint for retrieving information about the pix webhook.

Requires authorization for the scope: webhook.read

Request

(*) Required attribute

AttributeDescriptionRequiredType
chaveThe chave field determines the Pix key registered in DICT that will be used for billing. This key will be read by the payer's PSP application for dict consultation, which will return the information that will identify the recipient of the charge.Yesstring (DICT key) ≤ 77 characters;

Response

The answer below represents Success(200) of consumption.

{
"webhookUrl": "https://gn-pix-webhook.gerencianet.com.br/webhook/",
"chave": "40a0932d-1918-4eee-845d-35a2da1690dc",
"criacao": "2020-11-11T10:15:00.358Z"
}

Get list of webhooks

GET/v2/webhook/

Endpoint for consulting webhooks associated with keys through parameters such as início and fim ("start" and "end"). Attributes are entered as query params.

Requires authorization for the scope: cob.write

Request

The snippet below shows how the parameters inicio and fim (required) should be passed on in the requisition.

/v2/webhook/?inicio=2020-10-22T16:01:35Z&fim=2020-10-23T16:01:35Z

(*) Required attribute

AttributeDescriptionRequiredType
inicioFilters records whose creation date is greater than or equal to the start date. Respects RFC 3339.Yesstring <date-time>
fimFilters records whose creation date is less than or equal to the end date. Respects RFC 3339.Yesstring <date-time>

Responses

The responses below represent Success(200) and Consumption failures/errors.

{
"parametros": {
"inicio": "2020-04-01T00:00:00Z",
"fim": "2020-04-01T23:59:59Z",
"paginacao": {
"paginaAtual": 0,
"itensPorPagina": 100,
"quantidadeDePaginas": 1,
"quantidadeTotalDeItens": 1
}
},
"webhooks": [
{
"$ref": "/bacen/gn-pix-api/-/raw/master/docs/api.swagger.yaml#/components/examples/webhookResponse1/value"
}
]
}

Delete webhook.

DELETE/v2/webhook/:chave

Endpoint to delete pix webhook.

Requires authorization for the scope: webhook.write

Request

(*) Required attribute

AttributeDescriptionRequiredType
chaveThe chave field determines the Pix key registered in DICT that will be used for the charge. This key will be read by the payer's PSP application for DICT consultation, which will return the information that will identify the recipient of the charge.Yesstring (DICT key) ≤ 77 characters;

Response

Webhook to Pix notifications was deleted

Receiving Callbacks

This service is protected by an mTLS authentication layer. Callbacks are sent by Gerencianet via POST <url-webhook-cadastrada>​/pix when there is a change in Pix status.

Request

A POST request is sent by Gerencianet to the URL you have registered as a webhook for a given key. When there is a change in the status of a Pix transaction, involving the associated key, a JSON object (such as the examples below) is sent to your server. Each request sent has a timeout of 60 seconds, that is, a callback request is interrupted upon reaching 60 seconds without response.

// Pix recebido
{
"pix": [
{
"endToEndId": "E1803615022211340s08793XPJ",
"txid": "fc9a43k6ff384ryP5f41719",
"chave": "2c3c7441-b91e-4982-3c25-6105581e18ae",
"valor": "0.01",
"horario": "2020-12-21T13:40:34.000Z",
"infoPagador": "pagando o pix"
}
]
}

The following table details the fields present in the JSON object that will be sent in the notification.


(*) Required attribute

AttributeDescriptionRequiredType
endToEndIdEndToEndIdentification that transits in PACS002, PACS004 e PACS008Yesstring (End to end id of the transaction)
[A-Z0-9-]{26,35}
txidTransaction Id
Determines the identifier of the transaction. The purpose of this field is to be an element that allows the recipient's PSP to present to the receiving user the functionality of reconciliation of payments, more details click here.
NoArray of objects (Pix)
[A-Z0-9-]{26,35}
valorPix amount.Yesstring \d{1,10}\.\d{2}
horarioTime the Pix was processed on psp.Yesstring <date-time> (Horário)
pagador A CPF or CNPJ can be the payer of a charge. The pagador.cpf and pagador.cnpj field are not allowed to be filled in at the same time. If the pagador.cnpj field is filled in, then the pagador.cpf field cannot be filled in, and vice versa.

pagador:
cpf*// CPF of the paying user.
string /^\d{11}$/


nome*// Name of the paying user.
string (Name)
≤ 200 characters
NoNatural person (object) or Legal Entity (object)
infoPagadorFree payer informationYesstring
≤140 characters
devolucoesdevolucoes:
id*// Customer-generated ID to represent only onde refund.
string (Refund Id) [A-Z0-9-]{26,35}


rtrId*// ReturnIdentification that transits in PACS004.
string (RtrId) ≤ 32 characters


valor*// Amount to refund.
string \d{1,10}\.\d{2}


horario*// Time attributes
object
  • solicitacao*: //Time at which the return was requested on psp.
    string <date-time> (Request time)
  • liquidacao: //Time at which the return was settled on psp.
    string <date-time> (Settlement time)


status*// Refund status. Enum: "EM_PROCESSAMENTO","DEVOLVIDO",
"NAO_REALIZADO"
string (Status)
NoArray ()

Response

Callback requests await a response with HTTP 2XX status. If the client server returns a different status, Gerencianet makes up to 10 notification retries. The first retry will be made 5 minutes after the callback submission fails. If the error persists, subsequent attempts will be sent at increasing time intervals, as shown in the table below.

Important

In cases where the client server returns HTTP 429 status (too many requests), Gerencianet servers will attempt to send the notification up to 6 times as well as the table below.

Trial numberTime (in minutes)
15
210
320
440
580
6160
7320
8640
91280
102560

Gerencianet's exclusive endpoints

The endpoints listed in this section are intended to facilitate the use of the Pix API for Gerencianet clients. With the following endpoints you can obtain and change your account information directly through the API, depending on the need for your integration.


Create evp key

POST/v2/gn/evp

Endpoint used to create a random Pix key (evp).

Requires authorization for the scope: gn.pix.evp.write

Request

The request sent to this endpoint does not need a body, only the OAuth authorization headers and the account certificate, as well as the previous endpoints.


Responses

The responses below represent Success(200) and Consumption failures/errors.

{
"chave": "345e4568-e89b-12d3-a456-006655440001"
}

Get evp keys

GET/v2/gn/evp

Endpoint used to list random Pix keys (evp). The list will only show the keys of the random type.

Requires authorization for the scope: gn.pix.evp.read

Request

The request sent to this endpoint does not need a body, only the OAuth authorization headers and the account certificate, as well as the previous endpoints.


Responses

The responses below represent Success(200) and Consumption failures/errors.

{
"chaves": [
"355e4568-e89b-1243-a456-006655440001",
"133e4568-e89b-1243-a456-006655440000"
]
}

Delete evp key

DELETE/v2/gn/evp/:chave

Endpoint used to remove a random Pix key (evp). If you remove a random key, there is no way to create the same key again: the uuid is generated by DICT, and with each key record request, we are returned a different hash. This means that charges created for the removed key can no longer be paid because the payload will no longer be returned.

Requires authorization for the scope: gn.pix.evp.write

Request

The request sent to this endpoint does not need a body, only the information needed for authorization such as the previous endpoints and the chave (Pix key) parameter passed in the URL, which corresponds to the random Pix key (evp) that will be erased.

Responses

The responses below represent Success(200) and Consumption failures/errors.

```json Random evp Key deleted ```

Get your account balance

GET/v2/gn/saldo

Endpoint for the purpose of searching the balance in your Gerencianet account. You can enable scope in your application settings in your Gerencianet account.

Requires authorization for the scope: gn.balance.read

Request

The request sent to this endpoint does not need a body, only the OAuth authorization headers and the account certificate, as well as the previous endpoints.


Responses

The responses below represent Success(200) and Consumption failures/errors.

{
"saldo": "100.00"
}

Create/modify account settings

PUT/v2/gn/config

Endpoint for the purpose of creating and modifying your account settings related to the API.

Requires authorization for the scope: gn.settings.write

Request

Below is an example of body for the requisition:

{
"pix": {
"receberSemChave": true,
"chaves": {
"355e4568-e89b-1243-a456-006655440001": {
"recebimento": {
"txidObrigatorio": false,
"qrCodeEstatico": {
"recusarTodos": false
},
"webhook": {
"notificacao": {
"tarifa": true
}
}
}
}
}
}
}

(*) Required attribute

AttributeDescriptionRequiredType
pixObject containing pix-related account settings.
receberSemChave*// Required Boolean attribute that configures the possibility of receiving Pix without registered keys.
boolean


chaves// Optional object attribute. It can contain one or more keys and their individual settings.

  • < chave pix >: // Optional string attribute. String that represents a Pix key and satisfies the Regex.
    ^[a-zA-Z0-9-.@_+]{1,77}$
    • recebimento*: // Attribute object required. Contains settings related to Pix receipts for a given key.
      • txidObrigatorio*: // Required Boolean attribute. It sets the txid requirement on charges received by a Pix key. boolean
      • qrCodeEstatico*: // Attribute object required. Contains settings related to static QR Codes for a given Pix key.
        • recusarTodos*: // Required Boolean attribute. Sets up the rejection of all static QR Codes. boolean
  • webhook // Optional object attribute. Contains settings related to receipts of fee information for each Pix charge received or sent.
    • tarifa* // Required Boolean attribute. Configures the receipt or not of the amount of fees paid when receiving or sending Pix in the Managernet account. boolean
YesObject

Responses

The responses below represent Success(200) and Consumption failures/errors.

Settings already created/modifyed

Get account settings

GET/v2/gn/config

Endpoint for the purpose of listing the settings set on the account.

Requires authorization for the scope: gn.settings.read

Request

The request sent to this endpoint does not need a body, only the OAuth authorization headers and the account certificate, as well as the previous endpoints.


Responses

The responses below represent Success(200) and Consumption failures/errors.

{
"pix": {
"receberSemChave": true,
"chaves": {
"355e4568-e89b-1243-a456-006655440001": {
"recebimento": {
"txidObrigatorio": true,
"qrCodeEstatico": {
"recusarTodos": false
}
}
}
}
}
}

Request Reconciliation Extract

POST/v2/gn/relatorios/extrato-conciliacao

Endpoint to request reconciliation extract.

Requires authorization for the scope: gn.reports.write

Request

Below is an example of body for the requisition:

{
"dataMovimento": "2022-04-24",
"tipoRegistros": {
"pixRecebido": true
}
}

(*) Required attribute

AttributeDescriptionRequiredType
dataMovimentoDate of the desired extractYesstring
tipoRegistrosObject containing the desired parametersYesobject
pixRecebidoReceived Pix (PR)Noboolean
pixDevolucaoEnviadaPix Return Sent (PDE)Noboolean
tarifaPixRecebidoPix Received Rate (TPR)Noboolean
pixEnviadoChavePix Sent via key (PEC)Noboolean
pixEnviadoDadosBancariosPix Sent via bank details (PEB)Noboolean
pixDevolucaoRecebidaPix Return Received (PDR)Noboolean

Note: The attributes that are not mandatory belong to the object tipoRegistros. To perform the request, it is necessary that the tipoRegistros contain at least one of the attributes. When the attribute is not entered, the value is assumed to be false.


Responses

The responses below represent Success(202) and Consumption failures/errors.

{
"id": "3d0ca315-aff9–4fc2-be61–3b76b9a2d798",
"dataSolicitacao": "“2022-02-14T14:42:51.013Z",
"status": "AGUARDANDO_PROCESSAMENTO"
}

Status types returned in the body:

  • AGUARDANDO_PROCESSAMENTO: This status indicates that the extract request was successfully received and is in the queue waiting to start processing;

  • EM_PROCESSAMENTO: This status indicates that the file generation has started and is in the data processing stage;

  • CONCLUIDO: This status indicates that an extract with the same parameters was requested previously and a file with the returned id is already downloadable.

GOOD PRACTICE:

After performing the POST request, the API has an average waiting time of 30 seconds to process the extract. So it is recommended to wait this time to perform the GET request.


Request Download Reconciliation Extract

GET/v2/gn/relatorios/:id

Endpoint to request the download of the reconciliation extract.

Requires authorization for the scope: gn.reports.read

Request

AttributeDescriptionRequiredType
idIdentifier to fetch requested reportYesstring

Responses

Attention

If it consumes the GET endpoint and the extract has not yet been processed, the response will be success(202) and the return will be similar to what is returned in the request, informing which processing step the request is in.


The responses below represent Success(200) and Consumption failures/errors.

CA;Gerencianet;364;1;517613;João da Silva;2021-12-17;2021-12-10;Extrato de Conciliação API Pix;1.0
T;0;0;0;0;0;0

Return detail

For more information about the .CSV document that is returned and the caption of the fields, download the PDF available on this link.