PHP code example of rbbsoft / arca-sdk

1. Go to this page and download the library: Download rbbsoft/arca-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/ */

    

rbbsoft / arca-sdk example snippets


use Rbbsoft\ArcaSdk\ArcaSdk;
use Rbbsoft\ArcaSdk\Config\Config;

$config = Config::fromArray([
    'env'         => 'homo',
    'cuit'        => '<CUIT_EMISOR>',
    'punto_venta' => 1,
    'cert_path'   => 'C:\xampp\Certificados\MiCertificado.pem',
    'key_path'    => 'C:\xampp\Certificados\MiClavePrivada.key',
    'db_dsn'      => 'mysql:host=127.0.0.1;dbname=arca_facturador;charset=utf8mb4',
    'db_user'     => 'arca_user',
    'db_pass'     => '...',
]);

$arca = ArcaSdk::getInstance($config);

$respuesta = $arca->emitirFactura('a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d', [
    'concepto'                 => 1,
    'receptor_documento_tipo'  => 80,
    'receptor_documento_nro'   => '<CUIT_RECEPTOR>',
    'receptor_condicion_iva'   => 'RI',
    'mon_id'                   => 'PES',
    'mon_cotiz'                => '1.00',
    'items' => [
        ['importe_gravado' => '1000000.00', 'alicuota_iva' => '21'],
    ],
]);

echo $respuesta->cae;
bash
php examples/regenerar_pdf_plantilla.php
bash
# Suite automatizada
composer install
.\vendor\bin\phpunit --testdox

# Emisión real de un comprobante contra ARCA homologación
# (requiere .env configurado y certificados en el path declarado)
php examples/factura_a_basica.php 0 1 0