---
title: "How it works & Architecture"
space: "TIMS Tevin Type-C Integration"
url: "https://docs.navari.co.ke/tims-tevin/how-it-works-architecture"
updated: "2026-05-26"
---

## How It Works: Architecture

Understanding the data flow helps when debugging or extending the integration.



```
ERPNext (Sales Invoice Submitted)
         |
         v
  [TIMS Tevin App Hook]
  Prepares payload (invoice fields, line items, VAT breakdown)
  Attaches Sender ID & authentication headers
         |
         v
  Tevin Type-C Middleware (API Server)
  Validates payload, forwards to KRA TIMS
         |
         v
  KRA TIMS
  Generates CU Number & signs the invoice
         |
         v
  Response returned to ERPNext
  - CU Number stored on the invoice
  - QR Code generated and embedded
  - Integration Request marked "Completed"

```



If the middleware is unreachable or returns an error, the Integration Request is marked **"Failed"**, and a **scheduled task running every minute** will automatically retry until a successful response is received.