Simple Laravel SDK for KRA (GavaConnect) APIs

Installs: 6

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/gavabridge/kra

1.0.8 2025-08-21 15:44 UTC

This package is not auto-updated.

Last update: 2025-12-25 17:35:57 UTC


README

A simple, clean, and developer-friendly Laravel SDK that bridges your Laravel app with Kenya Revenue Authority (KRA) APIs via GavaConnect.
It simplifies authentication, token caching, and request handling, letting you focus on building your product.

Features

  • 🔑 Automatic OAuth2 (client credentials) token management
  • 📡 Easy access to common KRA endpoints:
    • PIN validation
    • TCC validation
    • Taxpayer obligations & liabilities
    • Excise license check
    • NIL return filing
  • 🧩 Extendable: add more endpoints in minutes
  • âš¡ Built for Laravel 10+ / 11

Installation

  1. Require the package:

    composer require gavabridge/kra
  2. Publish the config:

    php artisan vendor:publish --tag=gavabridge-config
  3. Add credentials in .env:

    KRA_ENV=sandbox
    KRA_CONSUMER_KEY=your_consumer_key
    KRA_CONSUMER_SECRET=your_consumer_secret

Usage

You can access all endpoints via the GavaBridge facade:

use GavaBridge\Kra\Facades\Kra;

// PIN validation
$result = Kra::pin()->validateByPin('A000000010');

// TCC validation
$check = Kra::tcc()->validate('A000000010', 'TCC-12345678');

// Obligations
$obls = Kra::taxpayer()->obligations('A000000010');

// Liabilities
$libs = Kra::taxpayer()->liabilities('A000000010');

// Excise license
$lic = Kra::excise()->checkByNumber('EXC-0001234');

// NIL return (payload from portal spec)
$resp = Kra::returns()->fileNil([
     "TAXPAYERDETAILS" => [
        "TaxpayerPIN" => "A000000000L",
        "ObligationCode" => "4",
        "Month" => "04",
        "Year" => "2000"
     ]
    /* ... other fields per API spec ... */
]);

Roadmap

  • Add Import Certificate Checker
  • Add Excise License by PIN
  • Add E-Slip Checker
  • Add eTIMS (OSCU/VSCU) support

License

MIT © 2025 – ASAD ALI SIDOW