PHPackages                             amyr-it/siat-bolivia-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. amyr-it/siat-bolivia-client

ActiveLibrary[API Development](/categories/api)

amyr-it/siat-bolivia-client
===========================

Biblioteca de cliente PHP para la integración con el servicio de facturación SIAT de Impuestos Nacionales de Bolivia.

1.0.0(6mo ago)02MITPHPPHP ^8.1

Since Oct 27Pushed 6mo agoCompare

[ Source](https://github.com/arcquars/amyrit-in)[ Packagist](https://packagist.org/packages/amyr-it/siat-bolivia-client)[ RSS](/packages/amyr-it-siat-bolivia-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

SIAT Bolivia Client

A modern, framework-agnostic PHP 8.1+ client for Bolivia's SIAT (Servicio de Impuestos Nacionales) SOAP services. This library provides a clean, object-oriented interface, abstracting the complexity of SoapClient and mapping all requests and responses to strongly-typed Data Transfer Objects (DTOs).

Features

Modern PHP: Built for PHP 8.1+ with strict types and modern syntax.

Framework Agnostic: Can be used in any PHP project.

Laravel Integration: Includes an optional Service Provider and Facade for seamless Laravel integration.

Strongly-Typed DTOs: All SOAP requests and responses are mapped to DTOs. No more dealing with stdClass or complex arrays.

Clean Interface: A simple client provides access to all SIAT services (Invoicing, Synchronization, Operations, etc.).

Exception Handling: Wraps SoapFault exceptions into a custom SiatException for cleaner error handling.

Installation

composer require amyr-it/siat-bolivia-client

Documentation

1. Configuration (DTO-based)

All client services are configured using a single SiatConfig object. This makes configuration explicit and easy to manage.

use Amyrit\\SiatBoliviaClient\\SiatConfig;

$config = new SiatConfig( codigoSistema: 'YOUR\_SYSTEM\_CODE', nit: 123456789, apiKey: 'YOUR\_API\_KEY', modalidad: SiatConfig::MODALIDAD\_ELECTRONICA\_EN\_LINEA, ambiente: SiatConfig::AMBIENTE\_PRUEBAS, // These credentials are obtained from other SIAT services cuis: 'YOUR\_CUIS', cufd: 'YOUR\_CUFD', // ... other optional params );

2. Framework-Agnostic Usage

You can instantiate the main client directly in any PHP application.

use Amyrit\\SiatBoliviaClient\\SiatClient; use Amyrit\\SiatBoliviaClient\\Data\\Requests\\SolicitudRecepcionFactura; use Amyrit\\SiatBoliviaClient\\SiatConfig;

// 1. Create Config $config = new SiatConfig(/\* ... \*/);

// 2. Create Client $client = new SiatClient($config);

// 3. Create your request DTO $facturaRequest = new SolicitudRecepcionFactura( codigoDocumentoSector: 1, // ... other invoice data );

try { // 4. Access a service and call a method $response = $client-&gt;facturacion()-&gt;recepcionFactura($facturaRequest);

```
// $response is a strongly-typed DTO!
echo "Success: " . $response->codigoDescripcion;
echo "Transaction ID: " . $response->transaccion;

```

} catch (\\Amyrit\\SiatBoliviaClient\\Exceptions\\SiatException $e) { // Handle specific SIAT errors echo "SOAP Error: " . $e-&gt;getMessage(); }

3. Laravel Usage

This package provides a Service Provider and Facade for easy integration.

1. Publish Configuration (Optional):

php artisan vendor:publish --provider="Amyrit\\SiatBoliviaClient\\Laravel\\SiatServiceProvider"

This will create a config/siat.php file. Fill in your credentials, preferably from .env.

2. Use the Facade:

The Service Provider automatically configures the SiatClient and injects it into the container. You can use the Siat facade anywhere in your app.

use Amyrit\\SiatBoliviaClient\\Laravel\\SiatFacade as Siat; use Amyrit\\SiatBoliviaClient\\Data\\Requests\\SolicitudRecepcionFactura;

// The Facade resolves the client from the container $response = Siat::facturacion()-&gt;recepcionFactura(new SolicitudRecepcionFactura(/\* ... \*/));

echo $response-&gt;codigoDescripcion;

Note on Authentication (Sanctum)

You mentioned Sanctum. It's important to understand the two authentication layers:

SOAP Authentication (This Library): This library handles authentication with the SIAT SOAP services using your apiKey, CUIS, and CUFD.

Your API Authentication (Sanctum): You are building a REST API that consumes this library. Sanctum is the correct tool to protect your new API endpoints.

Example (Laravel Controller):

This is how you would use Sanctum to protect your endpoint, which in turn uses this library.

// app/Http/Controllers/Api/InvoiceController.php

namespace App\\Http\\Controllers\\Api;

use App\\Http\\Controllers\\Controller; use Illuminate\\Http\\Request; use Amyrit\\SiatBoliviaClient\\Laravel\\SiatFacade as Siat; use Amyrit\\SiatBoliviaClient\\Data\\Requests\\SolicitudRecepcionFactura;

class InvoiceController extends Controller { /\*\*

- Create a new invoice.
- This route should be protected by Sanctum middleware. \*/ public function createInvoice(Request $request) { // 1. Validate $request data from your user $validatedData = $request-&gt;validate(\[ 'customerName' =&gt; 'required|string', 'items' =&gt; 'required|array', // ... \]);

    ```
      // 2. Map your validated data to the SIAT Request DTO
      $facturaRequest = new SolicitudRecepcionFactura(
          codigoDocumentoSector: 1,
          // ... map $validatedData
      );

      // 3. Call the SIAT service using this library
      try {
          $response = Siat::facturacion()->recepcionFactura($facturaRequest);

          // 4. Return a JSON response to your API consumer
          if ($response->transaccion) {
              return response()->json(['success' => true, 'message' => $response->codigoDescripcion]);
          } else {
              return response()->json(['success' => false, 'message' => $response->codigoDescripcion], 400);
          }

      } catch (\Amyrit\SiatBoliviaClient\Exceptions\SiatException $e) {
          return response()->json(['success' => false, 'message' => $e->getMessage()], 500);
      }

    ```

    } }

// routes/api.php

use App\\Http\\Controllers\\Api\\InvoiceController;

// This route is protected by Sanctum Route::middleware('auth:sanctum')-&gt;group(function () { Route::post('/invoices', \[InvoiceController::class, 'createInvoice'\]); });

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance66

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

198d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/10423a31665525f4cbc6df6e27562e7d9b8357355d18ccb92c3b209582a32b73?d=identicon)[Arcquars](/maintainers/Arcquars)

---

Top Contributors

[![arcquars](https://avatars.githubusercontent.com/u/961870?v=4)](https://github.com/arcquars "arcquars (2 commits)")

### Embed Badge

![Health badge](/badges/amyr-it-siat-bolivia-client/health.svg)

```
[![Health](https://phpackages.com/badges/amyr-it-siat-bolivia-client/health.svg)](https://phpackages.com/packages/amyr-it-siat-bolivia-client)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
