-
createAccountPolicyCheck
- This method creates a policy for a specified account. This method can be called only by a
Token Admin or Org Admin of the specified organization.
createAccountPolicyCheck(asset: AccountPolicyCheck)
- Parameters:
asset: AccountPolicyCheck class – A class that defines account policy parameters, which includes the following fields:
accountPolicyId – The system generates this ID from the specified orgId and userId fields. You do not provide this field manually.
orgId – The membership service provider (MSP) ID of the user to create the policy for.
userId – The user name or email ID of the user to create the policy for.
kycCompliance – A Boolean value that indicates whether the account satisfies KYC (Know Your Customer) requirements.
amlCompliance – A Boolean value that indicates whether the account satisfies AML (Anti-Money Laundering) requirements.
riskScore – The risk score associated with the account, which is used for compliance evaluation.
restrictionFlag – A Boolean value that indicates whether the account is subject to restricted transfers. If set to true, only transfers within the lowest approval-policy threshold are allowed.
- Return Value Example:
{
"returnCode": "Success",
"error": "",
"result": {
"txid": "02875ca9c6a7408da3f81156214228b91b09c4bb2b8026d7a5733b53598c6635",
"payload": {
"assetType": "AccountPolicyCheck",
"accountPolicyId": "APID~CentralBank~cb__creator_demo",
"orgId": "CentralBank",
"userId": "cb__creator_demo",
"kycCompliance": "true",
"amlCompliance": "true",
"riskScore": 1000,
"restrictionFlag": "false"
},
"encode": "JSON",
"sourceURL": "centralbank-oabcs1-nrt.blockchain.ocp.example.com:20010",
"blockNumber": 272
}
}
-
getAccountPolicyCheckById
- This method gets the account policy details for a specified policy ID. This method can be called only by a
Token Admin or Token Auditor, or an Org Admin or Org Auditor of the specified organization.
getAccountPolicyCheckById(id: string)
- Parameters:
id: string – The unique account policy ID.
- Return Value Example:
{
"returnCode": "Success",
"error": "",
"result": {
"txid": "02875ca9c6a7408da3f81156214228b91b09c4bb2b8026d7a5733b53598c6635",
"payload": {
"assetType": "AccountPolicyCheck",
"accountPolicyId": "APID~CentralBank~cb__creator_demo",
"orgId": "CentralBank",
"userId": "cb__creator_demo",
"kycCompliance": "true",
"amlCompliance": "true",
"riskScore": 1000,
"restrictionFlag": "false"
},
"encode": "JSON",
"sourceURL": "centralbank-oabcs1-nrt.blockchain.ocp.example.com:20010",
"blockNumber": 272
}
}
-
updateAccountPolicyCheck
- This method updates the policy for a specified account. This method can be called only by a
Token Admin or Org Admin of the specified organization.
updateAccountPolicyCheck(asset: AccountPolicyCheck)
- Parameters:
asset: AccountPolicyCheck class – A class that defines account policy parameters, which includes the following fields:
accountPolicyId – The unique account policy ID.
orgId – The membership service provider (MSP) ID of the user to create the policy for.
userId – The user name or email ID of the user to create the policy for.
kycCompliance – A Boolean value that indicates whether the account satisfies KYC (Know Your Customer) requirements.
amlCompliance – A Boolean value that indicates whether the account satisfies AML (Anti-Money Laundering) requirements.
riskScore – The risk score associated with the account, which is used for compliance evaluation.
restrictionFlag – A Boolean value that indicates whether the account is subject to restricted transfers. If set to true, only transfers within the lowest approval-policy threshold are allowed.
- Return Value Example:
{
"returnCode": "Success",
"error": "",
"result": {
"txid": "02875ca9c6a7408da3f81156214228b91b09c4bb2b8026d7a5733b53598c6635",
"payload": {
"assetType": "AccountPolicyCheck",
"accountPolicyId": "APID~CentralBank~cb__creator_demo",
"orgId": "CentralBank",
"userId": "cb__creator_demo",
"kycCompliance": "true",
"amlCompliance": "true",
"riskScore": 1000,
"restrictionFlag": "true"
},
"encode": "JSON",
"sourceURL": "centralbank-oabcs1-nrt.blockchain.ocp.example.com:20010",
"blockNumber": 272
}
}
-
deleteAccountPolicyCheck
- This method deletes the policy for a specified policy ID. This method can be called only by a
Token Admin or Org Admin of the specified organization.
deleteAccountPolicyCheck(id: string)
- Parameters:
id: string – The unique account policy ID.
- Return Value Example:
{
"returnCode": "Success",
"error": "",
"result": {
"txid": "5499f49ae8595facbcbf56835bed9e6606875c0f54fd3cacb31a4104b56d3579",
"payload": {
"isValid": true,
"message": "Successfully deleted asset with ID [APID~CentralBank~cb__creator_demo] from ledger"
},
"encode": "JSON",
"sourceURL": "centralbank-oabcs1-nrt.blockchain.ocp.example.com:20010",
"blockNumber": 273
}
}
-
getAccountPolicyCheckHistoryById
- This method gets the complete account policy history for a specified policy ID. This method can be called only by a
Token Admin or Token Auditor, or an Org Admin or Org Auditor of the specified organization.
getAccountPolicyCheckHistoryById(id: string)
- Parameters:
id: string – The unique account policy ID.
- Return Value Example:
{
"returnCode": "Success",
"error": "",
"result": {
"payload": [
{
"trxId": "dbfd34199bc5ea7224ca6c9976e30166dc859923ab044e595d0d42ad842eb471",
"timeStamp": "2025-11-20T21:36:29.000Z",
"value": {
"assetType": "AccountPolicyCheck",
"accountPolicyId": "APID~CentralBank~cb__creator_demo",
"orgId": "CentralBank",
"userId": "cb__creator_demo",
"kycCompliance": "true",
"amlCompliance": "true",
"riskScore": 1000,
"restrictionFlag": "true"
}
},
{
"trxId": "8b6951a4093f3bb79a489397878f9025ce4384c8973a0c4d0ec9c618667e8935",
"timeStamp": "2025-11-20T21:35:34.000Z",
"value": {
"assetType": "AccountPolicyCheck",
"accountPolicyId": "APID~CentralBank~cb__creator_demo",
"orgId": "CentralBank",
"userId": "cb__creator_demo",
"kycCompliance": "true",
"amlCompliance": "true",
"riskScore": 1000,
"restrictionFlag": "false"
}
},
{
"trxId": "5499f49ae8595facbcbf56835bed9e6606875c0f54fd3cacb31a4104b56d3579",
"timeStamp": "2025-11-20T21:34:03.000Z",
"value": "KEY DELETED"
},
{
"trxId": "02875ca9c6a7408da3f81156214228b91b09c4bb2b8026d7a5733b53598c6635",
"timeStamp": "2025-11-20T21:33:24.000Z",
"value": {
"assetType": "AccountPolicyCheck",
"accountPolicyId": "APID~CentralBank~cb__creator_demo",
"orgId": "CentralBank",
"userId": "cb__creator_demo",
"kycCompliance": "true",
"amlCompliance": "true",
"riskScore": 1000,
"restrictionFlag": "false"
}
}
],
"encode": "JSON"
}
}
-
getAccountPolicyCheckByRange
- This method gets all policy history for a specified range of policy IDs. This method can be called only by a
Token Admin or Org Admin of the specified organization.
getAccountPolicyCheckByRange(startId: string, endId: string)
- Parameters:
startId: string – The starting account policy ID of the range (inclusive).
endId: string – The ending account policy ID of the range (exclusive).
- Return Value Example:
{
"returnCode": "Success",
"error": "",
"result": {
"payload": [
{
"assetType": "AccountPolicyCheck",
"accountPolicyId": "APID~CentralBank~cb__creator_demo",
"orgId": "CentralBank",
"userId": "cb__creator_demo",
"kycCompliance": "true",
"amlCompliance": "true",
"riskScore": 1000,
"restrictionFlag": "true"
},
{
"assetType": "AccountPolicyCheck",
"accountPolicyId": "APID~CentralBank~cb_issuer_demo",
"orgId": "CentralBank",
"userId": "cb_issuer_demo",
"kycCompliance": "true",
"amlCompliance": "true",
"riskScore": 1000,
"restrictionFlag": "false"
}
],
"encode": "JSON"
}
}