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 documentation.
Navigation
Use the sidebar on the left to jump between sections. Each section is organised into logical categories: Documentation, How-To guides, Reference pages, FAQ, Features, Plugins, and MCP.
Sidebar sections
- Documentation — Start here. Overviews and onboarding guides.
- How-To — Step-by-step task guides for common integrations.
- Reference — Detailed technical specs for API fields, statuses, and errors.
- FAQ — Answers to the most common questions from integrators.
- Features — Deep-dives on Callbacks, Offline mode, Reverse Invoicing, and Verification.
- Plugins — Ready-made integrations for popular accounting and e-commerce platforms.
- MCP Server — AI-native integration via the Model Context Protocol.
API Reference
For an interactive, try-it-now API explorer, visit the ProTax API Reference at sandbox.protax.co.ke/reference. You will need your X-API-Key from the dashboard.
💡 Tip: On mobile, tap the ☰ button (bottom-right) to open the sidebar navigation at any time.
Create an eTIMS Invoice
Walk through the full lifecycle of a KRA eTIMS invoice using the ProTax API.
Overview
Every taxable sale in Kenya must be reported to KRA eTIMS. ProTax handles the signing, stamping, and transmission — your system just needs to POST a structured invoice payload.
Step-by-step
- 1
Authenticate
Include your
X-API-Keyheader in every request. Obtain your key from the ProTax Dashboard. - 2
Build the invoice payload
Construct a JSON body with the required invoice and line-item fields. See Invoice attributes and Item attributes for the full field reference.
- 3
POST to /invoice
Submit your payload to the
POST /invoiceendpoint. ProTax validates, signs, and forwards to KRA eTIMS synchronously. - 4
Handle the response
A successful response returns a
transaction_idandcu_invoice_no(KRA fiscal number). Store both for your records. - 5
Issue the tax invoice
Print or email the invoice to the customer. It must include the KRA QR code and
cu_invoice_no.
⚠️ Do not issue an invoice to a customer before receiving the KRA fiscal number. An unstamped invoice is not a valid tax invoice under the Finance Act, 2023.
Start using the ProTax API
Get your API key, make your first request, and explore the sandbox environment.
Prerequisites
- A ProTax account — register free
- Your KRA PIN and eTIMS credentials
- An HTTP client (cURL, Postman, or your own application)
Get your API key
- 1
Log in to the Dashboard
Visit sandbox.protax.co.ke and sign in.
- 2
Navigate to API Keys
Go to Settings → API Keys and click Generate new key.
- 3
Copy the key
Your
X-API-Keyis shown once. Copy it immediately and store it securely.
Make your first request
Test your key with a simple GET to the status endpoint:
💡 All requests require the X-API-Key header. Base URL: https://api.protax.co.ke/v2
ProTax API Details
Technical overview of the ProTax REST API — base URLs, authentication, versioning, and rate limits.
Base URL
All API requests are made to: https://api.protax.co.ke/v2
Sandbox (testing): https://sandbox-api.protax.co.ke/v2
Authentication
Every request must include your API key as a header:
X-API-Key: your_api_key_here
Content type
All request and response bodies use JSON. Set Content-Type: application/json on all POST and PUT requests.
Versioning
The current API version is v2. Breaking changes will be released under a new version prefix. Previous versions are supported for a minimum of 12 months after a new version launches.
Rate limits
| Plan | Requests / minute | Requests / day |
|---|---|---|
| Free | 60 | 1,000 |
| Starter | 300 | 10,000 |
| Pro | 1,200 | Unlimited |
| Enterprise | Custom | Custom |
Endpoints summary
| Method | Path | Description |
|---|---|---|
| POST | /invoice | Submit a new eTIMS invoice |
| GET | /invoice/{id} | Retrieve invoice by transaction ID |
| POST | /invoice/reverse | Reverse / credit note |
| GET | /stock | List registered stock items |
| POST | /stock | Register a new stock item |
| PUT | /stock/{id} | Update a stock item |
Item Attributes
Field-by-field reference for stock items used in invoice line items.
Required fields
| Field | Type | Description |
|---|---|---|
item_code | string | Your internal product/SKU code |
item_name | string | Product name (max 100 chars) |
item_class_code | string | KRA eTIMS classification code. See Item Classification Table. |
unit_price | number | Unit price in KES (excl. tax) |
tax_type_code | string | Tax type: VAT, EXEMPT, ZERO |
pkg_unit_code | string | Packaging unit code. See Packaging & quantity units. |
qty_unit_code | string | Quantity unit code |
Item Classification Table
KRA eTIMS item class codes used in the item_class_code field.
💡 Not sure which code to use? See the FAQ: Which item class code?
| Code | Category | Description |
|---|---|---|
5000 | Goods | General goods / merchandise |
5010 | Goods | Food & beverages |
5020 | Goods | Electronics & electrical equipment |
5030 | Goods | Clothing & textiles |
5040 | Goods | Pharmaceuticals & medical supplies |
5050 | Goods | Motor vehicles & parts |
5060 | Goods | Fuel & lubricants |
6000 | Services | General services |
6010 | Services | Professional services |
6020 | Services | Transport & logistics |
6030 | Services | Accommodation & hospitality |
6040 | Services | Financial services |
6050 | Services | ICT & digital services |
Invoice Attributes
Complete field reference for the invoice payload submitted to POST /invoice.
Header fields
| Field | Type | Required | Description |
|---|---|---|---|
invoice_no | string | ✅ | Your system's invoice number |
invoice_date | string | ✅ | Date in YYYY-MM-DD format |
invoice_type | string | ✅ | SALE, CREDIT, or DEBIT |
buyer_pin | string | Conditional | KRA PIN of buyer (B2B transactions) |
buyer_name | string | ✅ | Name of buyer |
currency | string | ✅ | ISO 4217 code, e.g. KES |
exchange_rate | number | Conditional | Required if currency ≠ KES |
Line item fields
Each invoice must contain at least one item in the items array. Each item shares the same fields as the Item attributes reference, plus:
| Field | Type | Description |
|---|---|---|
quantity | number | Quantity sold |
discount_amount | number | Line discount in KES (optional) |
tax_amount | number | Calculated tax for this line |
total_amount | number | Line total inclusive of tax |
Transaction Status
All possible status values returned in invoice and transaction responses.
cu_invoice_no is available.error field for details.💡 Use Callback URLs to receive real-time status updates without polling.
Errors
HTTP status codes and error codes returned by the ProTax API.
HTTP status codes
Bad Request
The request body is malformed or missing required fields.
Unauthorised
Missing or invalid X-API-Key.
Unprocessable Entity
Payload is structurally valid but failed eTIMS validation rules (e.g. invalid PIN, bad item class code).
Too Many Requests
Rate limit exceeded. Back off and retry after the Retry-After header value.
Internal Server Error
ProTax or KRA eTIMS encountered an unexpected error. Retry with exponential back-off.
Stock: Data Attributes
Fields for registering and managing stock items via the ProTax API.
Stock item fields
| Field | Type | Required | Description |
|---|---|---|---|
item_code | string | ✅ | Unique SKU / product code in your system |
item_name | string | ✅ | Product display name |
item_class_code | string | ✅ | KRA classification code |
unit_price | number | ✅ | Default selling price in KES |
tax_type_code | string | ✅ | VAT, EXEMPT, or ZERO |
pkg_unit_code | string | ✅ | Packaging unit |
qty_unit_code | string | ✅ | Quantity unit |
description | string | No | Optional longer product description |
barcode | string | No | EAN/UPC barcode if applicable |
is_active | boolean | No | Defaults to true |
Frequently Asked Questions
Common questions from developers and businesses integrating with ProTax and KRA eTIMS.
Is eTIMS mandatory for all businesses?
Yes. Under the Finance Act, 2023, eTIMS invoicing became mandatory for all VAT-registered taxpayers from 1 January 2024. Non-VAT taxpayers were required to comply by 1 September 2024.
Can I test without affecting my live KRA data?
Yes. Use the ProTax sandbox environment at sandbox-api.protax.co.ke. Sandbox invoices are submitted to the KRA eTIMS test server and do not affect your live tax records.
What happens if KRA eTIMS is down?
ProTax automatically queues invoices in Offline Mode. Invoices are stored securely and transmitted as soon as the KRA server is reachable. See Offline URLs for more details.
Do I need to store the KRA fiscal number?
Yes. The cu_invoice_no (KRA fiscal number) must be printed on every tax invoice issued to a buyer. Store it alongside your own invoice record.
How do I handle credit notes / returns?
Use the POST /invoice/reverse endpoint with invoice_type: "CREDIT". Reference the original invoice's cu_invoice_no. See Reverse Invoicing.
Which item class code?
A practical guide to selecting the right KRA item_class_code for your products and services.
Goods vs Services
The first digit of the code tells you the category: 5xxx = Goods, 6xxx = Services. Start there.
Decision guide
- Selling physical products for consumption (food, drinks)? → 5010
- Selling electronics or appliances? → 5020
- Selling clothing, uniforms, fabric? → 5030
- Selling medicines, medical equipment? → 5040
- Selling fuel, oils, lubricants? → 5060
- Providing professional services (legal, consulting, accounting)? → 6010
- Transport, delivery, courier? → 6020
- Hotel, restaurant, events? → 6030
- Software, hosting, telecoms? → 6050
- Anything else (general goods)? → 5000
- Anything else (general services)? → 6000
⚠️ When in doubt, use the parent code (5000 or 6000). KRA may reject invoices with mismatched class codes.
Packaging & Quantity Units
Accepted values for pkg_unit_code and qty_unit_code fields.
| Code | Description | Use for |
|---|---|---|
NOS | Numbers / pieces | Individual countable items |
KG | Kilograms | Goods sold by weight |
G | Grams | Small weight items |
L | Litres | Liquid goods |
ML | Millilitres | Small liquid items |
M | Metres | Length-based goods (fabric, pipe) |
M2 | Square metres | Area-based goods (tiles, glass) |
M3 | Cubic metres | Volume-based goods (timber, concrete) |
PKT | Packet | Pre-packaged items |
CTN | Carton | Carton-packed goods |
DZ | Dozen | Items sold in sets of 12 |
HR | Hour | Time-based services |
DAY | Day | Daily-rate services |
MTH | Month | Monthly services / subscriptions |
Callback URLs
Receive real-time invoice status updates via webhooks instead of polling.
How it works
Register a publicly accessible HTTPS endpoint in your ProTax Dashboard. When an invoice status changes (e.g. PROCESSING → SUCCESS), ProTax will POST a JSON payload to your URL.
Callback payload
ProTax signs every callback with an X-ProTax-Signature header. Verify this signature before processing the payload.
Retry policy
If your endpoint returns a non-2xx response, ProTax retries up to 5 times with exponential back-off: 1 min, 5 min, 15 min, 1 hr, 6 hr.
Offline URLs
Keep invoicing when KRA eTIMS is temporarily unreachable.
Overview
ProTax maintains an offline queue. When KRA eTIMS returns errors or is unreachable, invoices are queued locally (in ProTax's infrastructure) and automatically retransmitted when connectivity is restored. No changes to your integration code are required.
Offline invoice status
Queued invoices have status PENDING. Your system can poll GET /invoice/{id} or use Callback URLs to be notified when the status changes to SUCCESS.
⚠️ Do not issue a tax invoice to a customer while status is PENDING. Wait for SUCCESS and a valid cu_invoice_no.
Reverse Invoicing
Issue credit notes and debit notes against previously submitted eTIMS invoices.
When to reverse
- Customer returns goods after a sale
- Pricing error on an issued invoice
- Full or partial cancellation of a service
How to reverse
- 1
Locate the original invoice
You need the original invoice's
cu_invoice_no(KRA fiscal number) and yourinvoice_no. - 2
Build the reversal payload
Set
invoice_typetoCREDIT(return) orDEBIT(additional charge). Includeoriginal_cu_invoice_noin the payload. - 3
POST to /invoice/reverse
Submit to
POST /invoice/reverse. A newcu_invoice_nois issued for the credit/debit note.
Invoice Verification
Allow buyers and auditors to verify the authenticity of any KRA eTIMS invoice.
QR code verification
Every stamped invoice includes a KRA-generated QR code. Scanning the QR code redirects to the KRA eTIMS verification portal, confirming the invoice's authenticity and fiscal details.
API verification
You can also verify programmatically via GET /invoice/verify/{cu_invoice_no}. The response confirms the invoice status, taxpayer PIN, and totals as recorded by KRA.
✅ Verification is available to any party — no API key is required for the public verification endpoint.
ProTax QuickBooks Plugin
Connect QuickBooks Online to KRA eTIMS with zero code changes.
Overview
The ProTax QuickBooks plugin automatically intercepts every invoice created in QuickBooks Online, submits it to KRA eTIMS via ProTax, and writes the KRA fiscal number back to the QuickBooks invoice as a custom field.
Installation
- 1
Install from the QuickBooks App Store
Search for ProTax eTIMS in the Intuit App Store and click Get app now.
- 2
Connect your ProTax account
Enter your ProTax API key and KRA PIN when prompted.
- 3
Map your products
Assign KRA item class codes and tax types to your QuickBooks products/services.
ProTax Sage Online Plugin
Integrate Sage Business Cloud Accounting with KRA eTIMS seamlessly.
Overview
The ProTax Sage Online plugin syncs invoices from Sage Business Cloud to KRA eTIMS in real-time. Fiscal numbers are written back to Sage invoice notes automatically.
Requirements
- Sage Business Cloud Accounting subscription (Accounting or Accounting Plus)
- Active ProTax account with a valid API key
- KRA eTIMS credentials (PIN, branch)
ProTax WooCommerce Plugin
Automatically issue KRA eTIMS invoices for every WooCommerce order.
Overview
The ProTax WooCommerce plugin hooks into WooCommerce order processing. When an order moves to Processing or Completed, an eTIMS invoice is automatically submitted via ProTax and the fiscal number is attached to the order.
Installation
- 1
Download the plugin
Download the ProTax WooCommerce plugin ZIP from your ProTax Dashboard under Plugins.
- 2
Install in WordPress
Go to Plugins → Add New → Upload Plugin and upload the ZIP file.
- 3
Configure
Navigate to WooCommerce → Settings → ProTax eTIMS and enter your API key.
MCP Integration
Use the ProTax MCP Server to issue eTIMS invoices directly from AI assistants like Claude.
What is MCP?
Model Context Protocol (MCP) is an open standard that allows AI assistants to call external tools and services. The ProTax MCP Server exposes ProTax API actions as MCP tools, enabling AI-native invoicing workflows.
Available tools
- create_invoice — Submit a new eTIMS invoice
- get_invoice — Retrieve invoice status and fiscal details
- list_stock — List registered stock items
- create_stock_item — Register a new product
- reverse_invoice — Issue a credit or debit note
Setup
- 1
Get your API key
Obtain your
X-API-Keyfrom the ProTax Dashboard. - 2
Add to your MCP client
Point your MCP client to the ProTax MCP Server URL and provide your API key as the bearer token.
- 3
Start invoicing via AI
Ask your AI assistant to create an invoice — it will call the ProTax MCP tools automatically.
🤖 The ProTax MCP Server is compatible with Claude, GPT-4, and any MCP-compliant AI client.