Paying with Juridical Person

The customer associated with the transaction can be a Juridical Person. In this case, the Company's Corporate Name and CNPJ must be informed.

For Juridical Person, in the case of issuance of slips, it will not be mandatory to send name and CPF, only the other customer data. However, if you want to send your name and CPF, they will be useful to identify the person who is making the payment on behalf of the company. Otherwise, you can omit the cpf attribute in the customer array and proceed with providing the cnpj.

The rest of this page has the detailed procedures, but you need to install one of our libraries on your server to run the sample code. Make sure that the Gerencianet SDK has been installed.

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

<?php
require __DIR__.'/../../vendor/autoload.php'; // SDK-related path
use Gerencianet\Exception\GerencianetException;
use Gerencianet\Gerencianet;
$clientId = 'informe_seu_client_id'; // enter your Client_Id, depending on the environment (Des or Prod)
$clientSecret = 'informe_seu_client_secret'; // enter your Client_Secret, depending on the environment (Des or Prod)
$options = [
'client_id' => $clientId,
'client_secret' => $clientSecret,
'sandbox' => true // change according to the environment (true = development and false = production)
];
// $charge_id refers to the transaction ID ("charge_id")
$params = [
'id' => $charge_id
];
$juridical_data = [
'corporate_name' => 'Nome da Empresa', // name of company name
'cnpj' => '99794567000144' // CNPJ of the company, with 14 characters
];
$customer = [
'name' => 'Gorbadoc Oldbuck', // client name
'cpf' => '94271564656', // client cpf [optional]
'phone_number' => '5144916523', // customer phone
'juridical_person' => $juridical_data
];
$banking_billet = [
'expire_at' => '2017-12-20',
'customer' => $customer
];
$payment = [
'banking_billet' => $banking_billet
];
$body = [
'payment' => $payment
];
try {
$api = new Gerencianet($options);
$charge = $api->payCharge($params, $body);
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());
}


a) Hierarchical structure of Schema attributes that can be used:

"juridical_person"
"corporate_name"
"cnpj"


b) Attributes to be sent (legal entity data):

AttributeDescriptionRequiredType
corporate_nameCompany nameYesString
cnpjCNPJ of the company. Size: 14 characters.YesString