Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

...

/rest/voucher/_cancel API is used to cancel a voucher that is created from the third-party system.

Sample payload

For calling any of the voucher APIs authentication is mandatory. Use the below-mentioned API for getting the authentication token which then can be passed as "authToken" to the voucher APIs request. The values for "access_token" will be passed as the "authToken" value in the other APIs.

Access Token Generation API: https://staging.egovernments.org/user/oauth/token

Request:

{
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/x-www-form-urlencoded"
},
{
"key": "Authorization",
"value": "Basic ZWdvdi11c2VyLWNsaWVudDplZ292LXVzZXItc2VjcmV0"
}
],
"url": {
"raw": "https://staging.egovernments.org/user/oauth/token",
"protocol": "https"
},
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "username",
"value": "EMP2_SU",
"type": "text"
},
{
"key": "scope",
"value": "read",
"type": "text"
},
{
"key": "password",
"value": "EMPSU01234",
"type": "text"
},
{
"key": "grant_type",
"value": "password",
"type": "text"
},
{
"key": "tenantId",
"value": "pg.citya",
"type": "text"
},
{
"key": "userType",
"value": "EMPLOYEE",
"type": "text"
}
]
}
}

Response:

{
"access_token": "594caf72-808c-437f-af0c-f64976e9b831",
"token_type": "bearer",
"refresh_token": "abcd5ac2-9099-439d-9126-37b3b6e49ae0",
"expires_in": 604527,
"scope": "read",
"ResponseInfo": {
"api_id": "",
"ver": "",
"ts": "",
"res_msg_id": "",
"msg_id": "",
"status": "Access Token generated successfully"
},
"UserRequest": {
"id": 1389,
"uuid": "7e9e676f-60d1-426f-861c-0cfdd5a8a572",
"userName": "EMP2_SU",
"name": "EMP2_SU",
"mobileNumber": "1111111112",
"emailId": null,
"locale": null,
"type": "EMPLOYEE",
"roles": [
{
"name": "HRMS ADMIN",
"code": "HRMS_ADMIN",
"tenantId": "pg.citya"
},
{
"name": "BPA Services verifier",
"code": "BPA_VERIFIER",
"tenantId": "pg.citya"
},
{
"name": "Super User",
"code": "SUPERUSER",
"tenantId": "pg"
},
{
"name": "Super User",
"code": "SUPERUSER",
"tenantId": "pg.citya"
}
],
"active": true,
"tenantId": "pg.citya"
}
}

...

https://citya.egovernments.org/services/EGF/rest/voucher/_create

...