Getting Started: ProTax API and KRA eTIMS
ProTax API Hub contains guides and API reference pages for further understanding, equipping you on how to integrate with the KRA eTIMS System.
New here? Learn how to navigate our pages.
Understand how ProTax connects your system to KRA eTIMS effortlessly.
Interactive API endpoints — get your X-API-Key and start testing now.
Electronic Tax Invoicing in Kenya
African countries are rapidly digitising tax systems by adopting electronic tax invoicing and reporting. Kenya's tax authority, KRA (Kenya Revenue Authority), operates eTIMS — electronic Tax Information Management System — which became mandatory on 1 January 2024 under the Finance Act, 2023.
Introduction to KRA eTIMS & ProTax
What is KRA eTIMS?
eTIMS is KRA's transformative e-invoicing platform. Every sale made by a registered taxpayer must be reported to eTIMS in real-time for digital signing and fiscal stamping before a tax invoice can be issued.
What is ProTax?
ProTax is a licensed eTIMS OSCU integrator — a suite of solutions enabling taxpayers to generate, digitally sign, and transmit compliant invoices directly to KRA eTIMS without manual platform-hopping.
More about ProTax
- ProTax App — Compatible with Android and Android POS devices
- ProTax Dashboard — Responsive web-browser desktop application
- ProTax API — System-to-system integration, fully automated
- ProTax Plugins — Quickbooks, Sage Online, WooCommerce, Odoo, and more
API Feature Highlights
We invite you to use the ProTax API to integrate your system with eTIMS — for automation and elimination of platform-hopping.
ProTax and eTIMS — How it Works
OSCU — Online Sales Control Unit. ProTax is licenced as an eTIMS OSCU integrator. Every invoice is transmitted in real-time to KRA's eTIMS server for digital signing and metadata stamping before delivery to the buyer.
The ProTax team has also developed Offline URLs, Callback URLs, and other resilience features providing VSCU-like reliability without a local device.
🥇 ProTax is a leading KRA & ODPC-approved eTIMS integrator.
✅ ProTax is built with the best industry practices and to the highest security standards.
How to use this site
A quick guide to navigating the ProTax API Hub — understanding sections and finding what you need fast.
Site Structure
- Guides — Conceptual explanations, how-tos, references, and FAQs (you are here)
- API Reference — Interactive endpoint documentation with live Try-It functionality
- Changelog — Version history, breaking changes, and new features
Sidebar Navigation
The left sidebar organises all content by category. Click any link to navigate instantly — no page reload needed.
Documentation
Getting started and site navigation pages — ideal for first-time visitors.
How-To
Step-by-step task guides: create your first eTIMS invoice, authenticate with the API, and configure your environment.
Reference
Detailed attribute tables, classification codes, error codes, and data schemas for building accurate API requests.
Features
Deep-dives on ProTax-specific capabilities: Callback URLs, Offline URLs, Reverse Invoicing, and Invoice Verification.
Plugins
Configuration guides for ProTax plugins: Quickbooks, Sage Online, WooCommerce, and Odoo.
Getting Support
💬 Need help? Visit sandbox.protax.co.ke/support or use the ProTax chat widget on any page.
Create an eTIMS invoice
Learn how to generate a KRA eTIMS-compliant invoice through ProTax — from item setup to signed invoice delivery.
Prerequisites
- A registered KRA PIN and active eTIMS account
- A ProTax account — sign up at sandbox.protax.co.ke
- Your
X-API-Keygenerated from the ProTax Dashboard - At least one Item registered in ProTax with a valid HS Classification code
Step-by-Step: Create an Invoice via the API
- 1
Authenticate
Include your
X-API-Keyin every request header:X-API-Key: your_key_here - 2
Register / verify your items
Items must be pre-registered in ProTax with a valid item class code and unit of measure. See Item attributes.
- 3
POST your invoice
Submit a
POST /invoicesrequest with your customer details, line items, tax breakdown, and invoice metadata. - 4
Receive the signed invoice
ProTax transmits your invoice to KRA eTIMS. On success, you receive a signed invoice with a KRA Control Unit Invoice Number (CUIN) and QR code.
- 5
Deliver to customer
Print or email the signed invoice. The embedded QR code allows buyers to verify authenticity at sandbox.protax.co.ke/verify.
Invoice Types Supported
| Type | Description | Endpoint |
|---|---|---|
| Sales Invoice | Standard B2B or B2C tax invoice | POST /invoices |
| Credit Note | Reversal/adjustment of a previously issued invoice | POST /invoices/credit-note |
| Debit Note | Supplementary charge on a prior invoice | POST /invoices/debit-note |
| Proforma Invoice | Quote/estimate (not fiscally stamped) | POST /invoices/proforma |
🔗 Use Callback URLs to receive real-time webhooks when KRA processes your invoice. See Callback URLs.
Start using the ProTax API
Everything you need to authenticate, make your first request, and go live with the ProTax Kenya API.
Prerequisites
- Active ProTax account at sandbox.protax.co.ke
- KRA-registered PIN with eTIMS onboarding complete
- Generated
X-API-Key(Test or Live) from the ProTax Dashboard
Base URLs
| Environment | Base URL |
|---|---|
| Sandbox / Test | https://sandbox.protax.co.ke/api/v2 |
| Production / Live | https://api.protax.co.ke/v2 |
Authentication
All requests require an X-API-Key header. Keys are environment-specific — your Test key only works against the sandbox URL.
⚠️ Never commit your API key to source control. Store it in environment variables or a secrets manager.
Making Your First Request
curl -X GET \
https://sandbox.protax.co.ke/api/v2/health \
-H "X-API-Key: your_test_key"
Rate Limits
| Plan | Requests / min | Requests / day |
|---|---|---|
| Sandbox | 60 | 5,000 |
| Starter | 120 | 50,000 |
| Business | 300 | Unlimited |
ProTax API Details
Technical overview of the ProTax Kenya API — standards, versioning, error handling, and available endpoints.
API Standards
Endpoint Overview
| Method | Endpoint | Description |
|---|---|---|
| GET | /health | API health check & version |
| POST | /invoices | Submit a new eTIMS invoice |
| GET | /invoices/{id} | Retrieve invoice by ID |
| GET | /invoices | List all invoices (paginated) |
| POST | /invoices/credit-note | Submit a credit note |
| GET | /items | List registered items |
| POST | /items | Register a new item |
| PUT | /items/{id} | Update an item |
| GET | /stock | Get stock balances |
| POST | /stock/adjustment | Submit a stock adjustment |
| GET | /customers | List customers (PIN lookup) |
| POST | /webhooks | Register a callback URL |
Item attributes
All fields required and optional when registering or updating an item in ProTax for eTIMS invoicing.
Required Fields
| Field | Type | Description |
|---|---|---|
item_name | string | Name/description of the item or service |
item_class_code | string | KRA HS classification code (8–10 digits). See Classification Table |
packaging_unit_code | string | Unit of packaging (e.g. BX, BG, NX) |
quantity_unit_code | string | Unit of quantity (e.g. KGS, PCS, NX, HUR) |
tax_type_code | string | VAT type: A=16%, B=8%, C=0%, D=Exempt |
unit_price | decimal | Default selling price (KES, excluding VAT) |
Optional Fields
| Field | Type | Description |
|---|---|---|
barcode | string | Product barcode (EAN-13 or custom) |
origin_country | string | ISO 3166-1 alpha-2 country code of origin |
description | string | Longer item description |
custom_fields | object | Key-value pairs for internal metadata |
💡 Items must be registered in ProTax before they can be referenced in invoice line items. Registration is instant — no KRA approval required for item setup.
Items: Item Classification Table
KRA eTIMS uses the Harmonised System (HS) classification for all goods and services.
⚠️ Using an incorrect HS code may result in invoice rejection by KRA eTIMS. When unsure, consult the FAQ or contact ProTax support.
Common Classification Codes
| HS Code | Category | Description | VAT Rate |
|---|---|---|---|
99111001 | Services – General | Professional / consulting services | 16% |
99111002 | Services – IT | Software, SaaS, and IT services | 16% |
99111003 | Services – Transport | Freight and logistics services | 16% |
99111004 | Services – Finance | Financial services | 16% |
99111005 | Services – Health | Healthcare and medical services | 16% |
99111006 | Services – Education | Education and training | 16% |
99111007 | Services – Marketing | Marketing, advertising, and media | 16% |
99111008 | Services – Construction | Construction and engineering services | 16% |
99111009 | Services – Real Estate | Real estate and property management | 16% |
04011000 | Dairy | Milk and cream (fat ≤ 1%) | 0% |
10011000 | Cereals | Durum wheat | 0% |
30021000 | Pharma | Vaccines for human medicine | Exempt |
84713000 | Electronics | Laptop/portable computers | 16% |
87032100 | Vehicles | Motor cars (1000cc–1500cc) | 16% |
22021000 | Beverages | Waters / mineral waters (sweetened) | 16% |
61051000 | Clothing | Men's shirts (cotton) | 16% |
For the full KRA HS Code list, visit sandbox.protax.co.ke/docs/hs-codes or use our HS code lookup FAQ.
Invoice attributes (Sales / Credit Notes)
All fields for the POST /invoices and POST /invoices/credit-note endpoints.
Invoice Header
| Field | Type | Required | Description |
|---|---|---|---|
invoice_number | string | ✅ | Your internal invoice reference |
invoice_date | ISO 8601 | ✅ | Date of transaction (YYYY-MM-DD) |
customer_pin | string | Optional | Buyer's KRA PIN (B2B — enables input tax credit) |
customer_name | string | ✅ | Buyer's name |
customer_address | string | Optional | Buyer's physical or postal address |
payment_type_code | string | ✅ | 01=Cash, 02=Credit, 03=Cheque, 04=Mobile Money |
sales_type_code | string | ✅ | C=Copy, T=Training (test), N=Normal |
currency_code | string | ✅ | ISO 4217 code — KES for Kenya Shilling |
exchange_rate | decimal | If foreign | Exchange rate to KES (required when currency ≠ KES) |
Line Items Array
| Field | Type | Description |
|---|---|---|
item_id | string | ProTax item ID (from GET /items) |
quantity | decimal | Number of units sold |
unit_price | decimal | Price per unit excluding VAT (KES) |
discount_rate | decimal | Discount percentage (0–100) |
tax_type_code | string | Overrides item default: A, B, C, or D |
💡 For Credit Notes, include the original_invoice_id field referencing the ProTax ID of the invoice being reversed.
Transaction status
All possible states for a ProTax invoice and what each one means.
Status Codes
rejection_reason field in the response.Polling vs Webhooks
Check invoice status by calling GET /invoices/{id} or configure a Callback URL to receive push notifications when status changes occur.
Errors
ProTax uses standard HTTP status codes and descriptive error bodies to help you debug issues quickly.
HTTP Status Codes
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Resource created (invoice submitted) |
| 400 | Bad Request — invalid payload or missing fields |
| 401 | Unauthorized — missing or invalid X-API-Key |
| 403 | Forbidden — key doesn't have permission for this action |
| 404 | Not Found — resource doesn't exist |
| 422 | Unprocessable — KRA eTIMS rejected the invoice |
| 429 | Rate limit exceeded |
| 500 | Internal server error — contact support |
ProTax Error Codes
Invalid item_class_code
The HS code provided does not exist in the KRA classification table. Check the Classification Table.
Duplicate invoice_number
An invoice with this internal reference already exists. Use a unique number per transaction.
KRA eTIMS timeout
KRA's server did not respond in time. The invoice will be retried automatically. Check status via Transaction status.
Invalid customer_pin
The buyer's KRA PIN is not registered or is formatted incorrectly. B2C invoices can omit this field.
Tax calculation mismatch
The submitted tax totals don't match the line item calculation. Let the API compute totals automatically.
Item not registered
The referenced item_id does not exist. Register the item first via POST /items.
Stock: Data Attributes
Fields for reporting stock movements and adjustments to KRA eTIMS via ProTax.
📦 KRA eTIMS requires stock balance reporting for VAT-registered traders dealing in goods. ProTax automates this from your invoice line items.
Stock Adjustment Fields
| Field | Type | Required | Description |
|---|---|---|---|
item_id | string | ✅ | ProTax item ID |
adjustment_type | string | ✅ | IN=stock in, OUT=stock out, DAMAGE=write-off, RETURN=supplier return |
quantity | decimal | ✅ | Units adjusted (always positive) |
adjustment_date | ISO 8601 | ✅ | Date of the stock movement |
reference | string | Optional | GRN number, delivery note, or internal reference |
unit_cost | decimal | Optional | Purchase cost per unit (KES, used for stock valuation) |
notes | string | Optional | Reason for adjustment |
Frequently Asked Questions
Common questions about ProTax, KRA eTIMS integration, and the ProTax API.
Do I need a KRA PIN to use ProTax?
Yes. You must have a valid KRA PIN and have completed eTIMS onboarding with KRA before your ProTax account can go live. You can use the Sandbox environment for testing without full onboarding.
What is the difference between OSCU and VSCU?
OSCU (Online Sales Control Unit) requires real-time internet connectivity to KRA's eTIMS server. VSCU (Virtual Sales Control Unit) operates locally and syncs periodically. ProTax is an OSCU provider but offers Offline URLs and Callback URLs to provide resilience similar to VSCU.
Can I issue invoices in foreign currency?
Yes — set the currency_code field to the appropriate ISO 4217 code. However, KRA requires the tax amounts to also be reported in KES. Include the exchange_rate field in your payload.
How long does KRA take to sign an invoice?
Typically under 3 seconds. During peak periods or KRA maintenance windows, it may take longer. Use Callback URLs to be notified asynchronously rather than polling.
What happens if KRA eTIMS is down?
ProTax queues invoices automatically and retries when connectivity is restored. Enable Offline URLs for guaranteed delivery even during extended outages. See Offline URLs.
Is ProTax suitable for B2C and B2B invoicing?
Yes — for B2B, include the buyer's customer_pin to enable input tax credit for your customer. For B2C, this field is optional.
How do I issue a credit note to reverse an invoice?
Submit a POST /invoices/credit-note with the original_invoice_id of the invoice you want to reverse. See Reverse Invoicing.
Which item class code should I use?
Guidance on selecting the correct KRA HS classification code for your goods and services.
For Services
All service-based businesses should use the 9911xxxx series. The most common codes are:
99111001— General professional services (consulting, legal, accounting)99111002— IT and software services (SaaS, hosting, support)99111003— Transport and logistics99111004— Financial services99111005— Healthcare and medical services99111006— Education and training99111007— Marketing, advertising, and media99111008— Construction and engineering services99111009— Real estate and property management
For Goods
Use the standard WCO Harmonised System (HS) code for your product category. Start from the 2-digit chapter (e.g. Chapter 84 for machinery) and narrow to the 8-digit subheading.
💡 Not sure? Use ProTax's built-in HS code search at sandbox.protax.co.ke/hs-search or contact support.
Packaging & quantity units for services
Which unit codes to use when registering service-type items in ProTax.
Recommended Codes for Services
| Field | Recommended Code | Meaning |
|---|---|---|
packaging_unit_code | NX | No packaging (services) |
quantity_unit_code | NX | Not applicable (billed as a lump sum) |
quantity_unit_code | HUR | Hours (for time-based billing) |
quantity_unit_code | DAY | Days (for daily-rate services) |
quantity_unit_code | MON | Months (for subscriptions) |
Callback URLs
Receive real-time webhook notifications from ProTax when your invoices are processed, signed, or rejected by KRA eTIMS.
How Callbacks Work
When you register a Callback URL, ProTax sends an HTTP POST request to your endpoint whenever an invoice status changes. This eliminates the need to poll GET /invoices/{id} repeatedly.
- 1
Register your URL
Submit a
POST /webhooksrequest with your endpoint URL and the events you want to subscribe to. - 2
Receive the webhook
ProTax POSTs a JSON payload to your URL within seconds of the status change.
- 3
Verify the signature
Each webhook includes an
X-ProTax-Signatureheader. Verify it using your webhook secret to ensure authenticity. - 4
Respond with 200
Your endpoint must return a
200 OKwithin 10 seconds. Failed deliveries are retried up to 5 times with exponential backoff.
Available Events
| Event | Triggered when |
|---|---|
invoice.signed | KRA eTIMS successfully signs the invoice |
invoice.rejected | KRA eTIMS rejects the invoice |
invoice.failed | A system error prevents submission |
invoice.queued | Invoice is queued (offline mode) |
credit_note.signed | Credit note successfully processed |
Offline URLs
Issue invoices even when internet connectivity is unavailable — ProTax queues them and transmits to KRA eTIMS automatically when connectivity is restored.
What are Offline URLs?
Offline URLs allow ProTax to accept invoice submissions and return a provisional response even when KRA eTIMS is unreachable. The invoice is stored securely in ProTax's queue and submitted to KRA as soon as connectivity is restored.
✅ Your customer receives a provisional receipt immediately. Once KRA signs the invoice, the receipt is automatically upgraded to a full fiscal invoice.
Enabling Offline Mode
Set the offline_mode flag to true in your POST /invoices request body, or enable it globally in your ProTax Dashboard settings.
Online vs Offline Mode
| Feature | Online Mode | Offline Mode |
|---|---|---|
| Requires internet | ✅ Yes | ❌ No (queue locally) |
| KRA sign time | ~1–3 seconds | On reconnection |
| CUIN returned | Immediately | After reconnection |
| Provisional receipt | — | ✅ Yes |
| Risk of rejection | Immediate feedback | Deferred feedback |
Reverse Invoicing
Issue KRA eTIMS-compliant credit notes to reverse or partially adjust previously signed invoices.
When to use a Credit Note
- Goods returned by the buyer
- Overcharge correction on a prior invoice
- Service cancellation post-invoicing
- Pricing dispute resolution
⚠️ Once an invoice is signed by KRA eTIMS, it cannot be deleted or edited. You must issue a Credit Note to reverse it. KRA tracks the link between the original invoice and the credit note.
Submitting a Credit Note
POST /invoices/credit-note
{
"original_invoice_id": "inv_abc123",
"reason": "Goods returned",
"items": [...]
}
A full reversal credits all line items. A partial reversal only credits the specified items and quantities.
Invoice Verification
Allow buyers and auditors to verify the authenticity of ProTax-issued eTIMS invoices using the embedded QR code.
How Verification Works
Every signed ProTax invoice contains a KRA-issued QR code. Scanning this code or entering the CUIN at the verification portal confirms that the invoice was legitimately stamped by KRA eTIMS.
Verification Methods
Scan the QR code on the printed or PDF invoice using any QR reader. Redirects to the KRA eTIMS verification page.
Call GET /invoices/{id}/verify to programmatically check invoice validity in your own system.
KRA's own eTIMS portal also supports CUIN lookup for taxpayers and auditors.
ProTax Quickbooks Plugin
Automatically sync Quickbooks Online invoices to KRA eTIMS via ProTax — zero manual effort.
How it works
The ProTax Quickbooks plugin connects your Quickbooks Online account to ProTax. Every time you create and approve an invoice in Quickbooks, it is automatically submitted to KRA eTIMS through ProTax and the signed CUIN is written back to your Quickbooks invoice as a memo.
- 1
Install from Quickbooks App Store
Search "ProTax eTIMS" in the Quickbooks App Store and click Connect.
- 2
Authorise ProTax
Log in to your ProTax account and grant access. Your
X-API-Keyis configured automatically. - 3
Map your products
Map each Quickbooks product/service to its ProTax item (HS code, tax type, unit). This only needs to be done once.
- 4
Go live
Approve an invoice in Quickbooks — ProTax handles the rest.
✅ Quickbooks invoices approved in Quickbooks Online are signed by KRA eTIMS within seconds via ProTax.
ProTax Sage Online Plugin
Connect Sage Business Cloud Accounting to KRA eTIMS through ProTax for automated fiscal compliance.
Supported Sage Products
- Sage Business Cloud Accounting
- Sage 50cloud (via API bridge)
- Sage 200 (Enterprise — contact support)
- 1
Download the ProTax Sage plugin
Available at sandbox.protax.co.ke/plugins/sage.
- 2
Configure your API credentials
Enter your ProTax
X-API-Keyin the plugin settings page within Sage. - 3
Map products and tax codes
Align Sage tax codes with ProTax tax type codes (
A=16%,B=8%,C=0%,D=Exempt). - 4
Test in Sandbox
Use the Sandbox environment to verify invoices are being signed correctly before switching to Live.
ProTax WooCommerce Plugin
Automatically issue KRA eTIMS invoices for every WooCommerce order — seamlessly integrated into your checkout flow.
How it works
When a WooCommerce order is marked "Processing" or "Completed", the plugin automatically submits a fiscal invoice to KRA eTIMS via ProTax. The signed invoice PDF and QR code are attached to the WooCommerce order confirmation email.
Requirements
- WordPress 6.0+ and WooCommerce 8.0+
- Active ProTax account with a Live
X-API-Key - WooCommerce products mapped to ProTax items (HS codes required)
- 1
Install the plugin
Download from sandbox.protax.co.ke/plugins/woocommerce and upload to WordPress Plugins.
- 2
Configure
Go to WooCommerce → ProTax Settings and enter your
X-API-Key. - 3
Map products
Add HS codes and unit codes to each WooCommerce product under the "ProTax eTIMS" tab in the product editor.
🛒 For high-volume stores, enable async invoice generation to avoid checkout delays. Invoices are queued and signed within seconds.
MCP Integration
Connect AI agents and tools to ProTax via the Model Context Protocol (MCP) — issue invoices, look up items, and check status using natural language.
What is MCP?
Model Context Protocol (MCP) is an open standard that allows AI assistants (Claude, Copilot, etc.) to securely connect to external services. The ProTax MCP server exposes ProTax API capabilities as MCP tools that AI agents can invoke directly.
✅ The ProTax MCP server is approved for use with Claude (Anthropic), GitHub Copilot, and other MCP-compatible AI assistants.
Available MCP Tools
| Tool | Description |
|---|---|
create_invoice | Submit a new eTIMS invoice to KRA |
get_invoice | Retrieve invoice details and signing status |
list_invoices | List invoices with filters (date, status, customer) |
create_credit_note | Issue a credit note against a prior invoice |
get_items | List registered items and their HS codes |
lookup_hs_code | Search for the correct HS code by description |
get_stock | Get current stock balances for an item |
verify_invoice | Check if a CUIN is valid and KRA-signed |
Quick Setup
- 1
Add ProTax MCP to your AI tool
In Claude or your MCP-compatible client, add the server URL:
https://mcp.protax.co.ke - 2
Authenticate
Provide your ProTax
X-API-Keywhen prompted by the MCP client. - 3
Start invoicing with AI
Ask your AI assistant: "Create an eTIMS invoice for ABC Ltd for 5 hours of consulting at KES 10,000/hr."