9. Third Party Net Settlement
Third party net settlement is for processing of final settlements for PSO or other institutions through NCHL towards RTGS. Such PSO or other institutions will use this API to initiate their multilateral net settlement of their member BFIs against the transactions processed in their system and settlement processed through NCHL. For processing the net settlement files, PSO or any other institutions has to be the member of NPI and their corresponding BFIs also has to be member of underlying real time payment system and RTGS.
Process Flow
- NPI member will send a net settlement message through NPI in a specified session, which will then authenticate the originating member prior to receiving and/or processing the message. Such authentication mechanism will be as prescribed in NPI technical specification document.
- NPI will route the message to PSO settlement engine for recording, necessary business validations and conversion to net settlement integration (NSI).
- The PSO settlement engine further transmit the transaction details to each of the participating BFIs, included in the file, to verify and confirm the transaction using Bank Central Module provided by NCHL. For net debit position, the BFI will debit the member’s account, corresponding to which necessary controls will be established by debiting member.
- NSI will be processed on ‘All or None’ basis and at specified time schedule, such that the NSI will be sent to RTGS only after the transactions are approved by the respective BFIs. If a transaction is rejected by any of the BFIs, then the NSI file will be retuned as rejected to the member, corresponding to which it will have to resend the file again for necessary approval and processing, after resolving the reason for rejection.
- Based on RTGS response, the status of the respective transactions will be updated and also a response of NSI will be updated to be pulled by the member.
Figure:PSO Third party settlement process flow diagram
POST URL: /psosettlement/v1/postbatch
Request Parameters:
# | Field Name | Data Type | Length | Description | Presence |
---|---|---|---|---|---|
1 | batchDetails | Object | Details of all transactions in batch form | Y | |
1.1 | msgId | String | 35 | Message for the NCHL settlement | Y |
1.2 | batchCount | Integer | Count number of transactions in a batch | Y | |
1.3 | ctrlSum | Big Decimal | (16,2) | Total batch amount sum | Y |
1.4 | totalDebit | Big Decimal | (16,2) | Total batch debit sum | Y |
1.5 | totalCredit | Big Decimal | (16,2) | Total batch credit sum | Y |
1.6 | settlementDate | Date | Date of settlement | Y | |
1.7 | currencyCode | String | 3 | Currency code of transaction | Y |
2 | transactionDetailsList | List | List of all the transaction inputs | Y | |
2.1 | instructionId | String | 35 | Unique identification for the transaction for reconciliation purpose later. | Y |
2.2 | endToEndId | String | 35 | Identification reference for both sender and receiver. | Y |
2.3 | amount | Big Decimal | 13,2 | The amount to be transferred through this transaction. | Y |
2.4 | bankId | String | 4 | NCHL from bank Id | Y |
2.5 | txnId | String | 35 | Transaction Id | Y |
2.6 | drCr | String | 2 | DR: debit or CR: credit | Y |
2.7 | instrForNxtAgnt1 | String | 35 | Instruction message/id for next agent1 | O |
2.8 | instrForNxtAgnt2 | String | 35 | Instruction message/id for next agent2 | O |
3 | Token | String | Token string Generated | Y |
Token Generation Process:
The token string is the combination of batch and transactions information and following will be the format.
Batch String = <msgId> + "," + <batchCount> + "," + <ctrlSum> + "," + <totalDebit> + "," + <totalCredit> + "," +<settlementDate> + "," + <currencyCode(e.g. NPR)>
For each transaction
{Transaction String = Transaction String + "," + <instructionId> + "," + <endToEndId> + "," + <amount> + "," +<bankId> + "," + <txnId> + "," + <drCr> }
Token String = Batch String + Transaction String + "," + <user Id>
Generate signed hash value of token string using private key of provided certificate. Send the generate hash value in “token” field.
Sample Request
{
"batchDetails":{
"msgId":"FONEPAY-SETTL-123",
"batchCount":4,
"ctrlSum":14000.00,
"totalDebit":7000.00,
"totalCredit":7000.00,
"settlementDate":"2021-06-08",
"currencyCode":"NPR"
},
"transactionDetailsList":[
{
"endToEndId":"FONEPAY SETTLEMENT",
"txnId":"FONEPAY-1633238261",
"instructionId":"FONEPAY-1633238261",
"amount":5000.00,
"bankId":"0201",
"drCr":"CR",
"instrForNxtAgnt1":null,
"instrForNxtAgnt2":null
},
{
"endToEndId":"FONEPAY SETTLEMENT",
"txnId":"FONEPAY-1633238270",
"instructionId":"FONEPAY-1633238270",
"amount":5000.00,
"bankId":"0301",
"drCr":"DR",
"instrForNxtAgnt1":null,
"instrForNxtAgnt2":null
},
{
"endToEndId":"FONEPAY SETTLEMENT",
"txnId":"FONEPAY-1633238263",
"instructionId":"FONEPAY-1633238263",
"amount":2000.00,
"bankId":"0401",
"drCr":"CR",
"instrForNxtAgnt1":null,
"instrForNxtAgnt2":null
},
{
"endToEndId":"FONEPAY SETTLEMENT",
"txnId":"FONEPAY-1633238272",
"instructionId":"FONEPAY-1633238272",
"amount":2000.00,
"bankId":"1701",
"drCr":"DR",
"instrForNxtAgnt1":null,
"instrForNxtAgnt2":null
}
],
"token":"BgKY+/BQ9z+hgfvAKk1eiD7U+zlr3LPOL0h0/Y1qfUcJ0s98iNdCZMuQsiaJL4Qz/aJCCjJS1/UmWbOrBpYLp66jM2i1b3+Hmbqo0NTay/kTcHhicmVtOQAA/W8x5Nfs1CdSw8Om7nIG+d8ixWJPEaW6N4HZU6vXRLX1PIfplfKs+ZGYGTarAPpxXZjm++7m3n/UNeXVZP/rEztxSU1N/u07mWpiJWjA6bdwt7UYKXq4QKF2abnP0wMJWDl4VgdxbE9Lf9/a7LLI9OEXLQlQgFCY4N+U6ByCwOXiHdjUza7tUGO/vugpFKKONKyLl/7vRw4XTnEGmorB2/nI0QcN4Q=="
}
Sample Response
{
"responseResult":{
"fieldErrors":[
],
"responseDescription":"SUCCESS",
"responseCode":"000"
},
"batchDetails":{
"msgId":"FONEPAY-SETTL-123",
"batchCount":4,
"ctrlSum":14000.00,
"totalDebit":7000.00,
"totalCredit":7000.00,
"settlementDate":"2021-06-08",
"currencyCode":"NPR"
},
"transactionDetailsList":[
{
"endToEndId":"FONEPAY SETTLEMENT",
"txnId":"FONEPAY-1633238261",
"instructionId":"FONEPAY-1633238261",
"amount":5000.00,
"bankId":"0201",
"drCr":"CR",
"instrForNxtAgnt1":null,
"instrForNxtAgnt2":null
},
{
"endToEndId":"FONEPAY SETTLEMENT",
"txnId":"FONEPAY-1633238270",
"instructionId":"FONEPAY-1633238270",
"amount":5000.00,
"bankId":"0301",
"drCr":"DR",
"instrForNxtAgnt1":null,
"instrForNxtAgnt2":null
},
{
"endToEndId":"FONEPAY SETTLEMENT",
"txnId":"FONEPAY-1633238263",
"instructionId":"FONEPAY-1633238263",
"amount":2000.00,
"bankId":"0401",
"drCr":"CR",
"instrForNxtAgnt1":null,
"instrForNxtAgnt2":null
},
{
"endToEndId":"FONEPAY SETTLEMENT",
"txnId":"FONEPAY-1633238272",
"instructionId":"FONEPAY-1633238272",
"amount":2000.00,
"bankId":"1701",
"drCr":"DR",
"instrForNxtAgnt1":null,
"instrForNxtAgnt2":null
}
]
}
Failed Response
Error details in responseResult (i.e. responseCode, responseDescription and fieldErrors) respectively
{
"responseCode":"E007",
"responseDescription":"TECHNICAL VALIDATION FAILED",
"fieldErrors":[
{
"field":"batchDetails.batchCount",
"message":"Batch size exceeded!"
}
]
}