1. Go to this page and download the library: Download nexo-do/aura-ecf-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nexo-do / aura-ecf-sdk example snippets
Aura\Ecf\Client;
$aura = new Client('aura_test_...'); // o aura_live_... para producción
// Default (Cloud): https://aura.nexo.com.do/api/v1
// new Client('aura_...', ['baseUrl' => 'http://localhost:3001/v1']); // self-hosted
// 1) Emitir un e-CF (202 — se procesa async)
$result = $aura->vouchers->issue([
'clientId' => '00000000-0000-0000-0000-000000000000',
'typeId' => '31',
'counterpart' => ['rnc' => '131234567', 'legalName' => 'Cliente Demo SRL'],
'paymentType' => 1,
'items' => [
['description' => 'Servicio', 'quantity' => 1, 'unitPrice' => 10000, 'itbisRate' => 18],
],
], idempotencyKey: bin2hex(random_bytes(16))); // evita doble consumo de NCF en reintentos
echo "{$result['id']} {$result['ncf']} {$result['status']}\n";
// 2) Consultar el estado final (o usa webhooks)
$voucher = $aura->vouchers->retrieve($result['id']);
echo "{$voucher['status']} {$voucher['qrUrl']} {$voucher['securityCode']}\n";