Others endpoints
There are another endpoints (services) available in the API that can be used in subscriptions:
Before proceeding, make sure that the Gerencianet SDK has been installed
The rest of this page provides detailed procedures, but you need to install one of our libraries on your server to run the sample code.
1. List existing subscription plans
Allows you to list the subscription plans created. There are advanced filters that can be used to find, such as:
Name
: returns results from the search for the name of the previously registered plan;Limit
: maximum limit of response records;Offset
: determines from which register the search will be performed.
To return information demonstrating the subscription plans already created, you must send a GET
request to the /v1/plans
route.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
2. Cancel subscription plan
Allows you to cancel a subscription plan. To do so, you must enter the plan_id
of the subscription plan you wish to cancel.
To cancel a subscription plan, you must send a DELETE
request to the /v1/plan/:id
route, where :id
is the plan_id
of the plan you want to cancel.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
3. Return subscription information linked to a plan
Allows you to search for information about a subscription that is linked to a plan. To do so, you must inform the subscription_id
of the subscription you want to search for.
To return information from a subscription linked to a plan, you must send a GET
request to the /v1/subscription/:id
route, where :id
is the subscription_id
of the subscription.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
4. Cancel active subscriptions on a plan
Allows you to cancel active subscriptions on a plan. To do so, you must inform the subscription_id
of the subscription you want to cancel.
To cancel active subscriptions in a subscription plan, you must send a PUT
request to the /v1/subscription/:id/cancel
route, where :id
is the subscription_id
of the subscription.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
5.Change notification URL (notification_url) and/or custom_id of subscriptions
You can set or change the information sent in the metadata
property of a subscription at any time. This endpoint is extremely important for updating your notification URL tied to subscriptions or modifying the custom_id
previously associated with the subscription.
In this case, all transactions belonging to the subscription will be updated.
To change the notification_url
and/or custom_id
of a subscription, you must send a PUT
request to the /v1/subscription/ route :id/metadata
, where :id
is the subscription_id
of the transaction.
Use cases for this endpoint :
Integrator changed the server IP that was associated in the subscription/transactions notification URL;
Integrator has updated the notification URL for new subscriptions/transactions that are created, but also needs to update on previous subscriptions/transactions 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 subscriptions/transactions that have the "old" URL;
Integrator generated charges and had not informed the notification URL when sending the subscription/transaction creation request;
Modify or add information next to the
custom_id
attribute associated with previously generated subscriptions/transactions;Among other possible scenarios.
If you want, you can explore and learn more about this feature 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:
For 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 transaction status change notifications. Maximum 255 characters | No | String/null |
custom_id | Allows you to associate a Gerencianet transaction with a specific ID of your system or application, allowing you to identify it if you have a specific ID and want to keep it. Maximum of 255 characters | No | String |
6. List installments, according to the credit card brand
The installments
endpoint is used to list the installments of each credit card brand, with the interest values and number of installments calculated according to the integrating account. That is, if your account has a card interest setting (option available for customers who have chosen to receive card amounts in installments), it is not necessary to make any calculations, this endpoint already informs the calculated amounts.
Available brands: visa
, mastercard
, amex
, elo
and hipercard
.
The example below shows how this can be done, using the SDK's available:
- PHP
- Python
- NodeJS
- .NET
- Java
- GO
- Ruby
- Delphi
7. Add information to subscription history
The history of a subscription is similar to the history of a transaction. However, it reflects the actions that the signature suffered. And, in the same way, it is possible to add personalized messages to the history of a subscription, without influencing in the flow of the same.
To add custom messages to the history of a subscription, you must send a POST
request to the route /v1/subscription/:id/history
, where :id
is the subscription_id
of the subscription.
If you want, you can explore and learn more about this feature 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 add messages to the subscription history:
Attribute | Description | Required | Type |
---|---|---|---|
description | Allows you to add information to the subscription history without influencing its flow. Minimum of 1 character and maximum of 255 characters (String). | Yes | String |
8. Edit subscription plan name
Allows you to change (edit) the name of a pre-existing subscription plan. For this, the plan identifier plan_id
must be provided.
To do so, you must send a PUT
request to the /v1/plan/:id
route, where :id
is the plan_id
of the plan.
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 edit the name of a pre-existing subscription plan:
Attribute | Description | Required | Type |
---|---|---|---|
name | Allows you to change (edit) the name of a pre-existing subscription plan. Minimum of 1 character and maximum of 255 characters (String). | Yes | String |