API Reference

NPM Service Function Sample Response

This section details down the sample responses that the service functions will return in different use cases.

Overview

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

Function Details

The table below describes for the

Function NameDescriptionInput ParamsOutput Params
GetCardDetailsFetches the card details of a given cardconfig as JSON:
{ token: string; environment: Environment; }

payload as JSON:
{ body: {}, params: { cardId: string; mobileNo: string, customerId:string} }
{ "id": "220302125958438ID1CARD2969658", "customerId": "220302125957937ID1CUSTID3592592", "cardProgramId": "220302123956568ID1CP5759277", "cardProgramName": "Card Programd Name", "orgId": "220225150636240ID1OID1237916", "orgName": "Maiden World", "cardMode": "PHYSICAL_NAMED_CARD", "instakit": false, "last4Digit": "2559", "createdBy": "220225150638629ID1UID7697748", "modifiedBy": null, "expiredBy": null, "modifiedTime": null, "createdTime": "2022-03-02T13:01:22.000+00:00", "status": "ACTIVE", "cardImage": null, "wallets": { "cardId": "220302125958438ID1CARD2969658", "totalBalance": "0", "virtualBalance": "0", "prepaidBalance": "0", "otherBalance": "0", "appBalances": [ { "appId": "6f016f88-0f96-4e59-912d-4cd477faf272", "appName": "Default App2", "balance": "0.0000", "balanceType": "PREPAID", "countInBalance": true }, { "appId": "4af01c6c-18fc-4e13-9a0f-9f734de7883c", "appName": "Default App1", "balance": "0.0000", "balanceType": "PREPAID", "countInBalance": true } ] }, "cardFlags": { "ATM_ENABLED": true, "POS_ENABLED": true, "ECOM_ENABLED": true, "CL_ENABLED": true }, "issuerCode": "YES", "network": "VISA" }
GetCardholderStatusThis function fetches the details of the cardholderconfig as JSON:
{ token: string; environment: Environment; }

payload as JSON:
{ body: {}, params: { mobileNo: string } }
{ "cardHolderId": "220520133511072ID1CUSTID0351717", "name": "Amitkumar Gupta", "nameOnCard": "Amitkumar Gupta", "email": "[email protected]", "mobile": "919998880075", "status": "ACTIVE", "createdAt": "2022-05-20T13:35:11.000+00:00", "kycStatus": [ { "issuerCode": "SBM", "kycStatus": "COMPLETED", "kycType": "SBM_MIN_DETAILED" } ], "cards": [ { "cardId": "220520133511123ID1CARD7993631", "status": "INACTIVE", "last4CardDigits": "5862", "cardMode": "DIGITAL_ONLY_CARD", "cardImageUrl": null, "orgId": "220401113826049ID1OID2442073", "createdAt": "2022-05-20T13:35:15.000+00:00" } ], "addresses": [ { "addressType": "DELIVERY_ADDRESS", "status": "PENDING", "address1": "KALYAN", "address2": null, "landmark": null, "city": "Thane", "countryISOCode": "IND", "pincode": "421306", "state": "MAHARASHTRA", "latitude": 0.0, "longitude": 0.0 } ] }
LoadFundToCardUse this function when business wants to load a particular cardconfig as JSON:
{ token: string; environment: Environment; }

payload as JSON:
{ body: { "refId": "ref-DEMO-id-1", "cardId": "220130083730109ID1CARD1962914", "wallets": [ { "walletId": "<wallet id>", "amount": "100.00" } ] }, params: {} }
Output when all mentioned wallet loads are successful:
{ "refId": "ref-id-1", "cardId": "210826112743822ID1CARDID3063726", "wallets": [ { "walletId": "app-id-2837", "amount": "100.00", "balance": "1100.00" } ] }

Output when NOT all mentioned wallet loads are successful:
{ "refId": "ref-id-1", "cardId": "210826112743822ID1CARDID3063726", "wallets": [ { "walletId": "app-id-2837", "amount": "100.00", "balance": "1100.00" }, { "walletId": "app-id-2838", "amount": "110.00", "balance": "1100.00", "failureReason": "Insufficient Org Balance" } ] }
AddAddressCall this to create address for customer. This will be required to call when the digital cards are converted config as JSON:
{ token: string; environment: Environment; }

payload as JSON:
{ body: { "entityId":<customer id>, "entityType":"CUST", "address": { "address1": <address line 1>, "address2": <address line 2>, "addressType": "DELIVERY_ADDRESS", "pincode": <pincode>, "city": <city name>, "state": "KARNATAKA", "country": "IND" } }, params: {} }
Output in case of success:
{ "addressId": 27 }

Output in case of error like missing mandatory fields:
{ "message": "Address is mandatory" }
PrintCardUse this function to get the physical card printed when a digital card is already issued to the cardholder. The digital card has to be a active card.config as JSON:
{ token: string; environment: Environment; }

payload as JSON:
{ body: { "cardId":<card id of the digital card, "nameOnCard":<name on card>, "addressId":<address id as received in AddAddress function defined above> }, params: {} }
In case of success, the response is empty:
{}

In case of error like missing mandatory fields:
{ "message":"card is already printing or printed" }
In case of missing information:
{ "message":"Address id is mandatory" }
MapCustomerToInstakitThis function to be used when an instakit is mapped to an already created cardholderconfig as JSON:
{ token: string; environment: Environment; }

payload as JSON:
{ body: { "kitNumber": <kit number as per mentioned in the docket>, "mobile": <mobile number starting with 91>, "orgId" :<org id>, "cardProgramId": <card program id> }, params: {} }
In case of success, the response is empty:
{}

In case of customer do not exist with the mobile number given: {
"message": "Customer not available in DB"
}`