Aakvatech Limited - Setting Up VFDPlus as Your VFD Provider in ERPNext

A step-by-step guide to configuring VFDPlus for fiscal receipt submission in ERPNext using the CSF TZ module.

 · 4 min read

Setting Up VFDPlus as Your VFD Provider in ERPNext

Tanzania VFD Compliance · ERPNext / CSF TZ A step-by-step guide to configuring VFDPlus for fiscal receipt submission in ERPNext using the VFD Providers app.


Introduction

In Tanzania, businesses are required to use a Virtual Fiscal Device (VFD) to submit fiscal receipts to the Tanzania Revenue Authority (TRA). ERPNext supports multiple VFD providers through the VFD Providers app — an open-source app maintained by Aakvatech Limited that provides a pluggable VFD Provider DocType for managing provider configurations.

VFDPlus is a third-party VFD middleware platform that simplifies the fiscal receipt submission process. This guide walks you through configuring VFDPlus as your VFD provider in ERPNext.

Prerequisites - The VFD Providers app installed on your ERPNext instance - A VFDPlus account with valid API credentials - System Manager access to your ERPNext site


About the VFD Providers App

The VFD Providers app is an open-source Frappe/ERPNext application developed and maintained by Aakvatech Limited. It provides the VFD Provider DocType which stores the base URL and API endpoint paths for each VFD middleware provider. When ERPNext needs to post a fiscal receipt, it reads these values to construct the full API request URL dynamically — making it straightforward to switch providers without any code changes.

You can find the app and contribute to it here:

https://github.com/Aakvatech-Limited/vfd_providers

Installation

cd /home/frappe/frappe-bench
bench get-app https://github.com/Aakvatech-Limited/vfd_providers
bench --site your-site.example.com install-app vfd_providers
bench migrate

VFDPlus API Endpoints

VFDPlus exposes four key API endpoints used by the VFD Providers app:

Key Endpoint Path Purpose
post_fiscal_receipt /vfd-thirdparty-api/post_fiscal_receipt Submit a new fiscal receipt to TRA
receipt_info /vfd-thirdparty-api/receipt_info Query status/info of a submitted receipt
account_info /vfd-thirdparty-api/account_info Retrieve VFD account registration details
serial_info /vfd-thirdparty-api/serial_info Get device serial/registration information

Step-by-Step Setup

Step 1 — Create the VFD Provider Record

In ERPNext, navigate to VFD Provider (search for it in the search bar). Create a new document with the following values:

Field Value
VFD Provider (name) VFDPlus
Base URL https://app.vfdplus.co.tz
VFD Provider Settings VFDPlus Settings

Step 2 — Add the API Endpoint Attributes

In the Attributes child table, add each of the four endpoint rows below. These tell the VFD Providers app exactly which paths to call for each operation.

Key Value
post_fiscal_receipt /vfd-thirdparty-api/post_fiscal_receipt
receipt_info /vfd-thirdparty-api/receipt_info
account_info /vfd-thirdparty-api/account_info
serial_info /vfd-thirdparty-api/serial_info

Step 3 — Configure VFDPlus Settings

Navigate to VFDPlus Settings (the document referenced in the VFD Provider above). Enter your VFDPlus API credentials — typically a username/token and GC (Gain Code) or secret provided when you registered with VFDPlus. Consult your VFDPlus account dashboard for these values.

Step 4 — Set VFDPlus as the Active Provider

Go to VFD Settings and set the VFD Provider field to VFDPlus. Save the document.

Step 5 — Test the Connection

Use the Get Account Info or Get Serial Info button in VFD Settings to verify connectivity. A successful response will populate your TIN, VRN, and device serial fields from TRA via the VFDPlus API.


Provider JSON Reference

If you are setting this up via a fixture file or data migration, here is the complete VFD Provider JSON record for VFDPlus:

{
  "doctype": "VFD Provider",
  "vfd_provider": "VFDPlus",
  "base_url": "https://app.vfdplus.co.tz",
  "vfd_provider_settings": "VFDPlus Settings",
  "attributes": [
    {
      "key": "post_fiscal_receipt",
      "value": "/vfd-thirdparty-api/post_fiscal_receipt"
    },
    {
      "key": "receipt_info",
      "value": "/vfd-thirdparty-api/receipt_info"
    },
    {
      "key": "account_info",
      "value": "/vfd-thirdparty-api/account_info"
    },
    {
      "key": "serial_info",
      "value": "/vfd-thirdparty-api/serial_info"
    }
  ]
}

Using as a Fixture Save this JSON as vfd_provider/VFDPlus.json inside your custom app's fixtures folder, then run bench migrate to automatically import it on new site deployments.


API Endpoints Explained

POST /vfd-thirdparty-api/post_fiscal_receipt

Submits a fiscal receipt payload to TRA via VFDPlus. Called automatically on Sales Invoice submission when VFD is enabled.

GET /vfd-thirdparty-api/receipt_info

Retrieves the status and TRA acknowledgement for a previously submitted receipt by its receipt number.

GET /vfd-thirdparty-api/account_info

Returns the TRA-registered details for your account including TIN, VRN, and business registration name. Useful for initial setup verification.

GET /vfd-thirdparty-api/serial_info

Returns the device serial number and registration details that TRA has on file for your VFD device.


Troubleshooting

Receipts not being submitted

Check that the VFD Provider is set to VFDPlus in VFD Settings and that the Enable VFD checkbox is ticked. Also verify your API credentials in VFDPlus Settings are correct and not expired.

Connection errors / timeout

Confirm your ERPNext server has outbound internet access to app.vfdplus.co.tz on port 443. You can test with a simple curl https://app.vfdplus.co.tz from the server.

Wrong TIN or VRN populated

Run Get Account Info again from VFD Settings. If the data from VFDPlus is incorrect, the issue is with your VFDPlus account registration — contact VFDPlus support.

⚠️ Test in Sandbox First VFDPlus provides a sandbox/test environment. Always validate your integration there before going live to avoid submitting test receipts to TRA's production system.


Contributing

The VFD Providers app is open source and contributions are welcome. If you add support for a new VFD provider or improve existing functionality, please submit a pull request to the repository:

https://github.com/Aakvatech-Limited/vfd_providers


About

This guide was produced by Aakvatech Limited, an ERPNext implementation partner specialising in Tanzania statutory compliance, East African ERP deployments, and Frappe/ERPNext customisations.

VFDPlus is a product of its respective owners. This guide is provided for informational purposes.


No comments yet.

Add a comment
Ctrl+Enter to add comment