Submit invoices to the Khyber Pakhtunkhwa Revenue Authority through one canonical TaxBridge API. Sandbox, production, authentication, error handling and logs — without studying the KPRA API directly.
KPRA covers sales tax on services in Khyber Pakhtunkhwa.
curl -X POST https://taxbridge.themetasum.com/api/v1/invoices \
-H "Authorization: Bearer tbk_test_9f3a21c7b4d6e8f0_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 0b6d1c4e-7f9a-4a51-8d3c-2e5f7a91b204" \
-H "X-Tax-Authority: PRA" \
-d '{
"invoiceNumber": "INV-10001",
"invoiceDate": "2026-08-10T10:30:00",
"invoiceType": "Sale",
"currency": "PKR",
"paymentMode": "Cash",
"customer": { "name": "Walk-in Customer" },
"items": [{
"description": "Chicken Karahi Full", "hsCode": "11001010",
"quantity": 1, "unitPrice": 1500.00,
"taxRate": 16, "taxAmount": 240.00, "total": 1740.00
}],
"subTotal": 1500.00, "tax": 240.00, "total": 1740.00
}'KPRA API integration connects your software to the Khyber Pakhtunkhwa Revenue Authority system (including RIMS for restaurants) for sales tax on services in KP. TaxBridge translates your canonical invoice into KPRA’s body format and credentials.
KPRA in one call
You send TaxBridge one canonical invoice. TaxBridge applies KPRA’s field names, casing, money identity and success rules, then returns a single normalized result.
| Authority | Khyber Pakhtunkhwa Revenue Authority |
| Jurisdiction | Khyber Pakhtunkhwa |
| Covers | Sales tax on services |
| Header | X-Tax-Authority: KPRA |
| Registration | kpra.gov.pk |
curl -X POST https://taxbridge.themetasum.com/api/v1/invoices \
-H "Authorization: Bearer tbk_test_9f3a21c7b4d6e8f0_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 0b6d1c4e-7f9a-4a51-8d3c-2e5f7a91b204" \
-H "X-Tax-Authority: KPRA" \
-d '{
"invoiceNumber": "INV-10001",
"invoiceDate": "2026-08-10T10:30:00",
"invoiceType": "Sale",
"currency": "PKR",
"paymentMode": "Cash",
"customer": { "name": "Walk-in Customer" },
"items": [{
"description": "Chicken Karahi Full", "hsCode": "11001010",
"quantity": 1, "unitPrice": 1500.00,
"taxRate": 16, "taxAmount": 240.00, "total": 1740.00
}],
"subTotal": 1500.00, "tax": 240.00, "total": 1740.00
}'Four steps from account to your first approved KPRA invoice.
Create your TaxBridge company and verify your email. An admin approves the company for production access.
Pick a plan for KPRA and fill the credential form. For KPRA: pos_id (a string, e.g. K123456), ntn and an API key — all sent inside the request body.
Generate a test or live key, optionally pinned to KPRA. The full key is shown once and stored only as a hash.
Send your canonical invoice with X-Tax-Authority: KPRA. Print the returned qrCode and keep the submissionId.
KPRA’s POS ID is a string, not a number — a common source of bugs when integrating directly. TaxBridge validates and formats it for you. Restaurants on RIMS pay a reduced rate.
Your KPRA credentials are AES-256-GCM encrypted at rest and never returned to your app.
Test KPRA end-to-end before you hold production credentials.
KPRA rejections come back as a single status with a readable authorityMessage.
Every KPRA submission is logged with request, response and status for debugging.
Run many outlets under one company — each branch’s KPRA submissions are tracked separately.
A repeated Idempotency-Key replays the stored KPRA result with no double submission.
| HTTP | Meaning | What your code does |
|---|---|---|
201 | Approved by the authority | Print qrCode, store submissionId |
200 | Idempotent replay (duplicate:true) | Treat like the original — no quota consumed |
400 INVALID_INVOICE | Normalizer rejected it; details[] lists every problem | Fix and resubmit — no quota consumed |
402 QUOTA_EXCEEDED | Plan limit hit or subscription expired | Upgrade or renew |
409 DUPLICATE_INVOICE | Invoice number already approved for this authority + environment | Do not resubmit |
422 | Authority rejected it (status:"REJECTED") | Read authorityMessage, fix the data |
429 | Rate limit or sandbox soft cap | Honour Retry-After |
502 / 504 | Authority errored or timed out | Retry with the same Idempotency-Key |
Also integrating another province? See PRA · FBR · SRB or the unified tax API.
Create a sandbox, store your KPRA credentials and post a test invoice in minutes. Move to production when your data is verified.
Just register your business with Sum Cloud POS — it already files fiscal invoices to FBR, PRA, SRB and KPRA for you. No API, no development, nothing to connect or maintain. Start selling with compliant invoices out of the box.