Introduction
This document details how a third party system can post a voucher to DIGIT Finance. One can push a receipt or a Journal voucher to the Finance system using the APIs. It is very normal for a state or a city to have multiple third party applications used along with DIGIT Finance. In such cases, all the revenues, demands and bills from various sources need to be accounted to the Finance system. This is possible using the voucher integration APIs.
High-Level Design
Finance system exposes a REST API to create the voucher which is authenticated. This API needs to be called after the creation of a collection receipt or bill creation. This will push a voucher in the Finance system with relevant information like - source module, the amount collected, mode of collection and so on.
Low-Level Design
For the creation of a voucher, one should call the /rest/voucher/_create endpoint which is referred to in this contract. One voucher is created in the Finance system in approved status for a receipt or bill that is pushed. In order to make sure multiple vouchers are not created for any record, pass the reference number and billing service appropriately. There is another API /rest/voucher/_search to search for any voucher.
Collections can be made in - Cash, Cheque, DD, online. There are different chartofaccounts configured for each of these instruments. The third-party system will have to pass the correct account code while creating a voucher. DIGIT Finance will be the source of truth for chartofaccount code. This is applicable for all the masters that are required for a voucher, like- Fund, Function, Department and any other.
For Online collections, the money will be either directly debited to the bank or to a cash in transit account. Configuration needs to be done based on the state/city requirement.
Back update the source system for voucher reference if required.
Sample payload
https://hostname/services/EGF/rest/voucher/_create
{
"tenantId": "pb.jalandhar",
"RequestInfo": {
"apiId": null,
"ver": null,
"ts": null,
"action": null,
"did": null,
"key": null,
"msgId": null,
"authToken": "9ad4ab73-1df3-4b19-9aa5-9a7a9cddeb20",
"correlationId": null,
"userInfo": {
"id": 26273,
"userName": "TEST-13",
"name": "Atique",
"type": "EMPLOYEE",
"mobileNumber": null,
"emailId": null,
"roles": []
}
},
"vouchers": [
{
"id": null,
"name": "Revenue Grants",
"type": "Receipt",
"voucherNumber": null,
"description": "Revenue Grants Receipt",
"voucherDate": "27/04/2020",
"fund": {
"id": null,
"name": null,
"code": "01",
"identifier": null,
"level": null,
"parentId": null,
"isParent": null,
"active": null
},
"function": {
"id": null,
"name": null,
"code": "000201",
"level": null,
"active": null,
"isParent": null,
"parentId": null
},
"fiscalPeriod": null,
"status": null,
"originalVhId": null,
"refVhId": null,
"cgvn": null,
"moduleId": 10,
"department": "DEPT_25",
"source": "/services/collection/receipts/receipt-viewReceipts.action?selectedReceipts=f7ceea77-559a-4684-b18d-5de6b8ef8f7b",
"scheme": {
"id": null,
"code": null
},
"subScheme": null,
"functionary": {
"id": null,
"code": null
},
"fundsource": null,
"ledgers": [
{
"id": null,
"orderId": null,
"glcode": "1601001",
"debitAmount": 0,
"creditAmount": 1635,
"function": {
"id": null,
"name": null,
"code": "000201",
"level": null,
"active": null,
"isParent": null,
"parentId": null
},
"subledgerDetails": []
},
{
"id": null,
"orderId": null,
"glcode": "4501003",
"debitAmount": 1635,
"creditAmount": 0,
"function": {
"id": null,
"name": null,
"code": "000201",
"level": null,
"active": null,
"isParent": null,
"parentId": null
},
"subledgerDetails": []
}
],
"tenantId": "pb.jalandhar",
"referenceDocument": "f7ceea77-559a-4684-b18d-5de6b8ef8f7b",
"serviceName": "REV_GRANTS"
}
]
}
--------------------------------------------------------------------------------------------------------------------------
https://hostname/services/EGF/rest/voucher/_search
{
"tenantId": "pb.amritsar",
"RequestInfo": {
"apiId": "Mihy",
"ver": ".01",
"ts": null,
"action": "_update",
"did": "1",
"key": "",
"msgId": "20170310130900|en_IN",
"authToken": "ea51399b-7d31-4cc3-9d5a-c0c7a1ced490",
"correlationId": "7f3636d5-1e7d-45f6-9a8c-89b07524b7d7",
"userInfo": {
"id": 27492,
"userName": "9182541372",
"name": "lakshmi",
"type": "CITIZEN",
"mobileNumber": "9949565420",
"emailId": "fdfgg@gmail.com",
"roles": [
{
"id": null,
"name": "Citizen"
},
{
"id": null,
"name": "BPA Engineer"
},
{
"id": null,
"name": "BPA Architect"
}
]
}
},
"voucherNumbers": "1/BRV/00000103/05/2020-21, 1/BRV/00000103/06/2020-21"
}
Steps to configure
- Make sure all the common masters that are used for voucher creation are in sync with the two systems.
- If a city has a specific bank account to which the money needs to be accounted for online collection, configure the bank account in DIGIT Finance as well as in third-party application with the account code kept same.
- Write a kafka consumer to post the voucher to DIGIT Finance when collection happens. Keeping the two asynchronous is better.
- Create a new role for "Finance System Integrator" in DIGIT Finance.
- Create a new user with type as "SYSTEM" and role as "Finance System Integrator".
- Share the user credentials to the third-party system for them to pass it as part of the authentication key.