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 Check | accountCheck |
Account Balance | balance |
Account Aggregation | accountAggregation |
Transactions | transactions |
E-Statement | eStatement |
Income Check | incomeCheck |
Expense Check | expenseCheck |
KYC | kyc |
Credit Check | creditCheck |
IBAN Validation | ibanValidation |
Customer Verification | customerVerification |
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"
}
]
});
Updated 6 months ago