How to Integrate PRA API with Your Cloud Based POS System

If your business operates in Punjab and you use a cloud-based Point of Sale (POS) system, you need to connect it to the Punjab Revenue Authority (PRA) so that sales are reported in real time and you stay compliant with Punjab tax rules. This guide explains, in simple steps, how to integrate the PRA API with your existing cloud POS—from registration to daily use.

What Is PRA and Why Does Integration Matter?

The Punjab Revenue Authority (PRA) is the tax body in Punjab that collects certain taxes (e.g. Punjab sales tax on services, other provincial taxes). When you integrate your POS with PRA:

  • Every invoice gets a unique PRA invoice number (or similar identifier) from PRA.
  • Sales data is sent to PRA in real time, so your records and PRA’s records match.
  • You can print a QR code or barcode on the receipt so customers and PRA can verify the invoice.
  • Your sales tax return preparation becomes easier because data is already with PRA.

This applies to many businesses in Punjab: restaurants, salons, hotels, retailers, courier services, beauty parlors, jewelers, diagnostic labs, and other service or retail businesses that fall under PRA’s scope.

What You Will Need Before Starting

  • PRA registration: Your business must be registered with PRA (as required for your sector).
  • Cloud POS: A POS system that can send data over the internet (API or similar).
  • Stable internet: So that every sale can be reported to PRA without failure.
  • Technical support: A developer or your POS vendor who can work with APIs.

Step 1: Register Your Business and POS with PRA

Before you can use the PRA API, PRA must know your business and that you will use a POS to report sales.

  1. Go to the official PRA portal (as per current PRA website—search for “Punjab Revenue Authority” or “PRA Pakistan”).
  2. Log in with your business credentials (or create an account if you are not registered).
  3. Find the section for POS registration or Fiscal Device / Invoicing System registration.
  4. Submit the required details, such as:
    • Business name and registration number
    • Branch/location address
    • Contact person and phone
    • Type of business (restaurant, retail, salon, etc.)
    • POS or software name and vendor (if asked)
  5. After approval, PRA will provide you with credentials or instructions to access the API (e.g. API URL, client ID, token, or similar). Keep these safe.

Step 2: Get Your API Credentials

PRA may offer a test (sandbox) and a live (production) environment. You need:

  • API base URL: The web address where your system will send invoice data (one for testing, one for live).
  • Authentication: A token, API key, or client ID/secret—as per PRA’s current method. This proves that the request is from your registered business.

Check the PRA portal or the documentation they give you for the exact names (e.g. “API for Sandbox”, “Production API”) and how to generate or refresh tokens. Store credentials securely and never expose them in front-end code or public repositories.

Step 3: Understand the Flow: POS → Your Server → PRA

The flow is similar to FBR:

  • When a sale is completed at the POS, the cashier (or system) creates an invoice (items, quantities, prices, tax).
  • Your cloud POS sends this invoice data to your own backend server (your API or cloud service).
  • Your backend then calls the PRA API to register the invoice and get back a PRA invoice number (and often a QR code or barcode).
  • Your backend sends this response back to the POS so the receipt can show the PRA number and QR code (if required).

So you need a small “connector” on your backend that talks to PRA on behalf of your POS.

Step 4: Get PRA’s Technical Documentation

Ask PRA or your POS/integrator vendor for the official API documentation. It should include:

  • Exact API endpoint URLs (e.g. for submitting an invoice, getting invoice number).
  • Request format (e.g. JSON) and all required fields (invoice date, seller details, line items, tax breakdown, etc.).
  • How to send the authentication (e.g. header name and value).
  • Response format and codes (success, validation error, etc.).

Use this document as the single source of truth. Do not rely only on third-party articles, as PRA may update the API.

Step 5: Build the Integration on Your Backend

Your developer or vendor should do the following in order:

  1. Authentication: For each request to PRA, attach the token or API key in the way PRA specifies (e.g. in the request header).
  2. Build the request body: For each sale, convert your POS invoice into the JSON structure PRA expects. Include all mandatory fields (e.g. invoice number, date, seller info, buyer info if required, line items with description, quantity, unit price, tax rate, tax amount, total).
  3. Call PRA API: Send a POST request (or as per docs) to the PRA endpoint over HTTPS. Do not use HTTP for production.
  4. Handle the response: If PRA returns success, they usually send back a unique invoice reference, and sometimes a QR code or barcode string. Save this in your database and link it to the invoice.
  5. Send data back to POS: So the POS can print the PRA invoice number and QR code on the receipt. If PRA returns an error, log it and either retry (if it is a temporary issue) or alert staff so they can fix the data.

Step 6: Test in Sandbox First

If PRA provides a sandbox (test) environment:

  • Use the sandbox API URL and sandbox credentials.
  • Create test sales from your POS and confirm that each invoice is sent to PRA and you receive a valid response (e.g. PRA invoice number).
  • Test wrong or incomplete data to see how errors are returned and how your system should handle them.
  • Only after everything works in sandbox, switch to production.

Step 7: Go Live and Print PRA Details on Receipts

  1. Switch your connector to use the production API URL and production credentials.
  2. Run a few real sales and verify that PRA is accepting them (e.g. check in PRA portal or via their support if available).
  3. Ensure your receipt prints whatever PRA requires: usually the PRA invoice number and a QR code (or barcode) so customers can verify via the PRA Tax App or similar.
  4. Train staff: every sale is now reported to PRA; invoice numbers should be unique and not duplicated.

Step 8: Multi-Location and Ongoing Compliance

If you have multiple outlets:

  • Register each location with PRA if required, and use the correct credentials or branch ID for each when calling the API.
  • Keep credentials and tokens secure; rotate them if PRA supports it and if there is a security need.
  • Monitor failed API calls and fix issues (e.g. format changes, new required fields) when PRA updates their system.
  • Use the automated data from PRA to prepare your sales tax returns and avoid manual re-entry where possible.

Summary

To integrate the PRA API with your cloud POS: (1) register your business and POS with PRA and get API access, (2) get sandbox and production credentials, (3) build a backend connector that receives POS invoice data, converts it to PRA’s format, and POSTs it to PRA, (4) receive and store the PRA invoice number and QR code and send them back to the POS for printing, (5) test in sandbox, then (6) go live and keep monitoring. Following PRA’s official documentation and using a clear step-by-step approach will help you stay compliant and avoid errors.

What readers say

Fatima T.★★★★★3 weeks ago

We run three restaurants in Lahore. This guide made PRA integration understandable—our vendor followed it and we got QR codes on receipts and no more manual return headaches. Very helpful.

Hassan Ali★★★★★1 month ago

Simple language, no jargon. We integrated our salon POS with PRA using this as a checklist. The flow diagram (POS → server → PRA) made it clear who does what. Thumbs up.

Zainab K.★★★★★2 weeks ago

Finally found something that explains PRA integration for Punjab businesses. Shared with our accountant and POS guy—we’re now compliant and our returns are much easier. Thank you.

Need Help with PRA POS Integration?

Vareon can help you with PRA registration, understanding API requirements, and connecting your cloud POS to the PRA API. We work with businesses in Punjab across sectors to ensure correct integration and compliance. Contact us for a consultation tailored to your business and POS setup.