Settle

Sometimes, some customers end up paying charges in other ways, such as a cash payment or a bank deposit.

In the Gerencianet account, it is only possible to manually confirm the issues that were made by boletos or carnês. Charges made through payment links, even if the payment is made by bolelto, cannot be manually confirmed.

IMPORTANT

In a transaction marked as paid, no payment amount is returned via the API. Discounts, fines and late payments will not be automatically applied.


Learn about the two ways to manually confirm the payment of a charge on Gerencianet:


1) Through the Gerencianet panel:

  • Log in your Gerencianet account;
  • Access Cobranças > Gerenciar Cobranças;

  • Select Boletos or Carnês;

  • Choose the charge you want to confirm. If the charge is a carnê, select the installment;

  • Click in the Marcar como pago button and then, Confirmar.

This operation does not charge fees.

NOTE

It is not possible to manually confirm payment for canceled charges.


2) By request via API:

Only transactions with status waiting or unpaid can be confirmed manually. There are two endpoints responsible for manual payment confirmations:

  • settleCharge : allows you to mark as paid (manually paid) a certain transaction;
  • settleCarnetParcel : allows you to mark as paid (manually paid) a certain installment of a carnê.
NOTE
  • Automatic confirmation: is the default mechanism offered by the API via the Notification URL. That is, we send a POST request to your notification URL as soon as there is a change in the status of the transaction, your system receives this information and carries out what to do next. In other words, the paid status will be in the notification we send. In this case, the transaction status will be paid.

  • Manual confirmation: represented by the settleCharge and settleCarnetParcel endpoints. This is when the payment was made using alternative payment methods (ex: cash payment) and the integrator manually confirmed it through the Gerencianet panel, via API request or through its own management system. In this case, the transaction status will be settled.


2.1) Mark a transaction as paid

Allows you to mark as paid (manually paid) a certain transaction.

To mark a transaction as paid (manually paid), you must send a PUT request to the /v1/charge/:id/settle route, where :id is the charge_id of the transaction.

CAUTION

Transactions marked as paid do not generate financial transaction in a Gerencianet account, since the cash flow does not happens under the control of Gerencianet.


The example below shows how this can be done, using the SDK's available:

<?php
require __DIR__.'/../../vendor/autoload.php'; // caminho relacionado a SDK
use Gerencianet\Exception\GerencianetException;
use Gerencianet\Gerencianet;
$clientId = 'informe_seu_client_id'; // insira seu Client_Id, conforme o ambiente (Des ou Prod)
$clientSecret = 'informe_seu_client_secret'; // insira seu Client_Secret, conforme o ambiente (Des ou Prod)
$options = [
'client_id' => $clientId,
'client_secret' => $clientSecret,
'sandbox' => true // altere conforme o ambiente (true = desenvolvimento e false = producao)
];
// $charge_id refere-se ao ID da transação (charge_id) desejado
$params = [
'id' => $charge_id
];
try {
$api = new Gerencianet($options);
$charge = $api->settleCharge($params, []);
print_r($charge);
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
print_r($e->errorDescription);
} catch (Exception $e) {
print_r($e->getMessage());
}

2.2) Mark as paid a certain installment of a carnê

Allows you to mark as paid (manually paid) a certain installment of a carnê. To do so, you must inform the carnet_id and the installment number of the carnê you wish to mark as paid.

To mark a carnê installment as paid (manually paid), you must send a PUT request to the /v1/carnet/:id/parcel/:parcel/settle route , where :id is the desired carnet_id and :parcel is the installment number you want to confirm the payment manually.

That is, if you have a carnet of 12 installments whose carnet_id is 24744 and you want to mark the 2nd installment as "paid", you must pass the carnet_id and the number 2.

The example below shows how this can be done, using the SDK's available:

<?php
require __DIR__.'/../../vendor/autoload.php'; // caminho relacionado a SDK
use Gerencianet\Exception\GerencianetException;
use Gerencianet\Gerencianet;
$clientId = 'informe_seu_client_id'; // insira seu Client_Id, conforme o ambiente (Des ou Prod)
$clientSecret = 'informe_seu_client_secret'; // insira seu Client_Secret, conforme o ambiente (Des ou Prod)
$options = [
'client_id' => $clientId,
'client_secret' => $clientSecret,
'sandbox' => true // altere conforme o ambiente (true = desenvolvimento e false = producao)
];
// $carnet_id refere-se ao ID do carnê desejado e parcel indica o número da parcela desejada
$params = ['id' => $carnet_id, 'parcel' => 1];
try {
$api = new Gerencianet($options);
$response = $api->settleCarnetParcel($params, []);
print_r($response);
} catch (GerencianetException $e) {
print_r($e->code);
print_r($e->error);
print_r($e->errorDescription);
} catch (Exception $e) {
print_r($e->getMessage());
}