Endpoints
On this page you will find all available endpoints of the Gerencianet Payment API. We recommend that you join our community in Discord to keep up with api developments, including the release of new endpoints.
Use the summary below to quickly navigate between api endpoint groups.
Base routes
Base route or base URL's for environments, use the route below to communicate your application with the production environment offered by Gerencianet.
- Production
Get authorization
This endpoint is used to authorize an application's credentials and get the scopes that the application has to access the other API endpoints. The P12/PEM certificate must be present in the authorization request for the handshake with the API server to be allowed.
Examples of authorization using the certificate. P12
To use the Gerencianet Payment API, the client and server must communicate on a verified connection to each other. Verification is done by the two-way certificate (.PEM or .P12), that is, the server and client have implemented a private key certificate and a public key certificate that allows one to ensure the identity of the other.
Therefore to make any HTTP request to the Payments API, including the authorization request with OAuth2, it is necessary the certificate .P12, or .pem, in the request headers.
Below are examples of how to consume the Authorization of the Gerencianet Payment API by incorporating this certificate into the request.
- php
- Node
- Python
- C#
- Ruby
- Java
- Go
Authorization example of response
The code snippet below represents an example of OAuth's response to your authorization request.
- Response
Payments
Getting the barcode to pay
This endpoint should be used to get the information linked to a barcode of any type of billing. The use of this endpoint is mandatory before making a payment, as it helps prevent errors in processing.
Important
There are two types of charges and they can return different information. Are they:
Tribute type – also known as bonds and agreements, this type of charge is issued by services such as: water, electricity, telephone and gas bills. They are not registered with the "Câmara Interbancária de Pagamento" (CIP) and, therefore, do not return the same information that a boleto registered with the CIP presents.
Boleto type – registered with the "Câmara Interbancária de Pagamento" (CIP) and, therefore, after being consulted, the endpoint returns more complete information about the payment.
In the item “Responses”, below, you can check the return of the queries of each type of charge.
gn.barcode.read
Request
This endpoint uses query params in its operation, so they must be sent via the URL, as exemplified in the code snippet below.
/pagamento/codBarras/:codBarras
Parameters Definition
Attribute | Description | Required | Type |
---|---|---|---|
codBarras | Charge barcode, this code can also be the typeable line returned via API by the 'barcode'. | yes | String |
The answers below represent Success and Failures of consumption.
- 200 (barcode type)
- 200 (tributte type)
- 400
Request barcode payment
This endpoint should be used to request payment for a barcode for the current or future date.
Important
Barcode payments are accepted until 10pm. Tax payments and bills (water, energy, cable TV, gas and telephone) are until 6pm.
gn.barcode.pay.write
Request
This endpoint uses query params, so they should be sent by the URL, as exemplified in the code snippet below.
/pagamento/codBarras/:codBarras
Request body
- Example
Params definition
Attribute | Description | Required | Type |
---|---|---|---|
codBarras | barcode of the bill that is about to pay. | yes | String |
dataPagamento | Payment due date. | yes | string. In the format YYYY-MM-DD |
valor | Charge amount. | yes | Integer. Value in BRL cents. Ex: R$10,00 = 1000 |
descricao | payment description. | no | String |
The answers below represent Success and Consumption Failures.
- 200
- 400
Get payment request
Check the status of the payment request previously using the idPagamento
.
gn.barcode.pay.read
Request
This endpoint uses query params, so they should be sent by the URL, as exemplified in the code snippet below.
/pagamento/:idPagamento
Params definition
Attribute | Description | Required | Type |
---|---|---|---|
idPagamento | Id generated in the payment request | yes | String |
status | The status field represents the status of the requested payment. It can assume the following states:EM_PROCESSAMENTO - (processing) The payment request has been received and is being processed.AGENDADO - (scheduled) Payment was scheduled to be made on the requested date.REALIZADO - (done) Payment has been successfully sent to be settled.LIQUIDADO - (settled) Payment has been successfully settled.CANCELADO - (canceled) The payment was canceled and the amount refunded.NAO_REALIZADO - (not done) The payment had an error and was not sent for settlement. | no | String |
The answers below represent Success and Consumption Failures.
- 200 (settled)
- 200 (Fail)
- 400
Get list of payment requests
Requires the scope:
gn.barcode.pay.read
This endpoint should be used to request a summary of payment requests made within an informed period.
RequestThis endpoint uses query params, so they should be sent by the URL, as exemplified in the code snippet below.
Attribute | Description | Required | Type |
---|---|---|---|
dataInicio | Inicial date to show the list. | yes | string Ex: XXXX-XX-XX |
dataFim | Final date to show on the list. | yes | string Ex: XXXX-XX-XX |
The answers below represent Success and Failures.
- 200
- 400