lerex
v1.0.0
Published
SDK for integrating with Lerex (formerly Swapx) B2B API
Downloads
4
Readme
Getting started
How to Build
The generated SDK relies on Node Package Manager (NPM) being available to resolve dependencies. If you don't already have NPM installed, please go ahead and follow instructions to install NPM from here. The SDK also requires Node to be installed. If Node isn't already installed, please install it from here
NPM is installed by default when Node is installed
To check if node and npm have been successfully installed, write the following commands in command prompt:
node --version
npm -version
Now use npm to resolve all dependencies by running the following command in the root directory (of the SDK folder):
npm install
This will install all dependencies in the node_modules
folder.
Once dependencies are resolved, you will need to move the folder SWAPXRESTB2BAPILib
in to your node_modules
folder.
How to Use
The following section explains how to use the library in a new project.
1. Open Project Folder
Open an IDE/Text Editor for JavaScript like Sublime Text. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.
Click on File
and select Open Folder
.
Select the folder of your SDK and click on Select Folder
to open it up in Sublime Text. The folder will become visible in the bar on the left.
2. Creating a Test File
Now right click on the folder name and select the New File
option to create a new test file. Save it as index.js
Now import the generated NodeJS library using the following lines of code:
var lib = require('lib');
Save changes.
3. Running The Test File
To run the index.js
file, open up the command prompt and navigate to the Path where the SDK folder resides. Type the following command to run the file:
node index.js
How to Test
These tests use Mocha framework for testing, coupled with Chai for assertions. These dependencies need to be installed for tests to run. Tests can be run in a number of ways:
Method 1 (Run all tests)
- Navigate to the root directory of the SDK folder from command prompt.
- Type
mocha --recursive
to run all the tests.
Method 2 (Run all tests)
- Navigate to the
../test/Controllers/
directory from command prompt. - Type
mocha *
to run all the tests.
Method 3 (Run specific controller's tests)
- Navigate to the
../test/Controllers/
directory from command prompt. - Type
mocha SWAPX REST B2B APIController
to run all the tests in that controller file.
To increase mocha's default timeout, you can change the
TEST_TIMEOUT
parameter's value inTestBootstrap.js
.
Initialization
API client can be initialized as following:
const lib = require('lib');
Class Reference
List of Controllers
- BankingController
- CardsController
- CurrenciesController
- FXOrderController
- HealthCheckController
- InsuranceManagementController
- OrganisationController
- StaticDataController
- SubscriptionController
- TransactionsController
- UsersController
- WalletController
BankingController
Get singleton instance
The singleton instance of the BankingController
class can be accessed from the API Client.
var controller = lib.BankingController;
getBankingCreateAccount
Create a GBP and EUR account for the user
function getBankingCreateAccount(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| The ID of the user |
Example Usage
var userId = uniqid();
controller.getBankingCreateAccount(userId, function(error, response, context) {
});
getBankingGetUserAccounts
Get all accounts for a user
function getBankingGetUserAccounts(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| TODO: Add a parameter description |
Example Usage
var userId = uniqid();
controller.getBankingGetUserAccounts(userId, function(error, response, context) {
});
getBankingBlockUserAccounts
Block all accounts for a user
function getBankingBlockUserAccounts(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| TODO: Add a parameter description |
Example Usage
var userId = uniqid();
controller.getBankingBlockUserAccounts(userId, function(error, response, context) {
});
getBankingUnblockUserAccounts
Unblock all accounts for a user
function getBankingUnblockUserAccounts(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| TODO: Add a parameter description |
Example Usage
var userId = uniqid();
controller.getBankingUnblockUserAccounts(userId, function(error, response, context) {
});
createBankingMakePayment
Make a payment from a Lerex bank account to a beneficiary
function createBankingMakePayment(input, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| input | Required
| the model |
Example Usage
var input = new SwapXRESTB2BModelsBanksBankingPaymentModel({"key":"value"});
controller.createBankingMakePayment(input, function(error, response, context) {
});
getBankingGetAllCard
Get all accounts
function getBankingGetAllCard(callback)
Example Usage
controller.getBankingGetAllCard(function(error, response, context) {
});
deleteBankingCloseAccount
Close an account - this is not reversible
function deleteBankingCloseAccount(userId, accountId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| The ID of the user. |
| accountId | Required
| The account ID to terminate (for security reason). |
Example Usage
var userId = uniqid();
var accountId = uniqid();
controller.deleteBankingCloseAccount(userId, accountId, function(error, response, context) {
});
CardsController
Get singleton instance
The singleton instance of the CardsController
class can be accessed from the API Client.
var controller = lib.CardsController;
getCardsGetCard
Get a card
function getCardsGetCard(cardId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| cardId | Required
| The ID of the card to retrieve |
Example Usage
var cardId = 7;
controller.getCardsGetCard(cardId, function(error, response, context) {
});
getCardsGetAllCard
Get all cards
function getCardsGetAllCard(callback)
Example Usage
controller.getCardsGetAllCard(function(error, response, context) {
});
getCardsOrderCard
Order a new Card
function getCardsOrderCard(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| The ID of the user to order a card for |
Example Usage
var userId = uniqid();
controller.getCardsOrderCard(userId, function(error, response, context) {
});
createCardsOrderCardWithPIN
Order a new Card with the ability to set PIN and design
function createCardsOrderCardWithPIN(model, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| model | Required
| The model. |
Example Usage
var model = new SwapXRESTB2BModelsCardsOrderCardModel({"key":"value"});
controller.createCardsOrderCardWithPIN(model, function(error, response, context) {
});
getCardsGetCardsHolder
Get all active card holders
function getCardsGetCardsHolder(callback)
Example Usage
controller.getCardsGetCardsHolder(function(error, response, context) {
});
getCardsActivateCard
Activate a card
function getCardsActivateCard(cardId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| cardId | Required
| The ID of the card to activate. |
Example Usage
var cardId = 7;
controller.getCardsActivateCard(cardId, function(error, response, context) {
});
getCardsSavePin
Change the card PIN
function getCardsSavePin(cardId, userId, pin, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| cardId | Required
| The ID of the card to send the PIN of. |
| userId | Required
| The ID of the card user (for security reason) |
| pin | Required
| The new 4 digits PIN code |
Example Usage
var cardId = 7;
var userId = uniqid();
var pin = 'pin';
controller.getCardsSavePin(cardId, userId, pin, function(error, response, context) {
});
getCardsUnblockPin
Unblock the card PIN
function getCardsUnblockPin(cardId, userId, pin, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| cardId | Required
| The ID of the card to send the PIN of. |
| userId | Required
| The ID of the card user (for security reason) |
| pin | Required
| TODO: Add a parameter description |
Example Usage
var cardId = 7;
var userId = uniqid();
var pin = 'pin';
controller.getCardsUnblockPin(cardId, userId, pin, function(error, response, context) {
});
getCardsGetPin
Get the card PIN
function getCardsGetPin(cardId, userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| cardId | Required
| The ID of the card |
| userId | Required
| The ID of the card user (for security reason) |
Example Usage
var cardId = 7;
var userId = uniqid();
controller.getCardsGetPin(cardId, userId, function(error, response, context) {
});
getCardsGetUserCardConfiguration
Get the list of Merchant Category Codes which are blocked
function getCardsGetUserCardConfiguration(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| TODO: Add a parameter description |
Example Usage
var userId = uniqid();
controller.getCardsGetUserCardConfiguration(userId, function(error, response, context) {
});
createCardsSetUserCardConfiguration
Create/Update the list of Merchant Category Codes which are blocked
function createCardsSetUserCardConfiguration(input, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| input | Required
| TODO: Add a parameter description |
Example Usage
var input = new SwapXRESTB2BModelsCardsBlockMccCardRequestModel({"key":"value"});
controller.createCardsSetUserCardConfiguration(input, function(error, response, context) {
});
getCardsBlockCardByUser
Block the user card
function getCardsBlockCardByUser(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| TODO: Add a parameter description |
Example Usage
var userId = uniqid();
controller.getCardsBlockCardByUser(userId, function(error, response, context) {
});
getCardsUnblockCardByUser
Unblock the user card
function getCardsUnblockCardByUser(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| TODO: Add a parameter description |
Example Usage
var userId = uniqid();
controller.getCardsUnblockCardByUser(userId, function(error, response, context) {
});
deleteCardsCancelCard
Cancel / delete a card - this is not reversible
function deleteCardsCancelCard(cardId, userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| cardId | Required
| The ID of the card to activate. |
| userId | Required
| The ID of the card user (for security reason). |
Example Usage
var cardId = 7;
var userId = uniqid();
controller.deleteCardsCancelCard(cardId, userId, function(error, response, context) {
});
createCardsGetCardFullPAN
Allow to get the full card PAN (encrypted)
function createCardsGetCardFullPAN(model, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| model | Required
| The request model. |
Example Usage
var model = new SwapXRESTB2BModelsCardsCardFullPANRequestModel({"key":"value"});
controller.createCardsGetCardFullPAN(model, function(error, response, context) {
});
CurrenciesController
Get singleton instance
The singleton instance of the CurrenciesController
class can be accessed from the API Client.
var controller = lib.CurrenciesController;
getCurrenciesGetCurrenciesById
Get currency
function getCurrenciesGetCurrenciesById(id, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| id | Required
| TODO: Add a parameter description |
Example Usage
var id = 7;
controller.getCurrenciesGetCurrenciesById(id, function(error, response, context) {
});
getCurrenciesGetAllCurrencies
Get all currencies.
function getCurrenciesGetAllCurrencies(callback)
Example Usage
controller.getCurrenciesGetAllCurrencies(function(error, response, context) {
});
getCurrenciesGetCurrenciesByName
Get currencies by ISO code
function getCurrenciesGetCurrenciesByName(code, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| code | Required
| TODO: Add a parameter description |
Example Usage
var code = 'code';
controller.getCurrenciesGetCurrenciesByName(code, function(error, response, context) {
});
getCurrenciesGetAvailableWallet
Get all currencies which are available as a wallet
function getCurrenciesGetAvailableWallet(callback)
Example Usage
controller.getCurrenciesGetAvailableWallet(function(error, response, context) {
});
getCurrenciesGetRateAndFeeByCurrencies
Get rate and fee for buy currency
function getCurrenciesGetRateAndFeeByCurrencies(sellCurrencyCode, buyCurrencyCode, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| sellCurrencyCode | Required
| The ISO code of the currency to sell. |
| buyCurrencyCode | Required
| The ISO code of the currency to buy. |
Example Usage
var sellCurrencyCode = 'sellCurrencyCode';
var buyCurrencyCode = 'buyCurrencyCode';
controller.getCurrenciesGetRateAndFeeByCurrencies(sellCurrencyCode, buyCurrencyCode, function(error, response, context) {
});
getCurrenciesGetAllRatesToGbp
Get all currencies with their rate
function getCurrenciesGetAllRatesToGbp(callback)
Example Usage
controller.getCurrenciesGetAllRatesToGbp(function(error, response, context) {
});
FXOrderController
Get singleton instance
The singleton instance of the FXOrderController
class can be accessed from the API Client.
var controller = lib.FXOrderController;
getFXOrderGetQuote
Get exchange rate from quote request
function getFXOrderGetQuote(baseCurrencyId, baseAmount, targetCurrencyId, buySell, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| baseCurrencyId | Required
| TODO: Add a parameter description |
| baseAmount | Required
| TODO: Add a parameter description |
| targetCurrencyId | Required
| TODO: Add a parameter description |
| buySell | Required
| TODO: Add a parameter description |
Example Usage
var baseCurrencyId = 7;
var baseAmount = 7.23211333725234;
var targetCurrencyId = 7;
var buySell = 7;
controller.getFXOrderGetQuote(baseCurrencyId, baseAmount, targetCurrencyId, buySell, function(error, response, context) {
});
getFXOrderExecuteQuote
Execute a quote
function getFXOrderExecuteQuote(quoteId, memo, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| quoteId | Required
| TODO: Add a parameter description |
| memo | Required
| TODO: Add a parameter description |
Example Usage
var quoteId = uniqid();
var memo = 'memo';
controller.getFXOrderExecuteQuote(quoteId, memo, function(error, response, context) {
});
getFXOrderGetAll
Retrieve all past and pending FX Orders
function getFXOrderGetAll(quoteId, memo, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| quoteId | Required
| TODO: Add a parameter description |
| memo | Required
| TODO: Add a parameter description |
Example Usage
var quoteId = uniqid();
var memo = 'memo';
controller.getFXOrderGetAll(quoteId, memo, function(error, response, context) {
});
HealthCheckController
Get singleton instance
The singleton instance of the HealthCheckController
class can be accessed from the API Client.
var controller = lib.HealthCheckController;
getHealthCheckCheck
An Endpoint for API Health Checking
function getHealthCheckCheck(callback)
Example Usage
controller.getHealthCheckCheck(function(error, response, context) {
});
InsuranceManagementController
Get singleton instance
The singleton instance of the InsuranceManagementController
class can be accessed from the API Client.
var controller = lib.InsuranceManagementController;
updateInsuranceManagementUpdateUser
Update an insurance user
function updateInsuranceManagementUpdateUser(userToUpdate, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userToUpdate | Required
| User to update |
Example Usage
var userToUpdate = new SwapXRESTB2BModelsInsuranceRestUpdatePolicyHolderModel({"key":"value"});
controller.updateInsuranceManagementUpdateUser(userToUpdate, function(error, response, context) {
});
createInsuranceManagementAddUser
Add an insurance user
function createInsuranceManagementAddUser(input, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| input | Required
| User to add |
Example Usage
var input = new SwapXRESTB2BModelsUserRestAddPolicyHolderModel({"key":"value"});
controller.createInsuranceManagementAddUser(input, function(error, response, context) {
});
getInsuranceManagementGetListUsersRest
Gets list of users.
function getInsuranceManagementGetListUsersRest(searchTerm, pageNumber, pageSize, sortBy, orderBy, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| searchTerm | Required
| The search term. |
| pageNumber | Required
| The page number. |
| pageSize | Required
| Size of the page. |
| sortBy | Optional
| The sort by. |
| orderBy | Optional
| The order by. |
Example Usage
var searchTerm = 'searchTerm';
var pageNumber = 7;
var pageSize = 7;
var sortBy = Object.keys(sortBy)[0];
var orderBy = Object.keys(orderBy)[0];
controller.getInsuranceManagementGetListUsersRest(searchTerm, pageNumber, pageSize, sortBy, orderBy, function(error, response, context) {
});
updateInsuranceManagementUpdatePolicy
Update policy.
function updateInsuranceManagementUpdatePolicy(input, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| input | Required
| Update policy |
Example Usage
var input = new SwapXRESTB2BModelsUserRestUpdatePolicy({"key":"value"});
controller.updateInsuranceManagementUpdatePolicy(input, function(error, response, context) {
});
createInsuranceManagementPostCertificateInfo
Create certificate information.
function createInsuranceManagementPostCertificateInfo(input, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| input | Required
| The value to post. |
Example Usage
var input = new SwapXRESTB2BModelsUserRestAddPolicy({"key":"value"});
controller.createInsuranceManagementPostCertificateInfo(input, function(error, response, context) {
});
OrganisationController
Get singleton instance
The singleton instance of the OrganisationController
class can be accessed from the API Client.
var controller = lib.OrganisationController;
getOrganisationGetOrganisationDetails
Get organisation account details
function getOrganisationGetOrganisationDetails(callback)
Example Usage
controller.getOrganisationGetOrganisationDetails(function(error, response, context) {
});
getOrganisationGetWalletAmounts
Get organisation wallet details
function getOrganisationGetWalletAmounts(callback)
Example Usage
controller.getOrganisationGetWalletAmounts(function(error, response, context) {
});
createOrganisationAddDeposit
Create a new deposit
function createOrganisationAddDeposit(model, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| model | Required
| TODO: Add a parameter description |
Example Usage
var model = new SwapXRESTB2BModelsBanksAddDepositViewModel({"key":"value"});
controller.createOrganisationAddDeposit(model, function(error, response, context) {
});
Errors
| Error Code | Error Description | |------------|-------------------| | 400 | BadRequest |
StaticDataController
Get singleton instance
The singleton instance of the StaticDataController
class can be accessed from the API Client.
var controller = lib.StaticDataController;
getStaticDataGetAllCountries
Get all countries
function getStaticDataGetAllCountries(callback)
Example Usage
controller.getStaticDataGetAllCountries(function(error, response, context) {
});
getStaticDataGetAllTransactionTypes
Get all transaction types
function getStaticDataGetAllTransactionTypes(callback)
Example Usage
controller.getStaticDataGetAllTransactionTypes(function(error, response, context) {
});
getStaticDataGetAllTransactionStatuses
Get all transaction statuses
function getStaticDataGetAllTransactionStatuses(callback)
Example Usage
controller.getStaticDataGetAllTransactionStatuses(function(error, response, context) {
});
getStaticDataGetAllCardStatuses
Get all card statuses
function getStaticDataGetAllCardStatuses(callback)
Example Usage
controller.getStaticDataGetAllCardStatuses(function(error, response, context) {
});
getStaticDataGetAllKYCStatuses
Get all KYC statuses
function getStaticDataGetAllKYCStatuses(callback)
Example Usage
controller.getStaticDataGetAllKYCStatuses(function(error, response, context) {
});
getStaticDataGetAllBankAccountStatuses
Get all bank account statuses
function getStaticDataGetAllBankAccountStatuses(callback)
Example Usage
controller.getStaticDataGetAllBankAccountStatuses(function(error, response, context) {
});
SubscriptionController
Get singleton instance
The singleton instance of the SubscriptionController
class can be accessed from the API Client.
var controller = lib.SubscriptionController;
getSubscriptionGetTransactionSubscription
Subscribe to transaction activity
function getSubscriptionGetTransactionSubscription(callback)
Example Usage
controller.getSubscriptionGetTransactionSubscription(function(error, response, context) {
});
getSubscriptionGetLoadSubscription
Subscribe to load activity
function getSubscriptionGetLoadSubscription(callback)
Example Usage
controller.getSubscriptionGetLoadSubscription(function(error, response, context) {
});
getSubscriptionGetRejectSubscription
Subscribe to rejected transactions activity
function getSubscriptionGetRejectSubscription(callback)
Example Usage
controller.getSubscriptionGetRejectSubscription(function(error, response, context) {
});
TransactionsController
Get singleton instance
The singleton instance of the TransactionsController
class can be accessed from the API Client.
var controller = lib.TransactionsController;
getTransactionsGetUserActivity
Get organisation activity (all fields are optional and used for filtering)
function getTransactionsGetUserActivity(userId, currencyId, filter, pageSize, page, startDate, endDate, sortBy, orderBy, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Optional
| userId |
| currencyId | Optional
| CurrencyId |
| filter | Optional
| Filter keyword |
| pageSize | Optional
| Record per page |
| page | Optional
| Page index |
| startDate | Optional
| From date |
| endDate | Optional
| To date |
| sortBy | Optional
| The sort by. |
| orderBy | Optional
| The order by. |
Example Usage
var userId = uniqid();
var currencyId = 7;
var filter = 'filter';
var pageSize = 7;
var page = 7;
var startDate = date("D M d, Y G:i");
var endDate = date("D M d, Y G:i");
var sortBy = Object.keys(sortBy1)[0];
var orderBy = Object.keys(orderBy)[0];
controller.getTransactionsGetUserActivity(userId, currencyId, filter, pageSize, page, startDate, endDate, sortBy, orderBy, function(error, response, context) {
});
getTransactionsTransactionDetail
Get details for a given transaction
function getTransactionsTransactionDetail(id, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| id | Required
| The transaction identifier. |
Example Usage
var id = 7;
controller.getTransactionsTransactionDetail(id, function(error, response, context) {
});
UsersController
Get singleton instance
The singleton instance of the UsersController
class can be accessed from the API Client.
var controller = lib.UsersController;
getUsersGetAllUsers
Get all users
function getUsersGetAllUsers(filter, pageSize, page, order, orderBy, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| filter | Optional
| The filter. |
| pageSize | Optional
| Size of the page. |
| page | Optional
| The page. |
| order | Optional
| The order. |
| orderBy | Optional
| The order by. |
Example Usage
var filter = 'filter';
var pageSize = 7;
var page = 7;
var order = 'order';
var orderBy = 'orderBy';
controller.getUsersGetAllUsers(filter, pageSize, page, order, orderBy, function(error, response, context) {
});
updateUsersUpdateUser
Update a user
function updateUsersUpdateUser(model, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| model | Required
| The model. |
Example Usage
var model = new SwapXRESTB2BModelsUsersUpdateUserModel({"key":"value"});
controller.updateUsersUpdateUser(model, function(error, response, context) {
});
Errors
| Error Code | Error Description | |------------|-------------------| | 400 | BadRequest |
createUsersCreateNewUser
Create new user
function createUsersCreateNewUser(model, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| model | Required
| The model. |
Example Usage
var model = new SwapXRESTB2BModelsUsersAddUserModel({"key":"value"});
controller.createUsersCreateNewUser(model, function(error, response, context) {
});
Errors
| Error Code | Error Description | |------------|-------------------| | 400 | BadRequest |
getUsersGetUser
Get a single user
function getUsersGetUser(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| The ID of the user. |
Example Usage
var userId = uniqid();
controller.getUsersGetUser(userId, function(error, response, context) {
});
deleteUsersDeleteUser
Soft delete the user.
function deleteUsersDeleteUser(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| TODO: Add a parameter description |
Example Usage
var userId = uniqid();
controller.deleteUsersDeleteUser(userId, function(error, response, context) {
});
getUsersGetAllActiveUsers
Get all active users
function getUsersGetAllActiveUsers(callback)
Example Usage
controller.getUsersGetAllActiveUsers(function(error, response, context) {
});
createUsersUpdateUserAccountBlocked
Updates the user account blocked.
function createUsersUpdateUserAccountBlocked(input, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| input | Required
| The input. |
Example Usage
var input = new SwapXRESTB2BModelsUsersUpdateUserAccountBlockModel({"key":"value"});
controller.createUsersUpdateUserAccountBlocked(input, function(error, response, context) {
});
getUsersCheckAccountBlockedStatus
Checks the account blocked status.
function getUsersCheckAccountBlockedStatus(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| The user identifier. |
Example Usage
var userId = uniqid();
controller.getUsersCheckAccountBlockedStatus(userId, function(error, response, context) {
});
getUsersGetPendingUsers
Get the pending users.
function getUsersGetPendingUsers(callback)
Example Usage
controller.getUsersGetPendingUsers(function(error, response, context) {
});
createUsersUpdate3DSInfo
Updates the user 3D Secure information.
function createUsersUpdate3DSInfo(input, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| input | Required
| The input. |
Example Usage
var input = new SwapXRESTB2BModelsUsersUpdateUser3DSInfoModel({"key":"value"});
controller.createUsersUpdate3DSInfo(input, function(error, response, context) {
});
getUsersUpdateKYCStatus
Updates the user KYC Status.
function getUsersUpdateKYCStatus(userId, kYCStatus, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| The guid of the user to update. |
| kYCStatus | Required
| The new status of the user. |
Example Usage
var userId = uniqid();
var kYCStatus = 7;
controller.getUsersUpdateKYCStatus(userId, kYCStatus, function(error, response, context) {
});
WalletController
Get singleton instance
The singleton instance of the WalletController
class can be accessed from the API Client.
var controller = lib.WalletController;
getWalletGetUserWallets
Get all users wallet
function getWalletGetUserWallets(callback)
Example Usage
controller.getWalletGetUserWallets(function(error, response, context) {
});
getWalletGetUserWallets1
Get a users wallet
function getWalletGetUserWallets1(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| TODO: Add a parameter description |
Example Usage
var userId = uniqid();
controller.getWalletGetUserWallets1(userId, function(error, response, context) {
});
createWalletWalletUnLoad
Unload a User wallet
function createWalletWalletUnLoad(userId, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| userId | Required
| Guid of the user to unload |
Example Usage
var userId = uniqid();
controller.createWalletWalletUnLoad(userId, function(error, response, context) {
});
Errors
| Error Code | Error Description | |------------|-------------------| | 400 | BadRequest |
createWalletWalletLoad
Load wallet for one or multiple user
function createWalletWalletLoad(input, callback)
Parameters
| Parameter | Tags | Description |
|-----------|------|-------------|
| input | Required
| Load wallet input |
Example Usage
var input = new SwapXCoreModelsWalletUsersWalletLoadInputModel({"key":"value"});
controller.createWalletWalletLoad(input, function(error, response, context) {
});
Errors
| Error Code | Error Description | |------------|-------------------| | 400 | BadRequest |