Skip to main content

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

  1. 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.
  2. NPI will route the message to PSO settlement engine for recording, necessary business validations and conversion to net settlement integration (NSI).
  3. 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.
  4. 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.
  5. 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.

Example Image

Figure:PSO Third party settlement process flow diagram

POST URL: /psosettlement/v1/postbatch

Request Parameters:

#Field NameData TypeLengthDescriptionPresence
1batchDetailsObjectDetails of all transactions in batch formY
1.1msgIdString35Message for the NCHL settlementY
1.2batchCountIntegerCount number of transactions in a batchY
1.3ctrlSumBig Decimal(16,2)Total batch amount sumY
1.4totalDebitBig Decimal(16,2)Total batch debit sumY
1.5totalCreditBig Decimal(16,2)Total batch credit sumY
1.6settlementDateDateDate of settlementY
1.7currencyCodeString3Currency code of transactionY
2transactionDetailsListListList of all the transaction inputsY
2.1instructionIdString35Unique identification for the transaction for reconciliation purpose later.Y
2.2endToEndIdString35Identification reference for both sender and receiver.Y
2.3amountBig Decimal13,2The amount to be transferred through this transaction.Y
2.4bankIdString4NCHL from bank IdY
2.5txnIdString35Transaction IdY
2.6drCrString2DR: debit or CR: creditY
2.7instrForNxtAgnt1String35Instruction message/id for next agent1O
2.8instrForNxtAgnt2String35Instruction message/id for next agent2O
3TokenStringToken string GeneratedY

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!"
}
]
}