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"  
}  
]  
});