A Laravel package to easily use the ARCA (ex AFIP) web services.
agustinzamar/laravel-arca-sdk is a Laravel package for a laravel package to easily use the arca (ex afip) web services..
It currently has 7 GitHub stars and 423 downloads on Packagist (latest version v0.1.0).
Install it with composer require agustinzamar/laravel-arca-sdk.
Discover more Laravel packages by agustinzamar
or browse all Laravel packages to compare alternatives.
Last updated
This package makes it easy to use the ARCA (ex AFIP) web services in your Laravel application.
⚠️ Do not use this package yet, it is still under development.
You can install the package via composer:
composer require agustinzamar/laravel-arca-sdk
You can publish the config file with:
php artisan vendor:publish --tag="arca-sdk-config"
Optionally, you can publish the views using
php artisan vendor:publish --tag="arca-sdk-views"
To Start using the ARCA Web Services you need to register a certificate on their system.
openssl genrsa -out arca.key 2048
3. Run
openssl req -new -key arca.key -subj "/C=AR/O=YourName/CN=AppName/serialNumber=CUIT XXXXXXXXXXX" -out arca.csrarca.key, arca.csr, and arca.crt in storage/app/arca/You can use the package by using the Arca facade. Here is an example of how to use it:
Arca::getInvoiceTypes()
Arca::getRecipientVatConditions();
$pointOfSale = 1; // Your point of sale number
Arca::getLastInvoiceNumber($pointOfSale, InvoiceType::FACTURA_A);
$pointOfSale = 1; // Your point of sale number
$invoiceNumber = 123; // Invoice number to query
Arca::getInvoiceDetails($pointOfSale, InvoiceType::FACTURA_C, $invoiceNumber);
$pointOfSale = 1; // Your point of sale number
$nextInvoiceNumber = Arca::getLastInvoiceNumber($pointOfSale, InvoiceType::FACTURA_C);
$request = new CreateInvoiceRequest(
concept: InvoiceConcept::GOODS,
pointOfSale: $pointOfSale,
identification: new Identification(
type: IdentificationType::CUIT,
number: 20111111112
),
invoiceType: InvoiceType::FACTURA_C,
invoiceFrom: $nextInvoiceNumber,
invoiceTo: $nextInvoiceNumber,
total: 150.0,
net: 150.0,
exempt: 0.0,
nonTaxableConceptsAmount: 0.0,
vatCondition: 1,
currency: Currency::ARS,
currencyQuote: 1.0,
invoiceDate: now()->addDays(3),
);
Arca::generateInvoice($request);
// Or automatically generate next invoice
$request = new CreateInvoiceRequest(
concept: InvoiceConcept::GOODS,
pointOfSale: 12,
identification: new Identification(
type: IdentificationType::CUIT,
number: 20111111112
),
invoiceType: InvoiceType::FACTURA_C,
total: 150.0,
net: 150.0,
exempt: 0.0,
nonTaxableConceptsAmount: 0.0,
vatCondition: 1,
currency: Currency::ARS,
currencyQuote: 1.0,
invoiceDate: now()->addDays(3),
);
Arca::generateNextInvoice($request);
The package also offers a set of convenient Enums for commonly used values:
InvoiceType: Represents the different types of invoices (e.g., FACTURA_A, FACTURA_B, etc.).InvoiceConcept: Represents the concept of the invoice (e.g., GOODS, SERVICES, etc.).IdentificationType: Represents the type of identification (e.g., CUIT, CUIL, etc.).Currency: Represents the currency type (e.g., ARS, USD, etc.).RecipientVatCondition: Represents the VAT condition of the recipient (e.g., RESPONSABLE_INSCRIPTO, MONOTRIBUTISTA,
etc.).composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please report any security vulnerabilities to [email protected]
The MIT License (MIT). Please see License File for more information.