API Reference

Flutter Function Sample Responses

This section illustrates few examples with input params and the output responses for the Cardholder function

Overview

This section details down the sample function input params and output params for the cardholder service.

Function Details

Below are the sample input and output of the SDK functions.

Function NameDescriptionInput ParamsOutput Params
loginWithAuthTokenGenerates the cardholder token and fetch the cardholder basic details using the SDK Single Sign on Webhook implementationMap<String, dynamic> loginWithAuthTokendata = { "mobile": <mobile number>, // Card holder mobile number "sdkAuthToken": "suth#eree", // Auth token of the calling application (not of Card91) "primaryOrgId": <org id> // Organization Id } , context Context, env StringIn case of success:
{ "customer": { "createdTime": "2022-01-31T09:46:41.000+0000", "createdBy": "220123145106418ID1UID6609530", "modifiedTime": null, "modifiedBy": null, "status": "ACTIVE", "id": "220131151639396ID1CUSTID7491716", "dob": null, "gender": null, "mobile": "919876011170", "email": "[email protected]", "name": "Tandon Prakhar", "nameOnCard": "Tandon Prakhar", "invited": true, "firstTimeSignUp": true, "firstTimeLogin": true, "saltHash": 0, "wrongMpinCount": 0, "mpinResetCount": 0, "cardHolderPaymentSideId": "4120", "locale": null }, "cards": [ { "id": "220131151642500ID1CARD2791192", "status": "BLOCKED", "customerId": "220131151639396ID1CUSTID7491716", "lastFourDigits": "7501", "cardMode": "DIGITAL_ONLY_CARD", "orgName": "ABC Businsess", "cardImage": "" } ] }

In case of error like missing mandatory fields:
{ "success": false, "errorGroup": "INVALID_INPUT", "subErrorCode": "DATA_INVALID_IN_REQ", "message": "Mobile number with country code is needed", "error": true }

In case of missing information:
{ "message": "No Webhook URL found" }
getCardFlagsThis function fetches the card flags set for the card. The card flags include: POS, ATM, Ecom and Tap (or CL)Map <String, dynamic> getFlagsdata { 'cardId': <card id>, 'loginAuthToken': <Card91 Cardholder token> }, context Context, env StringIn case of success:
{ "cardFlags": { "ATM_ENABLED": true, "POS_ENABLED": true, "ECOM_ENABLED": true, "CL_ENABLED": true } }

In case of error like missing mandatory fields:
{ "message": "Card not found" }

In case of any other error information:
{ "message": "CardFlags Failed due to server error. Please try later" }
updateCardFlagsThis function updates the card flags for any cardMap <String, dynamic> updateCardFlagsdataFlag { 'cardId': <card id>, 'cardFlags': { 'ATM_ENABLED': false, 'POS_ENABLED': false, 'ECOM_ENABLED': true, 'CL_ENABLED': false } }, context Context, env StringIn case of success:
{ "cardFlags": { "ATM_ENABLED": true, "POS_ENABLED": false, "ECOM_ENABLED": true, "CL_ENABLED": false } }
lockCardLock card or temporary suspension of the card can be done via this function, This is a reversible process.Map <String, dynamic> lockCarddata = { 'cardId': <card id to be locked>, 'loginAuthToken': <Card 91 cardholder token>, 'lock': true }, contect Context, env StringIn case of success:
{ "message": "Card ending with 3068 is LOCKED", "id": <Card Id>, "status": "LOCKED", "customerId": <customer id>, "lastFourDigits": "3068", "cardMode": "DIGITAL_ONLY_CARD", "orgName": "ABC Business", "cardImage": "" }

In case of error like missing mandatory fields:
{ "success": false, "errorGroup": "INVALID_INPUT", "subErrorCode": "DATA_INVALID_IN_REQ", "message": "CardId is mandatory", "error": true }

In case of other failures:
{ "message": "Cannot act on a Blocked Card" }
blockCardOTPThe cardholder can block the card. As this is irreversible process, it is a 2 step process. (a) OTP generation and (b) Blocking the card. This function is the first step.Map <String, dynamic> blockCardOTPdata { 'cardId': '230705103521821ID1CARD0150896' }, context Context, env StringIn case of success:
{ "mobile": <mobile number starting with 91>, "sessionId": <32 bit UUID> //This session id is to be passed as param in the next function }

In case of error like missing mandatory fields:
{ "success": false, "errorGroup": "INVALID_INPUT", "subErrorCode": "DATA_INVALID_IN_REQ", "message": "CardId is mandatory", "error": true }

In case of other failures:
{ "message": "Card Is Already Blocked" }
blockCardConfirmationThis is the second step for blocking the card. After this the card is permanently blocked.Map <String, dynamic> data { 'cardId': '917096482153',/// String 'reason':"",/// String Possible values: LOST, STOLEN, DAMAGED 'sessionId':"",/// String 'otp':""/// String as received by the cardholder }, context Context, env StringIn case of success:
{ "message": "Card ending with 3068 is BLOCKED", "id": "220202094138773ID1CARD6090768", "status": "BLOCKED", "customerId": "220131151639396ID1CUSTID7491716", "lastFourDigits": "3068", "cardMode": "DIGITAL_ONLY_CARD", "orgName": "ABC Businsess", "cardImage": "" }
In case of error like missing mandatory fields:
{ "success": false, "errorGroup": "INVALID_INPUT", "subErrorCode": "DATA_INVALID_IN_REQ", "message": "CardId is mandatory", "error": true }
getCardLimitUse this function to fetch the card limits set for each card flags on a monthly or per transaction basis.Map <String, dynamic> getCardLimitdata = { 'loginAuthToken': "C91CHoq2DVMFut2xI8UvtbZ4CFdppHQfWVq8qdMt2cETcQdI=", //Auth token 'cardID': '230705103521821ID1CARD0150896', // cardId of the card holder }, context Context, env String{ "cardRules": [ { "txnType": "ECOM", "period": "M", //Monthly "maxLimit": "10000", "userLimit": "200", "consumedLimit": "00", "enabled": false }, { "txnType": "ECOM", "period": "D", //Daily "maxLimit": "10000", "userLimit": "10000", "enabled": false }, { "txnType": "ECOM", "period": "T", //Transaction "maxLimit": "10000", "userLimit": "100", "enabled": false }, { "txnType": "ATM", "period": "M", "maxLimit": "10000", "userLimit": "10000", "consumedLimit": "00", "enabled": true }, { "txnType": "ATM", "period": "D", "maxLimit": "10000", "userLimit": "10000", "enabled": true }, { "txnType": "POS", "period": "M", "maxLimit": "10000", "userLimit": "10000", "consumedLimit": "00", "enabled": true }, { "txnType": "POS", "period": "D", "maxLimit": "10000", "userLimit": "10000", "enabled": true }, { "txnType": "POS", "period": "T", "maxLimit": "10000", "userLimit": "10000", "enabled": true }, { "txnType": "CL", "period": "M", "maxLimit": "10000", "userLimit": "10000", "consumedLimit": "00", "enabled": false }, { "txnType": "CL", "period": "D", "maxLimit": "10000", "userLimit": "10000", "enabled": false }, { "txnType": "CL", "period": "T", "maxLimit": "5000", "userLimit": "5000", "enabled": false } ] }
setCardLimitUse this function to set the card limits set for each card flags on a monthly and per transaction basis.List <Map <String, dynamic>> setCardLimitdata [ { "txnType": "ECOM", "userLimit": "200", "maxLimit": "10000", "period": "M", "enabled": false }, { "txnType": "ECOM", "userLimit": "10000", "maxLimit": "10000", "period": "D", "enabled": false }, { "txnType": "ECOM", "userLimit": "10", "period": "M", "maxLimit": "10000", "enabled": false }, { "txnType": "CL", "userLimit": "10000", "maxLimit": "10000", "period": "D", "enabled": false }, { "txnType": "CL", "userLimit": "5000", "maxLimit": "5000", "period": "T", "enabled": false }, ], context Context, env String{ "cardRules": [ { "txnType": "ECOM", "period": "M", "maxLimit": "10000", "userLimit": "200", "consumedLimit": "00", "enabled": false }, { "txnType": "ECOM", "period": "D", "maxLimit": "10000", "userLimit": "10000", "enabled": false }, { "txnType": "ECOM", "period": "T", "maxLimit": "10000", "userLimit": "10", "enabled": false }, { "txnType": "ATM", "period": "M", "maxLimit": "10000", "userLimit": "10000", "consumedLimit": "00", "enabled": true }, { "txnType": "ATM", "period": "D", "maxLimit": "10000", "userLimit": "10000", "enabled": true }, { "txnType": "POS", "period": "M", "maxLimit": "10000", "userLimit": "10000", "consumedLimit": "00", "enabled": true }, { "txnType": "POS", "period": "D", "maxLimit": "10000", "userLimit": "10000", "enabled": true }, { "txnType": "POS", "period": "T", "maxLimit": "10000", "userLimit": "10000", "enabled": true }, { "txnType": "CL", "period": "M", "maxLimit": "10000", "userLimit": "10000", "consumedLimit": "00", "enabled": false }, { "txnType": "CL", "period": "D", "maxLimit": "10000", "userLimit": "10000", "enabled": false }, { "txnType": "CL", "period": "T", "maxLimit": "5000", "userLimit": "5000", "enabled": false } ] }
getCardWalletDetailsFetches the Wallet details of a cardMap <String, dynamic> getCardWalletDetailsdata = { 'cardId': <Card Id>, 'loginAuthToken': <Card91 Cardholder token> }, context Context, env StringIn case of success:
{ "wallets": [ { "appId": "2891fab5-c206-4298-9a79-841b7719ac9c", "orgId": "220123145103837ID1OID9785460", "ledgerOrgId": "220123145103837ID1OID9785460", "groupId": "220131151346486ID1CP7441240", "name": "Default App", "status": "ACTIVE", "description": "default application", "balanceType": "PREPAID", "startingBalance": "0.0000", "startingBalanceValidityPeriod": null, "allowCustomerMoneyLoad": false, "rulesJson": { "version": "1", "zeroFilterMatchBehaviour": false, "balanceType": "PREPAID", "rules": \[] }, "createdAt": "2022-01-31T09:45:12.000Z", "updatedAt": "2022-01-31T09:45:12.000Z", "priority": 1, "splitTxn": "ALLOW", "balance": "0.0000" } ] }

In case of error like missing mandatory fields:
{ "message": "No Card Found with the Card Id" }
addBeneficiaryService to add beneficiary at the card holder level.Map<String, dynamic> addBeneficiarydata = {
"issuerCode": "YES",// Issuer code
"accountNumber": "BBB1916624", /// Account number of the bene account
"ifscCode": "NSDL0006184", // IFSC code of bene account bank
"name": "Niket Rawat" /// Name on account
};
{beneficiaryId: 230922064603898ID1BENF1322650}
getAllBeneficiaryService to get all beneficiaryMap<String, dynamic> getAllBeneficiarydata = {
"issuerCode": "YES", // Issuer code
"ifscCode": "NSDL0006184", /// ifsc code of the bene
"name": "Niket Rawat", // account holder name
'page': "1",
"mobileNo": "917096482153",// bene mobile number (optional)
'perPage': "25", // for pagination
'loginAuthToken': "C91CHIRmv9fxiWvZgqk2YkLP+HwIrGOMwfvk0873bmsG0KAs=" // card holder auth token
};
{
"success": true,
"headers": {
"connection": "keep-alive",
"cache-control": "no-cache, no-store, max-age=0, must-revalidate",
"date": "Fri, 22 Sep 2023 06:08:21 GMT",
"transfer-encoding": "chunked",
"vary": "Origin,Access-Control-Request-Method,Access-Control-Request-Headers",
"strict-transport-security": "max-age=31536000 ; includeSubDomains",
"x-frame-options": "DENY",
"pragma": "no-cache",
"content-type": "application/json",
"x-xss-protection": "1; mode=block",
"x-content-type-options": "nosniff",
"expires": "0"
},
"data": {
"recordsCurrentPage": 1,
"currentPage": 1,
"totalPages": 1,
"totalRecords": 1,
"beneficiaries": [
{
"id": "230816131708992ID1BENF4851640",
"name": "Niket Rawat",
"accountNumber": "BBB1916624",
"ifscCode": "NSDL0006184",
"associatedIssuer": "NSDL",
"createdTime": "2023-08-16T13:17:09.000+00:00",
"lastModifiedTime": null
}
]
}
}
getBeneficiaryDetailsService to get beneficiary details Map<String, dynamic> getBeneficiaryDetailsdata = {
'beneficiaryId':
"230712125533217ID1BENF6095840", // bene Id
'loginAuthToken': "C91CHIRmv9fxiWvZgqk2YkLP+HwIrGOMwfvk0873bmsG0KAs=" // auth token
};
{id: 230816131708992ID1BENF4851640, name: Niket Rawat, accountNumber: BBB1916624, ifscCode: NSDL0006184, associatedIssuer: NSDL, maxPermissibleLimit: 200000.0000, createdTime: 2023-08-16T13:17:09.000+00:00, lastModifiedTime: null}
transferMoneyToBeneficiaryTransfer money to beneficiaryMap<String, dynamic> transferMoneyToBeneficiarydata = {
'beneficiaryId':
"230712125533217ID1BENF6095840", // bene id
'amount': "500", // amount transfferring
'transferMethod': "IMPS" // mode
};
getBeneficiaryTransactionsMap<String, dynamic> getBeneficiaryTransactionsdata = {
'loginAuthToken': "C91CHXg9qzUuDzh1VzjNCOaPnxw5wi7430wRTsZFsOR1xGyc=", //Auth token
'beneficiaryId': "230714095131301ID1BENF5758415", //bene id
'transferStatus': "", // transaction status
'txnMethod': "0",
'page': "1",
'perPage': "2",
'from': "",
'to':""
};