Others endpoints
There are another endpoints (services) available in the API and that can be used in carnês:
Before proceeding, make sure that the Gerencianet SDK has been installed
The rest of this page presents the detailed procedures, but you need to install one of our libraries on your server to run the sample code.
1) Return information about a carnê
Returns information about a created carnê. Each transaction created via carnê has a unique identifier key that identifies it.
To return information from a carnê, you must send a GET
request to the route /v1/carnet/:id
, where :id
is the carnet_id
of the carnê.
If you want, you can explore and learn more about this resource using our Playground.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
2) Change notification URL (notification_url) and/or custom_id of a carnê
It is possible to define or change the information sent in the metadata
property of a carnê at any time. This endpoint is extremely important to update your notification URL linked to the carnê or modify the custom_id
previously associated with your carnê.
To change the notification_url
and/or custom_id
of a carnê, you must send a PUT
request to the route /v1/carnet/ :id/metadata
, where :id
is the carnet_id
of the carnê.
Use cases for this endpoint:
Integrator changed the server IP that was associated in the notification URL of the carnês;
Integrator has updated the notification URL for new issues that are created (
createCarnet
), but needs to update also on previous transactions (updateCarnetMetadata
) that were generated and that are associated with the incorrect/outdated URL;SSL (https) was installed on the client's server and even if the client defines a 301 or 302 redirection rule, it will be necessary to define the new URL in the books that have the "old" URL;
Integrator generated charges and had not informed the notification URL when sending the request to create the booklets;
Modify or add information in the
custom_id
attribute associated with previously generated carnês;Among other possible scenarios.
If you want, you can explore and learn more about this resource using our Playground.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
a) Hierarchical structure of Schema attributes that can be used:
To more details, click here and explore it in our Playground.
b) Attributes that can be used to update notification URL and/or custom_id:
Attribute | Description | Required | Type |
---|---|---|---|
notification_url | Address of your valid URL that will receive notifications of changes in the status of the carnê and its parcels. Minimum of 1 character and maximum of 255. | No | String/null |
custom_id | Allows you to associate a Gerencianet carnê with a specific ID of your system or application, allowing you to identify it if you have a specific identification and want to keep it. Minimum of 1 character and maximum of 255. | No | String |
3) Change the payment due date
Allows you to change the due date of a certain installment of a carnê. Only installments that are in waiting
or unpaid
status can have their due dates changed.
To do so, you need to inform the carnet_id
, the installment you want to change and the expire_at
(new expiration date, in YYYY-MM-DD format).
To change the due date of a specific installment of a carnê, you must send a PUT
request to the route /v1/carnet/:id/parcel/:parcel
, where :id
is the carnet_id
of the carnê and :parcel
is the number of the installment for which you want to update the due date (for example: 3
- if it is the third installment that you want to change the due date).
If you want, you can explore and learn more about this resource using our Playground.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
a) Hierarchical structure of Schema attributes that can be used:
To more details, click here and explore it in our Playground.
b) Attributes that can be used to change the due date of the carnê installment:
Attribute | Description | Required | Type |
---|---|---|---|
expire_at | Due date of the specified installment of the carnê. The interval between the installments of a booklet is always 1 (one) month between them.Format: YYYY-MM-DD | Yes | String |
4) Cancel a carnê
Allows you to cancel a specific carnê. For this, you must inform the carnet_id
that you want to cancel.
To cancel a certain carnê, you must send a PUT
request to the route /v1/carnet/:id/cancel
, where :id
is the carnet_id
of the carnê
If you want, you can explore and learn more about this resource using our Playground.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
5) Cancel specific installment of a carnê
Allows you to cancel a specific portion of an existing carnê. To do so, you must inform the carnet_id
and the number of the parcel you wish to cancel.
To cancel a specific installment of a carnê, you must send a PUT
request to the route /v1/carnet/:id/parcel/:parcel/cancel
, where :id
is the carnet_id
of the carnê and :parcel
is the number of the installment you want to cancel (for example: 3
- if it is the third installment that you want to cancel).
If you want, you can explore and learn more about this resource using our Playground.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
6) Resend carnê by email
It is possible that the carnê will be resent to a valid email address.
To resend a carnê by email, you must send a POST
request to the route /v1/carnet/:id/resend
, where :id
is the carnet_id
of the carnê you want to resend.
If you want, you can explore and learn more about this resource using our Playground.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
a) Hierarchical structure of Schema attributes that can be used:
To more details, click here and explore it in our Playground.
b) Attribute that can be used to resend carnê by email:
Attribute | Description | Required | Type |
---|---|---|---|
email | Please provide a valid email address to which the carnê should be sent. | Yes | String |
7) Resend specific installment of a carnê by email
It is possible that a specific installment of a carnê will be resent to a valid email address. To do so, you must enter the carnet_id
.
To resend the parcel, it must have the status waiting
.
To resend a specific parcel of a carnê by email, you must send a POST
request to the route /v1/carnet/:id/parcel/:parcel/resend
, where :id
is the carnet_id
of the carnê and :parcel
is the parcel number you want to resend by email (for example: 3
- if it is the third installment you want to resend by email).
If you want, you can explore and learn more about this resource using our Playground.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
a) Hierarchical structure of Schema attributes that can be used:
To more details, click here and explore it in our Playground.
b) Attributes that can be used to resend carnê installments by e-mail:
Attibute | Description | Required | Type |
---|---|---|---|
email | Please provide a valid email address to which the carnê should be sent . | Yes | String |
8) Add information to the carnê's history
The history of a carnê is similar to the history of a transaction. However, it reflects the actions that the carnê itself suffered. And, in the same way, it is possible to add personalized messages to the history of a carnê, without influencing in the flow of it.
To add custom messages to a carnê's history, you must send a POST
request to the /v1/carnet/:id/history
route, where :id
is the carnet_id
of the dcarnê.
If you want, you can explore and learn more about this resource using our Playground.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
a) Hierarchical structure of Schema attributes that can be used:
To more details, click here and explore it in our Playground.
Attributes that can be used to add messages to the carnê's history:
Attribute | Description | Required | Type |
---|---|---|---|
description | Pallows adding information to the carnê's history without influencing its flow. Minimum of 1 character and maximum of 255 characters . | Yes | String |
9. Mark as paid a certain installment of a carnê
For details on how to mark as paid a certain installment of carnê, see this link .