Download the PHP package flavytech/laravel-etims without Composer

On this page you can find all versions of the php package flavytech/laravel-etims. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-etims

🇰🇪 Laravel eTIMS SDK

Latest Version PHP Version Laravel Version Tests

Production-grade Laravel SDK for Kenya's KRA eTIMS / Gava Connect API. Built for POS systems, ERP platforms, and SaaS products operating in Kenya and East Africa.


Why This SDK?

Integrating with KRA eTIMS is non-trivial in real production environments:

This SDK handles all of that so you can focus on your product.


Features

Feature Status
Invoice submission (sync + async) ✅ Phase 1
Auth token management + auto-refresh ✅ Phase 1
Exponential backoff retry ✅ Phase 1
Idempotency protection ✅ Phase 1
Audit trail (DB) ✅ Phase 1
Laravel event system integration ✅ Phase 1
Sandbox/production mode switching ✅ Phase 1
Testing fake + assertion API ✅ Phase 1
KRA PIN validation ✅ Phase 1
Dead letter queue + failed invoice recovery ✅ Phase 1
Multi-tenant SaaS support ✅ Phase 1
Stock synchronization 🔜 Phase 2
Credit/debit note handling 🔜 Phase 2
Webhook handling 🔜 Phase 2
QR code + thermal receipt support 🔜 Phase 3
Branch management 🔜 Phase 3

Installation

Publish the configuration and migrations:


Configuration

Add these variables to your .env file:

Never commit real credentials to version control. Use .env only.


Quick Start

Submitting an Invoice Synchronously

Use this when you need an immediate KRA response (e.g. a POS checkout flow):

InvoiceDTO::make() accepts both the original snake_case keys and the KRA field names shown above.

Queuing an Invoice (Recommended for Most Cases)

This is the preferred approach for production. The invoice is dispatched to a durable background job with automatic retries:

Listen to the outcome events in your EventServiceProvider:

Validating a KRA PIN

Checking Invoice Status

Working with Failed Invoices


Invoice Types

Code Description Use Case
S Sale Standard sales invoice
R Credit Note Refund / reversal of a sale
D Debit Note Additional charge on a sale

Tax Type Codes

Code Description VAT Rate
A Standard rated 16%
B Zero rated 0%
C VAT exempt N/A
D Non-VATable N/A
E Excisable (with VAT) 16% + Excise

Payment Type Codes

Code Description
CASH Cash payment
CREDIT Credit terms
MPESA M-Pesa mobile money
BANK Bank transfer
CHEQUE Cheque
OTHER Other payment methods

Multi-Tenant SaaS Setup

When serving multiple KRA-registered businesses from one Laravel installation:

Step 1: Enable multi-tenancy in config:

Step 2: Implement the TenantResolverContract:

Step 3: Bind it in your AppServiceProvider:

That's it. Every SDK call now automatically uses the correct credentials for the active tenant.


Testing

The SDK provides a first-class fake for testing without any real HTTP calls.

Stubbing Specific Responses


Running the SDK Test Suite


Queue Worker Setup

Run a dedicated worker for the eTIMS queue in production:

For failed job monitoring:


Architecture Overview


Error Handling Reference

Exception Cause Retryable
EtimsApiException KRA API error or network failure Depends on HTTP status
EtimsAuthException Invalid credentials or expired token No — fix credentials
EtimsValidationException Invalid DTO data (client-side) No — fix data
EtimsIdempotencyException Duplicate invoice detected No — already submitted
EtimsConfigException Missing or invalid SDK config No — fix config

Changelog

See CHANGELOG.md.

Contributing

Contributions welcome. Please read CONTRIBUTING.md first.

License

MIT. See LICENSE.


Built with care for the Kenyan and East African developer ecosystem. 🇰🇪


All versions of laravel-etims with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/queue Version ^10.0|^11.0|^12.0|^13.0
illuminate/events Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
guzzlehttp/guzzle Version ^7.8
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package flavytech/laravel-etims contains the following files

Loading the files please wait ...