Web

Getting Started

Integrate SDK

To incorporate the SingleView SDK, begin by importing it into your front-end. Use the below script tag in your web application to integrate it with SingleView SDK:

<script src="https://secure.onesingleview.com/sdk/aisp/aisp_bundle.js"></script>

Next, insert the following mandatory div tag in your application body to bind the SDK DOM:

<div id= "sv-link"></div>

Now your application is integrated to SingleView SDK and is ready-to-use.

Setup

๐Ÿ“˜

Note

sv is the SDK global variable which will be used to call all the methods

Connect

.connect()

The .connect() method establishes a connection with the SingleView SDK and enables the use of further methods and use cases.

sv.connect({
  clientId: "your-client-id", //Available in console portal
  clientCode: "your-client-code", //Available in console portal
  merchantId: "your-merchant-id", //Generated using .createMerchant() method  
  version: "v1",
  lang: "your-language", //en or ar for English and Arabic language
});

Create Merchant

.createMerchant()

A new merchant is created by assigning a unique identification i.e., app_user_id, by following the below method:

sv.createMerchant({  
  app_user_id: โ€œenter-unique-idโ€ //Unique Id  
});

Set Merchant ID

.setMerchantId

Set Merchant ID sets key-values that define Merchant IDs for authentication.

sv.setMerchantId(โ€œ1234567โ€);

Get Merchant

.getMerchant()

The .getMerchant() method serves the purpose of retrieving the list of merchants' information that are mapped with a particular company's sv-app-token.

sv.getMerchant();

Set Usecases

.setUseCase()

The setUseCases() is the method that enables the usage of Use cases. It is required to setup an use case in prior to accessing it.

sv.setUseCase(โ€œenter-usecase-tagโ€);

Use the below tags to enable the respective use cases in place of the above mentioned enter-usecase-tag tag:

Account CheckaccountCheck
Account Balancebalance
Account AggregationaccountAggregation
Transactionstransactions
E-StatementeStatement
Income CheckincomeCheck
Expense CheckexpenseCheck
KYCkyc
Credit CheckcreditCheck
IBAN ValidationibanValidation
Customer VerificationcustomerVerification

Manage Consent

Create consent

.createConsent()

The .createConsent() method facilitates the addition or creation of a consent for a bank account, allowing the retrieval of information based on the agreed permissions. Consent ID represents the unique identifier that was authorized by the Bank for specific account(s). The date values entered in the method follows ISO string format. This method is may vary and may not follow the below created flow:

sv.createConsent(  
  "merchantId": โ€œyour-merchant-idโ€,
  banks: [  
  {  
  code: โ€œyour-bank-codeโ€,  
  expiryDate: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€, //In ISO string format  
  txnFromDate: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
  txnToDate: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
  permissions: [
  "enter-permission",  
  "enter-permission",  
  ],  
},  
  ]  
  );

View consent

.consentDetails()

The .consentDetails() method is used to fetch the information of a specific consent based on consentId parameter. Consent ID represents the unique identifier that was authorized by the Bank for specific account(s).

sv.consentDetails(  
  {  
    "dateTimeStamp": "YYYY-MM-DDTHH:MM:SS.XXXZ",
    "merchantId": โ€œyour-merchant-idโ€,
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id"  
      }  
    ]  
  });

Get Consent Data

.getConsentData()

The .getConsentData() method is used to fetch the consent data just after the success or failure response of the consent creation that can be stored and used as required.

sv.getConsentData()

Delete consent

.deleteConsent()

The .deleteConsent() method is designed to invalidate a consent that has been previously created and is active. To execute this method, you are required to provide the consentId as a parameter along with bankCode. Consent ID represents the unique identifier that was authorized by the Bank for specific account(s).

sv.deleteConsent(
  "merchantId": โ€œyour-merchant-idโ€,
  "banks": [
  {
  "code": "bank-code",
  "consentId":"your-consent-id"
  }
]
)

Use case methods

These methods are allow you to call SingleView SDK and get data post consent creation.

Accounts

Account check

.getAccountsCheck()

The .getAccountsCheck() method retrieves the account information based on the provided consentId parameter.

sv.getAccountsCheck(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    โ€œaccountCheckโ€: true,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id"  
      }  
    ]  
  });

Get Accounts

.getAccounts()

The .getAccounts() method is used to retrieve a list of accounts that are linked to a specific consent. To use this method, you must provide the bank object code and consentId as parameters.

sv.getAccounts(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id"  
      }  
    ]  
  });

Get Account by Account ID

.getAccountByAccountId()

The getAccountByAccountId() method is used to retrieve account information of a specific account. In this case, the consentId carries multiple accounts with individual and unique accountId for every account of the same bank.

sv.getAccountByAccountsId(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id",  
        โ€œaccountIdโ€: โ€œyour-account-idโ€  
      }  
    ]  
  });

Get Party/Parties

.getParties()

The .getParties method fetches the account ownership details of all the accounts included in the provided consentId.

sv.getParties(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id"  
      }  
    ]  
  });

Get Parties by Account ID

.getPartiesByAccountId()

The getPartiesByAccountId() method is used to retrieve account ownership information of a specific account. In this case, the consentId carries multiple accounts with individual and unique accountId for every account of the same bank.

sv.getPartiesByAccountId(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id",  
        โ€œaccountIdโ€: โ€œyour-account-idโ€  
      }  
    ]  
  });

Balance

.getBalance()

The .getBalance() method retrieves the account(s) balance based on the consentId provided. If the consentId carries multiple account, then the response lists all the accounts' balance.

sv.getBalance(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id"  
      }  
    ]  
  });

Get Balance by Account ID

.getBalanceByAccountId()

The getBalanceByAccountId() method is used to retrieve account balance information of a specific account. In this case, the consentId carries multiple accounts with individual and unique accountId for every account belonging to the same bank.

sv.getBalanceByAccountsId(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id",  
        โ€œaccountIdโ€: โ€œyour-account-idโ€  
      }  
    ]  
  });

Transactions

Get Transactions

.getTransactions()

The .getTransactions() method retrieves transactions information of account(s) based on the consentId provided. The Consent ID may contain a single or multiple accounts belonging to the same bank.

sv.getTransactions(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id"  
      }  
    ]  
  });

Get Transactions By Account ID

.getTransactionsByAccountId()

The .getTransactionsByAccountId() method retrieves transaction information for the specified bank account included in the specific consent. The method requires consentId and accountId parameters to get the details.

sv.getTransactionsByAccountId(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id",  
        โ€œaccountIdโ€: โ€œyour-account-idโ€  
      }  
    ]  
  });

Direct Debits

Get Direct Debits

.getDirectDebits()

The .getDirectDebits() method retrieves the information on all the direct debits concerned to the account(s) connected to the specified consentId. The Consent ID may contain a single or multiple accounts belonging to the same bank.

sv.getDirectDebits(  
  {
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id"  
      }  
    ]  
  });

Get Direct Debits by Account ID

.getDirectDebitsByAccountId()

The .getDirectDebitsByAccountId() method retrieves information of direct debits for the specified bank account included in the specific Consent ID. The method requires consentId and accountId parameters to get the details.

sv.getDirectDebitsByAccountId(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id",  
        โ€œaccountIdโ€: โ€œyour-account-idโ€  
      }  
    ]  
  });

Standing Orders

Get Standing Orders

.getStandingOrder()

The .getStandingOrder() method retrieves the information on all the standing orders concerned to the account(s) connected to the specified consentId. The Consent ID may contain a single or multiple accounts belonging to the same bank.

sv.getStandingOrder(  
  {
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id"  
      }  
    ]  
  });

Get Standing Orders by Account ID

.getStandingOrderByAccountId()

The .getStandingOrderByAccountId() method retrieves information of standing orders for the specified bank account included in the specific Consent ID. The method requires consentId and accountId parameters to get the details.

sv.getStandingOrderByAccountId(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id",  
        โ€œaccountIdโ€: โ€œyour-account-idโ€  
      }  
    ]  
  });

Scheduled Payments

Get Scheduled Payments

.getSchedulePayments()

The .getSchedulePayments() method retrieves the information on all the scheduled payments concerned to the account(s) connected to the specified consentId. The Consent ID may contain a single or multiple accounts belonging to the same bank.

sv.getSchedulePayments(  
  {
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id"  
      }  
    ]  
  });

Get Scheduled Payments by Account ID

.getSchedulePaymentsByAccountId()

The .getSchedulePaymentsByAccountId() method retrieves information of the scheduled payments for the specified bank account included in the mentioned Consent ID. The method requires consentId and accountId parameters to get the details.

sv.getSchedulePaymentsByAccountId(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id",  
        โ€œaccountIdโ€: โ€œyour-account-idโ€  
      }  
    ]  
  });

Use Cases

Account Aggregation

.accountAggregation()

The .accountAggregation() method will fetch the account data like balance and transactions. For this method you need to provide the bank code code and consentID and also txnFormDate and txnToDate as a parameters with dates in ISO format Ex: 2022-07-12T11:11:29.245Z.

sv.customerVerification(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    โ€œaccountAggregationโ€: true,  
    โ€œtxnFromDateโ€: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
    โ€œtxnToDateโ€: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
    "banks": [  
    {  
    "code": "your-bank-code",  
    "consentId":"your-consent-id"  
  }  
  ]  
  });

E-Statement

.eStatement()

The eStatement() method will fetch account transactions for the specified date range. For this method you need to provide the bank code code and consentID and also txnFormDate and txnToDate as a parameters with dates in ISO format Ex: 2022-07-12T11:11:29.245Z.

sv.eStatement(
  {
    "merchantId": โ€œyour-merchant-idโ€,
    โ€œestatementโ€: true,
    โ€œtxnFromDateโ€: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,
    โ€œtxnToDateโ€: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
    "banks": [
    {
    "code": "your-bank-code",
    "consentId":"your-consent-id"
  }
  ]
  });

Income Check

.incomeCheck()

The incomeCheck() method will fetch information of specified account(s) during the specified date range with respect to the mentioned timelines to provide report on income transactions. For this method you need to provide the bank code code and consentID and also txnFormDate and txnToDate as a parameters with dates in ISO format Ex: 2022-07-12T11:11:29.245Z.

sv.incomeCheck(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    โ€œincomeCheckโ€: true,  
    โ€œinsightsโ€: true,  
    โ€œtimeLineโ€: โ€œtimeline-byDay-or-byMonth-or-byYearโ€,  
    โ€œtxnFromDateโ€: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
    โ€œtxnToDateโ€: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
    "banks": [  
    {  
    "code": "your-bank-code",  
    "consentId":"your-consent-id"  
  }  
  ]  
  });

Expense Check

.expenseCheck()

The expenseCheck() method will fetch information of specified account(s) during the specified date range with respect to the mentioned timelines. For this method you need to provide the bank code code and consentID and also txnFormDate and txnToDate as a parameters with dates in ISO format Ex: 2022-07-12T11:11:29.245Z.

sv.expenseCheck(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    โ€œexpenseCheckโ€: true,  
    โ€œinsightsโ€: true,  
    โ€œtimeLineโ€: โ€œtimeline-byDay-or-byMonth-or-byYearโ€,  
    โ€œtxnFromDateโ€: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
    โ€œtxnToDateโ€: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
    "banks": [  
    {  
    "code": "your-bank-code",  
    "consentId":"your-consent-id"  
  }  
  ]  
  });

KYC

.getKyc()

The getKYC() method fetches the KYC info data from the bank for the specified bank account for a specific date range. For this method you need to provide the bank code code and consentID and also txnFormDate and txnToDate as a parameters with dates in ISO format Ex: 2022-07-12T11:11:29.245Z.

sv.getKyc(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    โ€œkycโ€: true,  
    โ€œtxnFromDateโ€: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
    โ€œtxnToDateโ€: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
    "banks": [  
    {  
    "code": "your-bank-code",  
    "consentId":"your-consent-id"  
  }  
  ]  
  });

Credit Check

.creditCheck()

The .creditCheck() method fetches the account info and data needed to perform credit check from the bank for the specified bank account and date range. For this method you need to provide the bank code code and consentID and also txnFormDate and txnToDate as a parameters with dates in ISO format Ex: 2022-07-12T11:11:29.245Z.

sv.creditCheck(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    โ€œcreditCheckโ€: true,  
    โ€œtxnFromDateโ€: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
    โ€œtxnToDateโ€: โ€œYYYY-MM-DDTHH:MM:SS.XXXZโ€,  
    "banks": [  
    {  
    "code": "your-bank-code",  
    "consentId":"your-consent-id"  
  }  
  ]  
  });

IBAN Validation

.ibanValidation()

The .ibanValidation() method fetches account information to validate the given IBANs along with consentId.

sv.ibanValidation(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    โ€œibanCheckโ€: true,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id",  
        โ€œibanโ€: โ€œaccount-ibanโ€  
      }  
    ]  
  });

Customer Verification

.customerVerification()

The .customerVerification() method will give fetch the data from the bank for the mentioned consentId to provide you with the customer verification response.

sv.customerVerification(  
  {  
    "merchantId": โ€œyour-merchant-idโ€,  
    โ€œcustomerVerificationโ€: true,  
    "banks": [  
      {  
        "code": "your-bank-code",  
        "consentId":"your-consent-id"  
      }  
    ]  
  });