eTIMS API
Sign invoices with KRA's Electronic Tax Invoice Management System.
POST
/api/etims-initInitialize your OSCU device and obtain the CMC key. Call once before submitting invoices.
Request
curl -X POST https://etims.pemystack.com/api/etims-init \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"success": true,
"cmcKey": "your-communication-key",
"message": "Device initialized. CMC key saved."
}POST
/api/invoicesSubmit a sales invoice to KRA eTIMS. Returns the CU invoice number and QR code data.
Request
curl -X POST https://etims.pemystack.com/api/invoices \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"invoiceNo": "INV-001",
"items": [
{
"name": "Nyama Choma",
"quantity": 2,
"unitPrice": 85000,
"taxType": "A"
},
{
"name": "Tusker Lager",
"quantity": 3,
"unitPrice": 25000,
"taxType": "B"
}
],
"customerPin": "A123456789B",
"customerName": "John Kamau",
"paymentType": "04"
}'Response
{
"success": true,
"cuInvoiceNo": "CUA0051001",
"qrCodeData": "base64-encoded-qr-data"
}Invoice Fields
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| invoiceNo | string | Yes | Your internal invoice number |
| items | array | Yes | Line items (see below) |
| customerPin | string | No | Buyer's KRA PIN (for B2B) |
| customerName | string | No | Buyer name |
| paymentType | string | No | 01=Cash, 02=Credit, 03=Cheque, 04=M-Pesa, 05=Bank |
Item fields
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Item name |
| quantity | number | Yes | Quantity |
| unitPrice | number | Yes | Price in KES cents (85000 = KES 850) |
| taxType | string | Yes | A=16% VAT, B=8%, C=Zero-rated, D=Exempt |