├── sdk ├── platform │ ├── PlatformApplicationModels.d.ts │ ├── index.js │ ├── index.d.ts │ ├── PlatformAPIClient.d.ts │ ├── OAuthClient.d.ts │ ├── PlatformConfig.d.ts │ ├── PlatformModels.d.ts │ ├── PlatformConfig.js │ ├── PlatformAPIClient.js │ └── OAuthClient.js └── common │ ├── AxiosHelper.d.ts │ ├── RequestSigner.d.ts │ ├── Utility.d.ts │ ├── Paginator.d.ts │ ├── Paginator.js │ ├── Storage.d.ts │ ├── FDKError.d.ts │ ├── utils.d.ts │ ├── FDKError.js │ ├── Utility.js │ ├── AxiosHelper.js │ ├── Storage.js │ ├── utils.js │ ├── Constant.js │ ├── RequestSigner.js │ └── Constant.d.ts ├── .gitignore ├── jest.config.js ├── jest.config.d.ts ├── platform.d.ts ├── platform.js ├── common.d.ts ├── common.js ├── index.d.ts ├── documentation └── platform │ ├── README.md │ ├── PAYMENTS.md │ ├── MERCHANT.md │ └── CREDIT.md ├── index.js ├── .github └── workflows │ ├── on_pull_request.yml │ └── on_merge_main.yml ├── package.json ├── tests └── helpers │ ├── cookie.helper.js │ └── oauth.helper.js ├── LICENSE └── README.md /sdk/platform/PlatformApplicationModels.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /sdk/common/AxiosHelper.d.ts: -------------------------------------------------------------------------------- 1 | export const fdkAxios: any; 2 | -------------------------------------------------------------------------------- /sdk/common/RequestSigner.d.ts: -------------------------------------------------------------------------------- 1 | export function sign(request: any, xSource?: string): any; 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # dotenv environment variables file 2 | .env 3 | .env.test 4 | .env.production 5 | node_modules -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | verbose: true, 3 | testEnvironment: 'node', 4 | bail: true, 5 | testTimeout: 30000 6 | }; -------------------------------------------------------------------------------- /sdk/platform/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | PlatformConfig: require("./PlatformConfig"), 3 | PlatformClient: require("./PlatformClient"), 4 | }; 5 | -------------------------------------------------------------------------------- /jest.config.d.ts: -------------------------------------------------------------------------------- 1 | export const verbose: boolean; 2 | export const testEnvironment: string; 3 | export const bail: boolean; 4 | export const testTimeout: number; 5 | -------------------------------------------------------------------------------- /sdk/platform/index.d.ts: -------------------------------------------------------------------------------- 1 | export const PlatformConfig: typeof import("./PlatformConfig"); 2 | export const PlatformClient: typeof import("./PlatformClient"); 3 | -------------------------------------------------------------------------------- /platform.d.ts: -------------------------------------------------------------------------------- 1 | import { PlatformConfig } from "./sdk/platform"; 2 | import { PlatformClient } from "./sdk/platform"; 3 | export { PlatformConfig, PlatformClient }; 4 | -------------------------------------------------------------------------------- /platform.js: -------------------------------------------------------------------------------- 1 | const {PlatformConfig, PlatformClient} = require('./sdk/platform'); 2 | 3 | module.exports = { 4 | PlatformConfig: PlatformConfig, 5 | PlatformClient: PlatformClient 6 | }; 7 | -------------------------------------------------------------------------------- /common.d.ts: -------------------------------------------------------------------------------- 1 | import { fdkAxios } from "./sdk/common/AxiosHelper"; 2 | import Utility = require("./sdk/common/Utility"); 3 | import Constant = require("./sdk/common/Constant"); 4 | export { fdkAxios as FdkAxios, Utility, Constant }; 5 | -------------------------------------------------------------------------------- /common.js: -------------------------------------------------------------------------------- 1 | const {fdkAxios} = require('./sdk/common/AxiosHelper'); 2 | const Utility = require('./sdk/common/Utility'); 3 | const Constant = require('./sdk/common/Constant'); 4 | 5 | module.exports = { 6 | FdkAxios: fdkAxios, 7 | Utility, 8 | Constant, 9 | }; 10 | -------------------------------------------------------------------------------- /sdk/common/Utility.d.ts: -------------------------------------------------------------------------------- 1 | export function convertActionToUrl(action: any): any; 2 | export function convertUrlToAction(url: any): { 3 | type: string; 4 | page: { 5 | type: string; 6 | query: {}; 7 | params: {}; 8 | }; 9 | }; 10 | export function convertPageToUrl(action: any): any; 11 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | 2 | import { PlatformConfig } from "./sdk/platform"; 3 | import { PlatformClient } from "./sdk/platform"; 4 | import { fdkAxios } from "./sdk/common/AxiosHelper"; 5 | import Utility = require("./sdk/common/Utility"); 6 | import Constant = require("./sdk/common/Constant"); 7 | export { PlatformConfig, PlatformClient, fdkAxios as FdkAxios, Utility, Constant }; 8 | -------------------------------------------------------------------------------- /documentation/platform/README.md: -------------------------------------------------------------------------------- 1 | ##### [Back to home](../../README.md) 2 | 3 | # FDK Platform Front API Documentaion 4 | 5 | 6 | * [Customer](CUSTOMER.md) - Authentication Service 7 | * [Credit](CREDIT.md) - Transaction Service 8 | * [MultiKyc](MULTIKYC.md) - Will deprecate Hawkeye 9 | * [Merchant](MERCHANT.md) - Authentication Service 10 | * [Payments](PAYMENTS.md) - KYC Service -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const {PlatformConfig, PlatformClient} = require('./sdk/platform'); 2 | const {fdkAxios} = require('./sdk/common/AxiosHelper'); 3 | const Utility = require('./sdk/common/Utility'); 4 | const Constant = require('./sdk/common/Constant'); 5 | 6 | module.exports = { 7 | PlatformConfig: PlatformConfig, 8 | PlatformClient: PlatformClient, 9 | FdkAxios: fdkAxios, 10 | Utility, 11 | Constant, 12 | }; 13 | -------------------------------------------------------------------------------- /sdk/common/Paginator.d.ts: -------------------------------------------------------------------------------- 1 | export = Paginator; 2 | declare class Paginator { 3 | constructor(pageNo: any); 4 | pageNo: any; 5 | callback: any; 6 | setCallback(callback: any): void; 7 | hasNext(): any; 8 | setPaginator({ hasNext, nextId, pageNo }: { 9 | hasNext: any; 10 | nextId?: any; 11 | pageNo?: number; 12 | }): void; 13 | isNext: any; 14 | nextId: any; 15 | next(): any; 16 | } 17 | -------------------------------------------------------------------------------- /sdk/platform/PlatformAPIClient.d.ts: -------------------------------------------------------------------------------- 1 | export = APIClient; 2 | declare class APIClient { 3 | /** 4 | * @param {object} conf 5 | * @param {string} method 6 | * @param {string} url 7 | * @param {object} query 8 | * @param {object} body 9 | * @param {object} headers 10 | */ 11 | static execute(conf: object, method: string, url: string, query: object, body: object, headers?: object): Promise; 12 | get(url: any, config: any): Promise; 13 | } 14 | -------------------------------------------------------------------------------- /sdk/common/Paginator.js: -------------------------------------------------------------------------------- 1 | class Paginator { 2 | constructor(pageNo) { 3 | this.pageNo = pageNo; 4 | this.callback = undefined; 5 | } 6 | 7 | setCallback(callback) { 8 | this.callback = callback; 9 | } 10 | 11 | hasNext() { 12 | return this.isNext; 13 | } 14 | 15 | setPaginator({ hasNext, nextId = undefined, pageNo = 1 }) { 16 | this.isNext = hasNext; 17 | this.nextId = nextId; 18 | this.pageNo = pageNo; 19 | } 20 | 21 | next() { 22 | return this.callback(); 23 | } 24 | } 25 | 26 | module.exports = Paginator; 27 | -------------------------------------------------------------------------------- /sdk/common/Storage.d.ts: -------------------------------------------------------------------------------- 1 | export type OnProgressCallback = (progress: number) => any; 2 | /** 3 | * Uploads a file to a cloud storage provider using a signed URL. 4 | * 5 | * @param {File} file - The file to be uploaded. 6 | * @param signedDetails - An object containing details required for the upload, 7 | * including the provider. 8 | * @param {OnProgressCallback} [onProgress] - An optional callback function to 9 | * handle progress updates. Receives progress as a percentage. 10 | * @returns {Promise} A promise that resolves with the response from the upload. 11 | * @throws {Error} Throws an error if the provider is unsupported or the upload fails. 12 | */ 13 | export function uploadFile(file: File, signedDetails: any, onProgress?: OnProgressCallback): Promise; 14 | -------------------------------------------------------------------------------- /sdk/platform/OAuthClient.d.ts: -------------------------------------------------------------------------------- 1 | export = OAuthClient; 2 | declare class OAuthClient { 3 | constructor(config: any); 4 | config: any; 5 | token: any; 6 | refreshToken: any; 7 | retryOAuthTokenTimer: NodeJS.Timeout; 8 | raw_token: any; 9 | token_expires_in: any; 10 | token_expires_at: number; 11 | useAutoRenewTimer: any; 12 | refresh_token_time: number; 13 | getAccessToken(): Promise; 14 | isTokenExpired(ttl?: number): boolean; 15 | setToken(token: any): any; 16 | retryOAuthToken(expires_in: any): void; 17 | renewAccessToken(): Promise; 18 | getAccesstokenObj({ grant_type, refresh_token, code }: { 19 | grant_type: any; 20 | refresh_token: any; 21 | code: any; 22 | }): Promise; 23 | } 24 | -------------------------------------------------------------------------------- /.github/workflows/on_pull_request.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request CI 2 | 3 | on: 4 | push: 5 | branches: [ fyndx0 ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | strategy: 15 | matrix: 16 | node-version: [12.x, 14.x, 15.x] 17 | 18 | steps: 19 | - uses: actions/checkout@v2 20 | 21 | - name: Use Node.js ${{ matrix.node-version }} 22 | uses: actions/setup-node@v1 23 | with: 24 | node-version: ${{ matrix.node-version }} 25 | 26 | - name: npm install, npm test 27 | run: | 28 | npm install 29 | npm test 30 | env: 31 | API_KEY: ${{ secrets.API_KEY }} 32 | API_SECRET: ${{ secrets.API_SECRET }} 33 | APP_USERNAME: ${{ secrets.APP_USERNAME }} 34 | PASSWORD: ${{ secrets.PASSWORD }} 35 | -------------------------------------------------------------------------------- /sdk/common/FDKError.d.ts: -------------------------------------------------------------------------------- 1 | export class FDKServerResponseError extends Error { 2 | /** 3 | * @param {string} message 4 | * @param {string} stackTrace 5 | * @param {string} [status] 6 | * @param {string} [code] 7 | */ 8 | constructor(message: string, stackTrace: string, status?: string, code?: string, details?: any); 9 | stackTrace: string; 10 | status: string; 11 | code: string; 12 | details: any; 13 | } 14 | export class FDKClientValidationError extends Error { 15 | constructor(errObj: any); 16 | details: any; 17 | } 18 | export class FDKInvalidCredentialError extends Error { 19 | constructor(message: any); 20 | } 21 | export class FDKTokenIssueError extends Error { 22 | constructor(message: any); 23 | } 24 | export class FDKOAuthCodeError extends Error { 25 | constructor(message: any); 26 | } 27 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "settle", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "jest --coverage", 8 | "prettier": "npx prettier -w ./sdk ./tests && npx tsc" 9 | }, 10 | "jest": { 11 | "coverageThreshold": { 12 | "global": { 13 | "branches": 0, 14 | "functions": 0, 15 | "lines": 0 16 | } 17 | } 18 | }, 19 | "author": "Pranav Mahadik ", 20 | "license": "ISC", 21 | "dependencies": { 22 | "@pixelbin/core": "^6.0.0", 23 | "axios": "^1.6.0", 24 | "axios-retry": "^3.3.1", 25 | "crypto-js": "^4.0.0", 26 | "joi": "^17.4.0", 27 | "query-string": "^6.14.1", 28 | "camelcase": "^6.2.0" 29 | }, 30 | "devDependencies": { 31 | "axios-mock-adapter": "^1.19.0", 32 | "coveralls": "^3.1.0", 33 | "dotenv": "^10.0.0", 34 | "jest": "^26.6.3" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.github/workflows/on_merge_main.yml: -------------------------------------------------------------------------------- 1 | name: Merge CI 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | 7 | jobs: 8 | build: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | strategy: 13 | matrix: 14 | node-version: [12.x, 14.x, 15.x] 15 | 16 | steps: 17 | - uses: actions/checkout@v2 18 | 19 | - name: Use Node.js ${{ matrix.node-version }} 20 | uses: actions/setup-node@v1 21 | with: 22 | node-version: ${{ matrix.node-version }} 23 | 24 | - name: npm install, npm test 25 | run: | 26 | npm install 27 | npm test 28 | env: 29 | API_KEY: ${{ secrets.API_KEY }} 30 | API_SECRET: ${{ secrets.API_SECRET }} 31 | APP_USERNAME: ${{ secrets.APP_USERNAME }} 32 | PASSWORD: ${{ secrets.PASSWORD }} 33 | 34 | - name: Coveralls (Uploading test report) 35 | uses: coverallsapp/github-action@master 36 | with: 37 | github-token: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /sdk/platform/PlatformConfig.d.ts: -------------------------------------------------------------------------------- 1 | export = PlatformConfig; 2 | declare class PlatformConfig { 3 | /** 4 | * @param {Object} config 5 | * @param {string} config.companyId 6 | * @param {string} config.domain 7 | * @param {string} config.key 8 | * @param {string} config.token 9 | * @param {string} config.secret 10 | * @param {boolean} config.useAutoRenewTimer 11 | */ 12 | constructor(config: { 13 | companyId: string; 14 | domain: string; 15 | key: string; 16 | token: string; 17 | secret: string; 18 | useAutoRenewTimer: boolean; 19 | }); 20 | companyId: string; 21 | organizationId: any; 22 | domain: string; 23 | apiKey: string; 24 | apiSecret: string; 25 | topSecret: string; 26 | useAutoRenewTimer: boolean; 27 | oauthClient: OauthClient; 28 | extraHeaders: any[]; 29 | getAccessToken(): Promise; 30 | } 31 | import OauthClient = require("./OAuthClient"); 32 | -------------------------------------------------------------------------------- /tests/helpers/cookie.helper.js: -------------------------------------------------------------------------------- 1 | const { FdkAxios } = require("../../index.js"); 2 | const cookie = {}; 3 | 4 | function setupCookieInterceptor() { 5 | FdkAxios.interceptors.request.handlers.push({ 6 | fulfilled: function (response) { 7 | if (cookie[response.baseURL]) { 8 | console.log("setting up cookies"); 9 | response.headers["cookie"] = cookie[response.baseURL]; 10 | } 11 | return response; 12 | }, 13 | rejected: function (err) { 14 | return Promise.reject(err); 15 | }, 16 | }); 17 | FdkAxios.interceptors.response.handlers.unshift({ 18 | fulfilled: function (response) { 19 | if (response && response.headers && response.headers["set-cookie"]) { 20 | cookie[response.config.baseURL] = response.headers["set-cookie"].join( 21 | " ; " 22 | ); 23 | } 24 | return response; 25 | }, 26 | rejected: function (err) { 27 | return Promise.reject(err); 28 | }, 29 | }); 30 | } 31 | module.exports = setupCookieInterceptor; 32 | -------------------------------------------------------------------------------- /sdk/platform/PlatformModels.d.ts: -------------------------------------------------------------------------------- 1 | export class CustomerValidator { 2 | static validate(): any; 3 | static createTransaction(): any; 4 | static link(): any; 5 | static unlink(): any; 6 | static refund(): any; 7 | static refundStatus(): any; 8 | static getSchemes(): any; 9 | static checkEligibility(): any; 10 | static getRepaymentLink(): any; 11 | static getAllCustomers(): any; 12 | static addVintageData(): any; 13 | } 14 | export class CreditValidator { 15 | static getOrderStatus(): any; 16 | static getEligiblePlans(): any; 17 | static updateOrderDeliveryStatus(): any; 18 | static getTransactions(): any; 19 | static getSettledTransactions(): any; 20 | } 21 | export class MultiKycValidator { 22 | static approvedLenders(): any; 23 | } 24 | export class MerchantValidator { 25 | static getAccessToken(): any; 26 | static renewAccessToken(): any; 27 | static validateCredentials(): any; 28 | } 29 | export class PaymentsValidator { 30 | static getUserCreditSummary(): any; 31 | } 32 | -------------------------------------------------------------------------------- /sdk/platform/PlatformConfig.js: -------------------------------------------------------------------------------- 1 | const OauthClient = require("./OAuthClient"); 2 | class PlatformConfig { 3 | /** 4 | * @param {Object} config 5 | * @param {string} config.companyId 6 | * @param {string} config.domain 7 | * @param {string} config.key 8 | * @param {string} config.token 9 | * @param {string} config.secret 10 | * @param {boolean} config.useAutoRenewTimer 11 | */ 12 | constructor(config) { 13 | this.companyId = config.companyId; 14 | this.organizationId = config.organizationId; 15 | this.domain = config.domain || "https://api.settle.club"; 16 | this.apiKey = config.key; 17 | this.apiSecret = config.token; 18 | this.topSecret = config.secret; 19 | this.useAutoRenewTimer = 20 | config.useAutoRenewTimer !== undefined ? config.useAutoRenewTimer : true; 21 | this.oauthClient = new OauthClient(this); 22 | this.extraHeaders = []; 23 | } 24 | async getAccessToken() { 25 | let token = await this.oauthClient.getAccessToken(); 26 | return token.access_token; 27 | } 28 | } 29 | 30 | module.exports = PlatformConfig; 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Fynd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /sdk/common/utils.d.ts: -------------------------------------------------------------------------------- 1 | export function transformRequestOptions(params: any): string; 2 | export function getParamsFromItem(params: any): string; 3 | export function getQuery(path: any): {}; 4 | export function trimChar(string?: string, charToRemove?: string): string; 5 | export function generateUrlWithParams(item: {}, params: any): string; 6 | export function findBestMatchingLink(allLinks?: any[], pathname?: string): { 7 | value: string; 8 | params: {}; 9 | }; 10 | export function validURL(str: any): boolean; 11 | /** 12 | * Creates a new URL by combining the specified URLs 13 | * 14 | * @param {string} baseURL The base URL 15 | * @param {string} relativeURL The relative URL 16 | * @returns {string} The combined URL 17 | */ 18 | export function combineURLs(baseURL: string, relativeURL: string): string; 19 | /** 20 | * Determines whether the specified URL is absolute 21 | * 22 | * @param {string} url The URL to test 23 | * @returns {boolean} True if the specified URL is absolute, otherwise false 24 | */ 25 | export function isAbsoluteURL(url: string): boolean; 26 | export namespace NAV_TYPE { 27 | const PAGE: string; 28 | const POPUP: string; 29 | } 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Usage 2 | 3 | ``` 4 | npm install git+https://github.com/settle-club/javascript-integration-sdk.git 5 | ``` 6 | 7 | or 8 | 9 | ``` 10 | yarn add https://github.com/settle-club/javascript-integration-sdk 11 | ``` 12 | 13 | ### Sample Usage 14 | 15 | ```javascript 16 | const { PlatformConfig, PlatformClient } = require("settle"); 17 | 18 | const platformConfig = new PlatformConfig({ 19 | key: "API_KEY", 20 | token: "API_TOKEN", 21 | secret: "API_SECRET", 22 | companyId: "COMPANY_ID", 23 | domain: "https://api.settle.club", 24 | useAutoRenewTimer: true, 25 | }); 26 | 27 | async function verifyCustomer() { 28 | try { 29 | // Create a client using your credentials 30 | const client = new PlatformClient(platformConfig); 31 | 32 | // Call APIs using their correponding methods 33 | const result = await client.customer.verify({ 34 | organizationId: "COMPANY_ID", 35 | body: { 36 | "customer": { 37 | "uid": "1", 38 | "countryCode": "91", 39 | "mobile": "8888888888" 40 | }, 41 | "order": { 42 | "valueInPaise": 10000, 43 | "uid": "1" 44 | } 45 | }, 46 | }); 47 | } catch (err) { 48 | console.log(err); 49 | } 50 | } 51 | 52 | verifyCustomer(); 53 | ``` 54 | -------------------------------------------------------------------------------- /tests/helpers/oauth.helper.js: -------------------------------------------------------------------------------- 1 | const { FdkAxios } = require("../../index.js"); 2 | const setupCookieInterceptor = require("./cookie.helper"); 3 | 4 | async function setAccesstoken(platformConfig) { 5 | setupCookieInterceptor(); 6 | await loginUser(platformConfig); 7 | let reqData = { 8 | grant_type: "client_credentials", 9 | client_id: platformConfig.apiKey, 10 | client_secret: platformConfig.apiSecret, 11 | }; 12 | 13 | let url = `${platformConfig.domain}/service/panel/authentication/v1.0/company/${platformConfig.companyId}/oauth/token`; 14 | const rawRequest = { 15 | method: "post", 16 | url: url, 17 | data: reqData, 18 | headers: { 19 | "Content-Type": "application/json", 20 | }, 21 | }; 22 | return FdkAxios.request(rawRequest); 23 | } 24 | 25 | async function loginUser(platformConfig) { 26 | const skywarpURL = `${platformConfig.domain}/service/panel/authentication/v1.0/auth/login/password`; 27 | const userData = { 28 | username: process.env.APP_USERNAME, 29 | password: process.env.PASSWORD, 30 | "g-recaptcha-response": "_skip_", 31 | }; 32 | const rawRequest = { 33 | method: "post", 34 | url: skywarpURL, 35 | data: userData, 36 | headers: { 37 | "Content-Type": "application/json", 38 | }, 39 | }; 40 | return FdkAxios.request(rawRequest); 41 | } 42 | 43 | module.exports = setAccesstoken; 44 | -------------------------------------------------------------------------------- /sdk/common/FDKError.js: -------------------------------------------------------------------------------- 1 | class FDKServerResponseError extends Error { 2 | /** 3 | * @param {string} message 4 | * @param {string} stackTrace 5 | * @param {string} [status] 6 | * @param {string} [code] 7 | */ 8 | constructor(message, stackTrace, status = null, code = null, details = null) { 9 | super(message); 10 | this.name = "FDKServerResponseError"; 11 | this.stackTrace = stackTrace; 12 | this.status = status; 13 | this.code = code; 14 | this.details = details; 15 | } 16 | } 17 | 18 | class FDKClientValidationError extends Error { 19 | constructor(errObj) { 20 | super(errObj.message); 21 | this.name = "FDKClientValidationError"; 22 | this.details = errObj.details; 23 | } 24 | } 25 | 26 | class FDKInvalidCredentialError extends Error { 27 | constructor(message) { 28 | super(message); 29 | this.name = "FDKInvalidCredentialError"; 30 | } 31 | } 32 | class FDKTokenIssueError extends Error { 33 | constructor(message) { 34 | super(message); 35 | this.name = "FDKTokenIssueError"; 36 | } 37 | } 38 | class FDKOAuthCodeError extends Error { 39 | constructor(message) { 40 | super(message); 41 | this.name = "FDKOAuthCodeError"; 42 | } 43 | } 44 | 45 | module.exports = { 46 | FDKServerResponseError, 47 | FDKClientValidationError, 48 | FDKInvalidCredentialError, 49 | FDKTokenIssueError, 50 | FDKOAuthCodeError, 51 | }; 52 | -------------------------------------------------------------------------------- /sdk/platform/PlatformAPIClient.js: -------------------------------------------------------------------------------- 1 | const { fdkAxios } = require("../common/AxiosHelper"); 2 | 3 | class APIClient { 4 | /** 5 | * @param {object} conf 6 | * @param {string} method 7 | * @param {string} url 8 | * @param {object} query 9 | * @param {object} body 10 | * @param {object} headers 11 | */ 12 | static async execute(conf, method, url, query, body, headers = {}) { 13 | const isOauthRoute = url?.includes("/oauth/"); 14 | let token; 15 | if (isOauthRoute) { 16 | token = Buffer.from(`${conf.apiKey}:${conf.apiSecret}`, "utf8").toString( 17 | "base64" 18 | ); 19 | } else { 20 | token = await conf.oauthClient.getAccessToken(); 21 | } 22 | 23 | let extraHeaders = conf.extraHeaders.reduce((acc, curr) => { 24 | acc = { ...acc, ...curr }; 25 | return acc; 26 | }, {}); 27 | if (conf.topSecret) { 28 | extraHeaders["x-merchant-secret"] = conf.topSecret; 29 | } 30 | extraHeaders["x-source"] = "platform"; 31 | 32 | const rawRequest = { 33 | baseURL: conf.domain, 34 | method: method, 35 | url: url, 36 | params: query, 37 | data: body, 38 | headers: { 39 | Authorization: (isOauthRoute ? "Basic " : "Bearer ") + token, 40 | ...extraHeaders, 41 | ...headers, 42 | }, 43 | }; 44 | 45 | return fdkAxios.request(rawRequest); 46 | } 47 | 48 | async get(url, config) { 49 | let access_token = await this.configuration.getAccessToken(); 50 | config = config || {}; 51 | config.headers = config.headers || {}; 52 | config.headers.Authorization = "Bearer " + access_token; 53 | return axios.get(url); 54 | } 55 | } 56 | module.exports = APIClient; 57 | -------------------------------------------------------------------------------- /sdk/common/Utility.js: -------------------------------------------------------------------------------- 1 | const utils = require("./utils"); 2 | const Constant = require("./Constant"); 3 | 4 | function convertUrlToAction(url) { 5 | const path = utils.trimChar(url); 6 | const query = utils.getQuery(path); 7 | const pathname = utils.validURL(path) 8 | ? new URL(path).pathname 9 | : path.split("?")[0]; 10 | const allNavigations = Object.assign({}, Constant.NAVIGATORS); 11 | const allLinks = Object.values(allNavigations).map((nav) => { 12 | return nav["link"]; 13 | }); 14 | allLinks.sort(function (a, b) { 15 | return b.length - a.length; 16 | }); 17 | const bestMatchingLink = utils.findBestMatchingLink(allLinks, pathname); 18 | let closestMatchingNavKey = Object.keys(allNavigations).find((pageType) => { 19 | return ( 20 | utils.trimChar(allNavigations[pageType]["link"]) === 21 | bestMatchingLink.value 22 | ); 23 | }); 24 | if (!closestMatchingNavKey) { 25 | closestMatchingNavKey = "home"; 26 | } 27 | return { 28 | type: "page", 29 | page: { 30 | type: closestMatchingNavKey, 31 | query: query, 32 | params: bestMatchingLink.params, 33 | }, 34 | }; 35 | } 36 | 37 | function convertPageToUrl(action) { 38 | const item = Object.assign({}, Constant.NAVIGATORS[action.page.type]); 39 | if (item) { 40 | //get param 41 | item.link = utils.generateUrlWithParams(item, action.page.params); 42 | //get query 43 | if (action.page.query && Object.keys(action.page.query).length > 0) { 44 | item.link += "/?" + utils.transformRequestOptions(action.page.query); 45 | } 46 | return item.link; 47 | } 48 | return ""; 49 | } 50 | 51 | function convertActionToUrl(action) { 52 | switch (action.type) { 53 | case utils.NAV_TYPE.PAGE: { 54 | const item = Object.assign({}, Constant.NAVIGATORS[action.page.type]); 55 | if (item) { 56 | //get param 57 | item.link = utils.generateUrlWithParams(item, action.page.params); 58 | //get query 59 | if (action.page.query && Object.keys(action.page.query).length > 0) { 60 | item.link += "/?" + utils.transformRequestOptions(action.page.query); 61 | } 62 | return item.link; 63 | } 64 | return ""; 65 | } 66 | case utils.NAV_TYPE.POPUP: { 67 | break; 68 | } 69 | } 70 | } 71 | 72 | module.exports = { 73 | convertActionToUrl, 74 | convertUrlToAction, 75 | convertPageToUrl, 76 | }; 77 | -------------------------------------------------------------------------------- /sdk/platform/OAuthClient.js: -------------------------------------------------------------------------------- 1 | const querystring = require("query-string"); 2 | const { fdkAxios } = require("../common/AxiosHelper"); 3 | const { sign } = require("../common/RequestSigner"); 4 | const { FDKTokenIssueError, FDKOAuthCodeError } = require("../common/FDKError"); 5 | class OAuthClient { 6 | constructor(config) { 7 | this.config = config; 8 | this.token = null; 9 | this.refreshToken = null; 10 | this.retryOAuthTokenTimer = null; 11 | this.raw_token = null; 12 | this.token_expires_in = null; 13 | this.token_expires_at = 0; 14 | this.useAutoRenewTimer = 15 | config.useAutoRenewTimer !== undefined ? config.useAutoRenewTimer : true; 16 | this.refresh_token_time = null; 17 | } 18 | 19 | async getAccessToken() { 20 | if ( 21 | !this.useAutoRenewTimer && 22 | this.refreshToken && 23 | this.isTokenExpired(this.refresh_token_time) 24 | ) { 25 | // Check if token is about to expire in less than 2 mins. 26 | // Renew if to be expired and auto renew timer is not enabled. 27 | await this.renewAccessToken(); 28 | } 29 | if (this.token == null) { 30 | let res = await this.getAccesstokenObj({ 31 | grant_type: "authorization_code", 32 | }); 33 | return this.setToken(res); 34 | } else { 35 | return this.token; 36 | } 37 | } 38 | 39 | // default TTL checked 0 seconds 40 | isTokenExpired(ttl = 0) { 41 | const currentTimestamp = new Date().getTime(); 42 | // Check if token is about to expire in less than 2 mins 43 | if ((this.token_expires_at - currentTimestamp) / 1000 < ttl) { 44 | return true; 45 | } 46 | return false; 47 | } 48 | 49 | setToken(token) { 50 | this.raw_token = token; 51 | this.token_expires_in = token.tokenExpiryIn; 52 | this.token = token.accessToken; 53 | this.refresh_token_time = token.tokenExpiryIn / 2; 54 | this.refreshToken = token.refreshToken ? token.refreshToken : null; 55 | if (this.refreshToken && this.useAutoRenewTimer) { 56 | this.retryOAuthToken(token.tokenExpiryIn); 57 | } 58 | return token.accessToken; 59 | } 60 | 61 | retryOAuthToken(expires_in) { 62 | if (this.retryOAuthTokenTimer) { 63 | clearTimeout(this.retryOAuthTokenTimer); 64 | } 65 | if (expires_in > this.refresh_token_time) { 66 | this.retryOAuthTokenTimer = setTimeout(() => { 67 | this.renewAccessToken(); 68 | }, (expires_in - this.refresh_token_time) * 1000); 69 | } 70 | } 71 | 72 | async renewAccessToken() { 73 | try { 74 | let res = await this.getAccesstokenObj({ 75 | grant_type: "refresh_token", 76 | refresh_token: this.refreshToken, 77 | }); 78 | this.setToken(res); 79 | this.token_expires_at = 80 | new Date().getTime() + this.token_expires_in * 1000; 81 | return res; 82 | } catch (error) { 83 | if (error.isAxiosError) { 84 | throw new FDKTokenIssueError(error.message); 85 | } 86 | throw error; 87 | } 88 | } 89 | 90 | async getAccesstokenObj({ grant_type, refresh_token, code }) { 91 | let reqData = { 92 | grant_type: grant_type, 93 | }; 94 | let url = undefined; 95 | if (grant_type === "refresh_token") { 96 | reqData = { ...reqData, token: refresh_token }; 97 | url = `${this.config.domain}/service/integration/staff/authentication/oauth/${this.config.apiKey}/token`; 98 | } else if (grant_type === "authorization_code") { 99 | url = `${this.config.domain}/service/integration/staff/authentication/oauth/${this.config.apiKey}/authorize`; 100 | reqData = { ...reqData, code }; 101 | } 102 | const token = Buffer.from( 103 | `${this.config.apiKey}:${this.config.apiSecret}`, 104 | "utf8" 105 | ).toString("base64"); 106 | 107 | const rawRequest = { 108 | method: "post", 109 | url: url, 110 | data: querystring.stringify(reqData), 111 | headers: { 112 | Authorization: `Basic ${token}`, 113 | "Content-Type": "application/x-www-form-urlencoded", 114 | "x-merchant-secret": this.config.topSecret, 115 | }, 116 | }; 117 | return fdkAxios.request(rawRequest); 118 | } 119 | } 120 | 121 | module.exports = OAuthClient; 122 | -------------------------------------------------------------------------------- /sdk/common/AxiosHelper.js: -------------------------------------------------------------------------------- 1 | const { combineURLs, isAbsoluteURL } = require("./utils"); 2 | const axios = require("axios"); 3 | const axiosRetry = require("axios-retry"); 4 | const querystring = require("query-string"); 5 | const { sign } = require("./RequestSigner"); 6 | const { FDKServerResponseError } = require("./FDKError"); 7 | axios.defaults.withCredentials = true; 8 | 9 | function getTransformer(config) { 10 | const { transformRequest } = config; 11 | 12 | if (transformRequest) { 13 | if (typeof transformRequest === "function") { 14 | return transformRequest; 15 | } else if (transformRequest.length) { 16 | return transformRequest[0]; 17 | } 18 | } 19 | 20 | throw new Error( 21 | "Could not get default transformRequest function from Axios defaults" 22 | ); 23 | } 24 | 25 | function requestInterceptorFn() { 26 | return (config) => { 27 | if (!config.url) { 28 | throw new Error( 29 | "No URL present in request config, unable to sign request" 30 | ); 31 | } 32 | 33 | let url = config.url; 34 | if (config.baseURL && !isAbsoluteURL(config.url)) { 35 | url = combineURLs(config.baseURL, config.url); 36 | } 37 | const { host, pathname, search } = new URL(url); 38 | const { data, headers, method, params } = config; 39 | headers["x-ptl-sdk-version"] = "v1.0"; 40 | let querySearchObj = querystring.parse(search); 41 | querySearchObj = { ...querySearchObj, ...params }; 42 | let queryParam = ""; 43 | if (querySearchObj && Object.keys(querySearchObj).length) { 44 | if (querystring.stringify(querySearchObj).trim() !== "") { 45 | queryParam = `?${querystring.stringify(querySearchObj)}`; 46 | } 47 | } 48 | let transformedData; 49 | if (method != "get") { 50 | const transformRequest = getTransformer(config); 51 | transformedData = transformRequest(data, headers); 52 | } 53 | 54 | // Remove all the default Axios headers 55 | const { 56 | common, 57 | delete: _delete, // 'delete' is a reserved word 58 | get, 59 | head, 60 | post, 61 | put, 62 | patch, 63 | ...headersToSign 64 | } = headers; 65 | 66 | const signingOptions = { 67 | method: method && method.toUpperCase(), 68 | host: host, 69 | path: pathname + search + queryParam, 70 | body: transformedData, 71 | headers: headersToSign, 72 | secret: headers["x-merchant-secret"], 73 | }; 74 | delete headers["x-merchant-secret"]; 75 | sign(signingOptions, headers["x-source"]); 76 | delete headers["x-source"]; 77 | 78 | config.headers["x-ptl-date"] = signingOptions.headers["x-ptl-date"]; 79 | config.headers["x-ptl-signature"] = 80 | signingOptions.headers["x-ptl-signature"]; 81 | return config; 82 | }; 83 | } 84 | const fdkAxios = axios.create({ 85 | paramsSerializer: (params) => { 86 | return querystring.stringify(params); 87 | }, 88 | }); 89 | 90 | axiosRetry(fdkAxios, { retries: 2 }, { retryDelay: 1000 }); 91 | 92 | fdkAxios.interceptors.request.use(requestInterceptorFn()); 93 | fdkAxios.interceptors.response.use( 94 | function (response) { 95 | if (response.config.method == "head") { 96 | return response.headers; 97 | } 98 | if (process.env.INCLUDE_HEADERS_IN_RESPONSE) { 99 | response.data.__headers = response.headers; 100 | } 101 | return response.data; // IF 2XX then return response.data only 102 | }, 103 | function (error) { 104 | if (error.response) { 105 | // Request made and server responded 106 | throw new FDKServerResponseError( 107 | error.response.data.message || error.message, 108 | error.response.data.stack || error.stack, 109 | error.response.statusText, 110 | error.response.status, 111 | error.response.data 112 | ); 113 | } else if (error.request) { 114 | // The request was made but no error.response was received 115 | throw new FDKServerResponseError( 116 | error.message, 117 | error.stack, 118 | error.code, 119 | error.code 120 | ); 121 | } else { 122 | // Something happened in setting up the request that triggered an Error 123 | throw new FDKServerResponseError(error.message, error.stack); 124 | } 125 | } 126 | ); 127 | 128 | module.exports = { 129 | fdkAxios, 130 | }; 131 | -------------------------------------------------------------------------------- /sdk/common/Storage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @callback OnProgressCallback 3 | * @param {number} progress - Upload progress in percentage. 4 | */ 5 | 6 | /** 7 | * Uploads a file to Google Cloud Storage (GCS) using a signed URL. 8 | * 9 | * @param {File} file - The file to be uploaded. 10 | * @param signedDetails - An object containing the signed URL and other details 11 | * for the upload. 12 | * @param {OnProgressCallback} [onProgress] - An optional callback function to 13 | * handle progress updates. Receives progress as a percentage. 14 | * @returns {Promise} A promise that resolves with the response from the 15 | * GCS upload. 16 | * @throws {Error} Throws an error if the upload fails. 17 | */ 18 | const uploadFileToGcs = (file, signedDetails, onProgress) => { 19 | return new Promise((resolve, reject) => { 20 | const xhr = new XMLHttpRequest(); 21 | xhr.open("PUT", signedDetails.signedUrl); 22 | 23 | // Assuming file.type contains something like "video/webm;codecs=vp9" 24 | const mainMimeType = file.type.split(";")[0]; // This splits the string at ';' and takes the first part, i.e., "video/webm" 25 | // Set the request headers 26 | xhr.setRequestHeader( 27 | "Content-Type", 28 | mainMimeType || "application/octet-stream" 29 | ); 30 | 31 | // Handle the response 32 | xhr.onload = () => { 33 | if (xhr.status >= 200 && xhr.status < 300) { 34 | resolve(xhr.response); 35 | } else { 36 | reject(new Error("An error occurred while uploading file.")); 37 | } 38 | }; 39 | 40 | // Handle network errors 41 | xhr.onerror = () => { 42 | reject(new Error("A network error occurred while uploading file.")); 43 | }; 44 | 45 | // Progress event 46 | xhr.upload.onprogress = (event) => { 47 | if (event.lengthComputable) { 48 | const progress = (event.loaded / event.total) * 100; 49 | // Call the onProgress callback with the progress value 50 | if (typeof onProgress === "function") { 51 | onProgress(progress); 52 | } 53 | } 54 | }; 55 | 56 | // Send the request 57 | xhr.send(file); 58 | }); 59 | }; 60 | 61 | /** 62 | * Asynchronously uploads a file to Pixelbin cloud storage, providing progress updates. 63 | * 64 | * This function initiates the upload of a given file to Pixelbin using a signed URL. 65 | * 66 | * @param {File} file - The file object to be uploaded. 67 | * @param signedDetails - Contains the signed URL and the file URL for checking 68 | * the upload status. 69 | * @param {OnProgressCallback} [onProgress] - An optional callback function that 70 | * receives upload progress updates. Receives progress as a percentage. 71 | * @returns {Promise} A promise that resolves when the file is 72 | * successfully uploaded or rejects if an error occurs. 73 | * @throws {Error} Throws an error if the upload fails due to network issues or 74 | * if the server responds with a status indicating failure. 75 | */ 76 | const uploadFileToPixelbin = async (file, signedDetails, onProgress) => { 77 | const Pixelbin = require("@pixelbin/core"); 78 | 79 | let lastProgress = 0; 80 | 81 | // Send random progress updates before Pixelbin.upload is called 82 | const sendRandomProgress = () => { 83 | if (typeof onProgress === "function") { 84 | // Ensure the new random progress is always greater than the last sent progress 85 | const minProgress = Math.min(lastProgress + 1, 49); // Ensure it doesn't exceed 49 86 | const randomProgress = Math.floor( 87 | Math.random() * (50 - minProgress) + minProgress 88 | ); 89 | lastProgress = randomProgress; 90 | onProgress(randomProgress); 91 | } 92 | }; 93 | 94 | const randomProgressInterval = setInterval(sendRandomProgress, 1000); 95 | 96 | await Pixelbin.default.upload(file, signedDetails.signedUrl); 97 | 98 | clearInterval(randomProgressInterval); 99 | 100 | // Once Pixelbin.upload has returned, send 50 progress 101 | if (typeof onProgress === "function") { 102 | lastProgress = 50; // Update lastProgress to reflect this manual update 103 | onProgress(50); 104 | } 105 | 106 | const axios = require("axios"); 107 | axios.defaults.withCredentials = false; 108 | 109 | return new Promise((resolve, reject) => { 110 | const interval = setInterval(() => { 111 | axios 112 | .head(signedDetails.fileUrl) 113 | .then((response) => { 114 | if (response.status === 200) { 115 | if (interval) clearInterval(interval); 116 | // Once HEAD call returns 200, send 100 progress 117 | if (typeof onProgress === "function") { 118 | onProgress(100); 119 | } 120 | resolve(); 121 | } 122 | }) 123 | .catch((error) => { 124 | const parsedError = JSON.parse(JSON.stringify(error)); 125 | console.error("Error:", error.message); 126 | // Error status is null in case of 429 127 | if (parsedError.status === null || parsedError.status === 429) { 128 | if (interval) clearInterval(interval); 129 | reject(new Error("An error occurred while uploading file.")); 130 | } 131 | }); 132 | }, Number(process.env.PIXELBIN_HEAD_POLLING_INTERVAL) || 3000); 133 | }); 134 | }; 135 | 136 | /** 137 | * Uploads a file to a cloud storage provider using a signed URL. 138 | * 139 | * @param {File} file - The file to be uploaded. 140 | * @param signedDetails - An object containing details required for the upload, 141 | * including the provider. 142 | * @param {OnProgressCallback} [onProgress] - An optional callback function to 143 | * handle progress updates. Receives progress as a percentage. 144 | * @returns {Promise} A promise that resolves with the response from the upload. 145 | * @throws {Error} Throws an error if the provider is unsupported or the upload fails. 146 | */ 147 | const uploadFile = async (file, signedDetails, onProgress) => { 148 | switch (signedDetails.provider) { 149 | case "gcp": { 150 | return await uploadFileToGcs(file, signedDetails, onProgress); 151 | } 152 | case "pixelbin": { 153 | return await uploadFileToPixelbin(file, signedDetails, onProgress); 154 | } 155 | default: { 156 | throw new Error("Unsupported provider"); 157 | } 158 | } 159 | }; 160 | 161 | module.exports = { 162 | uploadFile, 163 | }; 164 | -------------------------------------------------------------------------------- /sdk/common/utils.js: -------------------------------------------------------------------------------- 1 | const SLUG_DELIMETER = ":::"; 2 | const transformRequestOptions = (params) => { 3 | let options = ""; 4 | 5 | for (const key in params) { 6 | if (typeof params[key] !== "object" && params[key]) { 7 | const encodeVal = encodeURIComponent(params[key]); 8 | options += `${key}=${encodeVal}&`; 9 | } else if (Array.isArray(params[key])) { 10 | params[key].forEach((el) => { 11 | const encodeVal = encodeURIComponent(el); 12 | options += `${key}=${encodeVal}&`; 13 | }); 14 | } else if (typeof params[key] === "object" && params[key]) { 15 | options += transformRequestOptions(params[key]); 16 | } 17 | } 18 | return options ? options.slice(0, -1) : options; 19 | }; 20 | 21 | const getParamsFromItem = (params) => { 22 | let strParam = ""; 23 | for (let key in params) { 24 | if (Array.isArray(params[key])) { 25 | for (let index = 0; index < params[key].length; index++) { 26 | strParam += 27 | index === params[key].length - 1 28 | ? params[key][index] 29 | : params[key][index] + SLUG_DELIMETER; 30 | } 31 | return strParam; 32 | } 33 | } 34 | return strParam; 35 | }; 36 | const generateUrlWithParams = (item = {}, params) => { 37 | if (!item || !item.link) return ""; 38 | if (!params) return `/${trimChar(item.link.split(":")[0])}`; 39 | const joinedParamsObj = {}; 40 | for (let key in params) { 41 | if (Array.isArray(params[key])) { 42 | let joinedParams = ""; 43 | for (let index = 0; index < params[key].length; index++) { 44 | joinedParams += 45 | index === params[key].length - 1 46 | ? params[key][index] 47 | : params[key][index] + SLUG_DELIMETER; 48 | } 49 | joinedParamsObj[key] = joinedParams; 50 | } 51 | } 52 | item.link = trimChar(item.link); 53 | 54 | let linkArr = item.link.split("/"); 55 | let url = ""; 56 | for (let linkSubString of linkArr) { 57 | if (linkSubString.startsWith(":")) { 58 | linkSubString = linkSubString.slice(1); 59 | url += `${joinedParamsObj[linkSubString]}`; 60 | } else url += `${linkSubString}`; 61 | url += "/"; 62 | } 63 | url = trimChar(url); 64 | return `/${url}`; 65 | }; 66 | const getQuery = (path) => { 67 | let parseUrl = path.split("?"); 68 | if (parseUrl.length > 1) { 69 | const searchParams = new URLSearchParams(parseUrl[1]); 70 | let queryResult = {}; 71 | for (let item of searchParams) { 72 | let key = item[0], 73 | value = item[1]; 74 | 75 | queryResult[key] = queryResult[key] 76 | ? [...queryResult[key], value] 77 | : [value]; 78 | } 79 | return queryResult; 80 | } 81 | return {}; 82 | }; 83 | const trimChar = (string = "", charToRemove = "/") => { 84 | while (string.charAt(0) == charToRemove) { 85 | string = string.substring(1); 86 | } 87 | 88 | while (string.charAt(string.length - 1) == charToRemove) { 89 | string = string.substring(0, string.length - 1); 90 | } 91 | 92 | return string; 93 | }; 94 | 95 | function validURL(str) { 96 | var pattern = new RegExp( 97 | "^(https?:\\/\\/)?" + // protocol 98 | "((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|" + // domain name 99 | "((\\d{1,3}\\.){3}\\d{1,3}))" + // OR ip (v4) address 100 | "(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*" + // port and path 101 | "(\\?[;&a-z\\d%_.~+=-]*)?" + // query string 102 | "(\\#[-a-z\\d_]*)?$", 103 | "i" 104 | ); // fragment locator 105 | return !!pattern.test(str); 106 | } 107 | 108 | const findBestMatchingLink = (allLinks = [], pathname = "/") => { 109 | let bestMatch = { value: "", params: {} }; 110 | pathname = trimChar(pathname); // -> product/test-product-tag/reviews 111 | for (let i = 0; i < allLinks.length; i++) { 112 | let link = trimChar(allLinks[i]); // -> product/:slug/add-reviews 113 | if (new RegExp(`^${trimChar(link)}`).test(pathname)) { 114 | bestMatch.value = link; 115 | break; 116 | } 117 | const linkArr = link.split("/"); // -> [ 'product', ':slug', 'add-reviews' ] 118 | const pathArr = pathname.split("/"); // -> [ 'product', 'test-product-tag', 'reviews' ] 119 | if (linkArr.length === pathArr.length) { 120 | // some match 121 | let j; 122 | bestMatch = { value: "", params: {} }; 123 | for (j = 0; j < linkArr.length; ++j) { 124 | if (linkArr[j].startsWith(":")) { 125 | // this will be :slug & test-slug 126 | let arrParams = []; 127 | if (pathArr[j].includes(SLUG_DELIMETER)) { 128 | // if link container multiple path params eg test-slug--test-slug-123 129 | arrParams = pathArr[j].split(SLUG_DELIMETER); // split it into array 130 | } else arrParams = [pathArr[j]]; // else assign 131 | if (bestMatch.params[linkArr[j].slice(1)]) { 132 | // if params is already present in best match object spread new params 133 | arrParams = [ 134 | ...bestMatch.params[linkArr[j].slice(1)], 135 | ...arrParams, 136 | ]; 137 | } 138 | bestMatch.params[linkArr[j].slice(1)] = arrParams; // else assign 139 | } else if (linkArr[j] !== pathArr[j]) break; // if path and link params not match and are not :slug type break and move to next link 140 | } 141 | if (j === linkArr.length) { 142 | // if all paths match and j is not 0 coz 'about-us' & 'notification' have same length and in that case j will be 0. This type of matching is handled in Regex on line #100 143 | bestMatch.value = link; 144 | break; 145 | } 146 | } 147 | } 148 | return bestMatch; 149 | }; 150 | 151 | /** 152 | * Creates a new URL by combining the specified URLs 153 | * 154 | * @param {string} baseURL The base URL 155 | * @param {string} relativeURL The relative URL 156 | * @returns {string} The combined URL 157 | */ 158 | function combineURLs(baseURL, relativeURL) { 159 | return relativeURL 160 | ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") 161 | : baseURL; 162 | } 163 | 164 | ("use strict"); 165 | 166 | /** 167 | * Determines whether the specified URL is absolute 168 | * 169 | * @param {string} url The URL to test 170 | * @returns {boolean} True if the specified URL is absolute, otherwise false 171 | */ 172 | function isAbsoluteURL(url) { 173 | // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). 174 | // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed 175 | // by any combination of letters, digits, plus, period, or hyphen. 176 | return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); 177 | } 178 | 179 | const NAV_TYPE = { 180 | PAGE: "page", 181 | POPUP: "popup", 182 | }; 183 | 184 | module.exports = { 185 | transformRequestOptions, 186 | getParamsFromItem, 187 | getQuery, 188 | trimChar, 189 | generateUrlWithParams, 190 | findBestMatchingLink, 191 | validURL, 192 | combineURLs, 193 | isAbsoluteURL, 194 | NAV_TYPE, 195 | }; 196 | -------------------------------------------------------------------------------- /sdk/common/Constant.js: -------------------------------------------------------------------------------- 1 | const AVAILABLE_PAGE_TYPE = { 2 | EXTERNAL: "external", 3 | LOGIN: "login", 4 | HOME: "home", 5 | TRANSACTIONS: "transactions", 6 | TRANSACTIONDETAILS: "transactionDetails", 7 | REWARDS: "rewards", 8 | REFERANDEARN: "referAndEarn", 9 | PROFILE: "profile", 10 | SETUPAUTOPAY: "setupAutopay", 11 | UPDATEEMAIL: "updateEmail", 12 | REPORTISSUE: "reportIssue", 13 | CREDITSCORE: "creditScore", 14 | AUTOPAY: "autoPay", 15 | HELPCENTER: "helpCenter", 16 | KYCINIT: "kycInit", 17 | ACCESSDIGILOCKER: "accessDigilocker", 18 | LIVELINESS: "liveliness", 19 | LENDERONBOARD: "lenderOnboard", 20 | LENDER: "lender", 21 | KYCDOCS: "kycDocs", 22 | KYCSELFIE: "kycSelfie", 23 | KYCSTATUS: "kycStatus", 24 | KYCERROR: "kycError", 25 | KYCDIGILOCKERRESPONSE: "kycDigilockerResponse", 26 | KYCINITRESPONSE: "kycInitResponse", 27 | REPAYMENT: "repayment", 28 | NETBANKINGREPAYMENT: "netBankingRepayment", 29 | UPIREPAYMENT: "upiRepayment", 30 | SANCTIONLETTER: "sanctionLetter", 31 | KFS: "kfs", 32 | DYNAMICPAGE: "dynamicPage", 33 | }; 34 | 35 | Object.freeze(AVAILABLE_PAGE_TYPE); 36 | 37 | const NAVIGATORS = { 38 | external: { 39 | canBuildLink: true, 40 | name: "External Link", 41 | link: "/external/:url", 42 | query: [ 43 | { 44 | name: "URL", 45 | key: "url", 46 | required: true, 47 | }, 48 | ], 49 | }, 50 | login: { 51 | canBuildLink: false, 52 | name: "Login", 53 | link: "/login", 54 | }, 55 | home: { 56 | canBuildLink: true, 57 | screenType: "DASHBOARD, PAN, LENDERS", 58 | name: "Home", 59 | link: "/", 60 | }, 61 | transactions: { 62 | canBuildLink: true, 63 | name: "Transactions", 64 | link: "/transactions", 65 | }, 66 | transactionDetails: { 67 | canBuildLink: false, 68 | name: "Transaction Details", 69 | link: "/transactions/:id", 70 | params: [ 71 | { 72 | name: "Transaction Id", 73 | key: "id", 74 | required: true, 75 | }, 76 | ], 77 | }, 78 | rewards: { 79 | canBuildLink: true, 80 | name: "Rewards", 81 | link: "/rewards", 82 | }, 83 | referAndEarn: { 84 | canBuildLink: true, 85 | name: "Refer", 86 | link: "/refer", 87 | }, 88 | profile: { 89 | canBuildLink: true, 90 | name: "Profile", 91 | link: "/profile", 92 | }, 93 | setupAutopay: { 94 | canBuildLink: false, 95 | name: "AutoPay", 96 | link: "/autopay", 97 | }, 98 | updateEmail: { 99 | canBuildLink: true, 100 | name: "Update Email", 101 | link: "/profile/email", 102 | }, 103 | reportIssue: { 104 | canBuildLink: true, 105 | name: "Report Issue", 106 | link: "/profile/report", 107 | }, 108 | creditScore: { 109 | canBuildLink: true, 110 | name: "Credit Score", 111 | link: "/credit-score", 112 | }, 113 | autoPay: { 114 | canBuildLink: false, 115 | name: "Setup Autopay", 116 | link: "/autopay", 117 | }, 118 | helpCenter: { 119 | canBuildLink: true, 120 | name: "Help Center", 121 | link: "/profile/help-center", 122 | }, 123 | kycInit: { 124 | canBuildLink: false, 125 | name: "Start KYC", 126 | link: "/kyc", 127 | }, 128 | accessDigilocker: { 129 | canBuildLink: false, 130 | name: "Access Digilocker", 131 | link: "/kyc/:lender/access-digilocker", 132 | params: [ 133 | { 134 | name: "Lender", 135 | key: "lender", 136 | required: true, 137 | }, 138 | ], 139 | }, 140 | liveliness: { 141 | canBuildLink: false, 142 | name: "Liveliness", 143 | link: "/kyc/:lender/selfie", 144 | params: [ 145 | { 146 | name: "Lender", 147 | key: "lender", 148 | required: true, 149 | }, 150 | ], 151 | }, 152 | lenderOnboard: { 153 | canBuildLink: false, 154 | name: "Lender Onboard", 155 | link: "/kyc/:lender/lender-onboard", 156 | params: [ 157 | { 158 | name: "Lender", 159 | key: "lender", 160 | required: true, 161 | }, 162 | ], 163 | }, 164 | lender: { 165 | canBuildLink: false, 166 | name: "Lender", 167 | link: "/lender/:lenderName", 168 | params: [ 169 | { 170 | name: "Lender Name", 171 | key: "lenderName", 172 | required: true, 173 | }, 174 | ], 175 | }, 176 | kycDocs: { 177 | canBuildLink: false, 178 | name: "Verify KYC Documents", 179 | link: "/kyc/documents", 180 | }, 181 | kycSelfie: { 182 | canBuildLink: false, 183 | name: "Verify KYC Selfie", 184 | link: "/kyc/selfie", 185 | }, 186 | kycStatus: { 187 | canBuildLink: false, 188 | name: "KYC Status", 189 | link: "/kyc/status", 190 | }, 191 | kycError: { 192 | canBuildLink: false, 193 | name: "KYC Error", 194 | link: "/kyc/error", 195 | }, 196 | kycDigilockerResponse: { 197 | canBuildLink: false, 198 | name: "KYC Digilocker Response", 199 | link: "/kyc/digilocker-response", 200 | }, 201 | kycInitResponse: { 202 | canBuildLink: false, 203 | name: "KYC Init Response", 204 | link: "/kyc/init-response", 205 | }, 206 | repayment: { 207 | canBuildLink: false, 208 | name: "Repayment", 209 | link: "/repayment", 210 | query: [ 211 | { 212 | name: "Transcation Id", 213 | key: "tid", 214 | required: false, 215 | }, 216 | { 217 | name: "Intent Id", 218 | key: "intentid", 219 | required: false, 220 | }, 221 | ], 222 | }, 223 | netBankingRepayment: { 224 | canBuildLink: false, 225 | name: "Net Banking Repayment", 226 | link: "/repayment/netbanking", 227 | }, 228 | upiRepayment: { 229 | canBuildLink: false, 230 | name: "UPI Repayment", 231 | link: "/repayment/upi", 232 | query: [ 233 | { 234 | name: "Transcation Id", 235 | key: "tid", 236 | required: false, 237 | }, 238 | { 239 | name: "Intent Id", 240 | key: "intentid", 241 | required: false, 242 | }, 243 | ], 244 | }, 245 | sanctionLetter: { 246 | canBuildLink: false, 247 | name: "Sanction Letter", 248 | link: "/sanction/:userId", 249 | params: [ 250 | { 251 | name: "User Id", 252 | key: "userId", 253 | required: true, 254 | }, 255 | ], 256 | query: [ 257 | { 258 | name: "Loan Amount", 259 | key: "loanAmount", 260 | required: true, 261 | }, 262 | { 263 | name: "Order Id", 264 | key: "orderUid", 265 | required: true, 266 | }, 267 | { 268 | name: "Merchant Id", 269 | key: "merchantId", 270 | required: true, 271 | }, 272 | ], 273 | }, 274 | kfs: { 275 | canBuildLink: false, 276 | name: "KFS", 277 | link: "/kfs/:userId", 278 | params: [ 279 | { 280 | name: "User Id", 281 | key: "userId", 282 | required: true, 283 | }, 284 | ], 285 | query: [ 286 | { 287 | name: "Loan Amount", 288 | key: "loanAmount", 289 | required: true, 290 | }, 291 | { 292 | name: "Order Id", 293 | key: "orderUid", 294 | required: true, 295 | }, 296 | { 297 | name: "Merchant Id", 298 | key: "merchantId", 299 | required: true, 300 | }, 301 | ], 302 | }, 303 | dynamicPage: { 304 | canBuildLink: true, 305 | name: "Dynamic Page", 306 | link: "/page/:slug", 307 | params: [ 308 | { 309 | name: "Slug", 310 | key: "slug", 311 | required: true, 312 | }, 313 | ], 314 | }, 315 | }; 316 | 317 | module.exports = { 318 | AVAILABLE_PAGE_TYPE, 319 | NAVIGATORS, 320 | }; 321 | -------------------------------------------------------------------------------- /sdk/common/RequestSigner.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const url = require("url"); 4 | const querystring = require("query-string"); 5 | const sha256 = require("crypto-js/sha256"); 6 | const hmacSHA256 = require("crypto-js/hmac-sha256"); 7 | 8 | function hmac(key, string, encoding) { 9 | return hmacSHA256(string, key).toString(); 10 | } 11 | function hash(string, encoding) { 12 | return sha256(string).toString(); 13 | } 14 | 15 | // This function assumes the string has already been percent encoded 16 | function encodeRfc3986(urlEncodedString) { 17 | return urlEncodedString.replace(/[!'()*]/g, function (c) { 18 | return "%" + c.charCodeAt(0).toString(16).toUpperCase(); 19 | }); 20 | } 21 | 22 | function encodeRfc3986Full(str) { 23 | return str; 24 | // return encodeRfc3986(encodeURIComponent(str)); 25 | } 26 | 27 | const HEADERS_TO_IGNORE = { 28 | authorization: true, 29 | connection: true, 30 | "x-amzn-trace-id": true, 31 | "user-agent": true, 32 | expect: true, 33 | "presigned-expires": true, 34 | range: true, 35 | }; 36 | 37 | const HEADERS_TO_INCLUDE = ["x-ptl-.*", "host"]; 38 | 39 | // request: { path | body, [host], [method], [headers], [service], [region] } 40 | class RequestSigner { 41 | constructor(request, xSource) { 42 | if (typeof request === "string") { 43 | request = url.parse(request); 44 | } 45 | 46 | let headers = (request.headers = request.headers || {}); 47 | this.request = request; 48 | this.xSource = xSource; 49 | 50 | if (!request.method && request.body) { 51 | request.method = "POST"; 52 | } 53 | 54 | if (!headers.Host && !headers.host) { 55 | headers.Host = request.hostname || request.host; 56 | 57 | // If a port is specified explicitly, use it as is 58 | if (request.port) { 59 | headers.Host += ":" + request.port; 60 | } 61 | } 62 | if (!request.hostname && !request.host) { 63 | request.hostname = headers.Host || headers.host; 64 | } 65 | } 66 | 67 | prepareRequest() { 68 | this.parsePath(); 69 | 70 | let request = this.request; 71 | let headers = request.headers; 72 | let query; 73 | 74 | if (request.signQuery) { 75 | this.parsedPath.query = query = this.parsedPath.query || {}; 76 | 77 | if (query["x-ptl-date"]) { 78 | this.datetime = query["x-ptl-date"]; 79 | } else { 80 | query["x-ptl-date"] = this.getDateTime(); 81 | } 82 | } else { 83 | if (!request.doNotModifyHeaders) { 84 | if (headers["x-ptl-date"]) { 85 | this.datetime = headers["x-ptl-date"] || headers["x-ptl-date"]; 86 | } else { 87 | headers["x-ptl-date"] = this.getDateTime(); 88 | } 89 | } 90 | 91 | delete headers["x-ptl-signature"]; 92 | delete headers["x-ptl-Signature"]; 93 | } 94 | } 95 | 96 | sign() { 97 | if (!this.parsedPath) { 98 | this.prepareRequest(); 99 | } 100 | if (this.request.signQuery) { 101 | this.parsedPath.query["x-ptl-signature"] = this.signature( 102 | this.request.secret 103 | ); 104 | } else { 105 | this.request.headers["x-ptl-signature"] = this.signature( 106 | this.request.secret 107 | ); 108 | } 109 | this.request.path = this.formatPath(); 110 | return this.request; 111 | } 112 | 113 | getDateTime() { 114 | if (!this.datetime) { 115 | let headers = this.request.headers; 116 | let date = new Date(headers.Date || headers.date || new Date()); 117 | 118 | this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, ""); 119 | } 120 | return this.datetime; 121 | } 122 | 123 | getDate() { 124 | return this.getDateTime().substr(0, 8); 125 | } 126 | 127 | signature(secret) { 128 | if (!secret && this.xSource !== "platform") { 129 | secret = "1234567"; 130 | } 131 | 132 | let kCredentials = secret; 133 | let strTosign = this.stringToSign(); 134 | // console.log(strTosign); 135 | return `v1:${hmac(kCredentials, strTosign, "hex")}`; 136 | } 137 | 138 | stringToSign() { 139 | return [this.getDateTime(), hash(this.canonicalString(), "hex")].join("\n"); 140 | } 141 | 142 | canonicalString() { 143 | if (!this.parsedPath) { 144 | this.prepareRequest(); 145 | } 146 | 147 | let pathStr = this.parsedPath.path; 148 | let query = this.parsedPath.query; 149 | let headers = this.request.headers; 150 | let queryStr = ""; 151 | let normalizePath = true; 152 | let decodePath = this.request.doNotEncodePath; 153 | let decodeSlashesInPath = false; 154 | let firstValOnly = false; 155 | let bodyHash = hash(this.request.body || "", "hex"); 156 | if (query) { 157 | let reducedQuery = Object.keys(query).reduce(function (obj, key) { 158 | if (!key) { 159 | return obj; 160 | } 161 | obj[encodeRfc3986Full(key)] = !Array.isArray(query[key]) 162 | ? query[key] 163 | : firstValOnly 164 | ? query[key][0] 165 | : query[key]; 166 | return obj; 167 | }, {}); 168 | let encodedQueryPieces = []; 169 | Object.keys(reducedQuery) 170 | .sort() 171 | .forEach(function (key) { 172 | if (!Array.isArray(reducedQuery[key])) { 173 | encodedQueryPieces.push( 174 | key + "=" + encodeRfc3986Full(reducedQuery[key]) 175 | ); 176 | } else { 177 | reducedQuery[key] 178 | .map(encodeRfc3986Full) 179 | .sort() 180 | .forEach(function (val) { 181 | encodedQueryPieces.push(key + "=" + val); 182 | }); 183 | } 184 | }); 185 | queryStr = encodedQueryPieces.join("&"); 186 | } 187 | if (pathStr !== "/") { 188 | if (normalizePath) { 189 | pathStr = pathStr.replace(/\/{2,}/g, "/"); 190 | } 191 | pathStr = pathStr 192 | .split("/") 193 | .reduce(function (path, piece) { 194 | if (normalizePath && piece === "..") { 195 | path.pop(); 196 | } else if (!normalizePath || piece !== ".") { 197 | if (decodePath) 198 | piece = decodeURIComponent(piece.replace(/\+/g, " ")); 199 | path.push(encodeRfc3986Full(piece)); 200 | } 201 | return path; 202 | }, []) 203 | .join("/"); 204 | if (pathStr[0] !== "/") pathStr = "/" + pathStr; 205 | if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, "/"); 206 | } 207 | 208 | let canonicalReq = [ 209 | this.request.method || "GET", 210 | pathStr, 211 | queryStr, 212 | this.canonicalHeaders() + "\n", 213 | this.signedHeaders(), 214 | bodyHash, 215 | ].join("\n"); 216 | return canonicalReq; 217 | } 218 | 219 | canonicalHeaders() { 220 | let headers = this.request.headers; 221 | 222 | function trimAll(header) { 223 | return header.toString().trim().replace(/\s+/g, " "); 224 | } 225 | return Object.keys(headers) 226 | .filter(function (key) { 227 | let notInIgnoreHeader = HEADERS_TO_IGNORE[key.toLowerCase()] == null; 228 | if (notInIgnoreHeader) { 229 | let foundMatch = false; 230 | for (let t in HEADERS_TO_INCLUDE) { 231 | foundMatch = 232 | foundMatch || new RegExp(HEADERS_TO_INCLUDE[t], "ig").test(key); 233 | } 234 | return foundMatch; 235 | } else { 236 | return false; 237 | } 238 | }) 239 | .sort(function (a, b) { 240 | return a.toLowerCase() < b.toLowerCase() ? -1 : 1; 241 | }) 242 | .map(function (key) { 243 | return key.toLowerCase() + ":" + trimAll(headers[key]); 244 | }) 245 | .join("\n"); 246 | } 247 | 248 | signedHeaders() { 249 | return Object.keys(this.request.headers) 250 | .map(function (key) { 251 | return key.toLowerCase(); 252 | }) 253 | .filter(function (key) { 254 | let notInIgnoreHeader = HEADERS_TO_IGNORE[key.toLowerCase()] == null; 255 | if (notInIgnoreHeader) { 256 | let foundMatch = false; 257 | for (let t in HEADERS_TO_INCLUDE) { 258 | foundMatch = 259 | foundMatch || new RegExp(HEADERS_TO_INCLUDE[t], "ig").test(key); 260 | } 261 | return foundMatch; 262 | } else { 263 | return false; 264 | } 265 | }) 266 | .sort() 267 | .join(";"); 268 | } 269 | 270 | parsePath() { 271 | let path = this.request.path || "/"; 272 | let queryIx = path.indexOf("?"); 273 | let query = null; 274 | 275 | if (queryIx >= 0) { 276 | query = querystring.parse(path.slice(queryIx + 1)); 277 | path = path.slice(0, queryIx); 278 | } 279 | path = path 280 | .split("/") 281 | .map((t) => { 282 | return encodeURIComponent(decodeURIComponent(t)); 283 | }) 284 | .join("/"); 285 | 286 | this.parsedPath = { 287 | path: path, 288 | query: query, 289 | }; 290 | } 291 | 292 | formatPath() { 293 | let path = this.parsedPath.path; 294 | let query = this.parsedPath.query; 295 | 296 | if (!query) { 297 | return path; 298 | } 299 | 300 | // Services don't support empty query string keys 301 | if (query[""] != null) { 302 | delete query[""]; 303 | } 304 | 305 | return path + "?" + encodeRfc3986(querystring.stringify(query)); 306 | } 307 | } 308 | 309 | function sign(request, xSource = "") { 310 | return new RequestSigner(request, xSource).sign(); 311 | } 312 | 313 | module.exports = { 314 | sign: sign, 315 | }; 316 | -------------------------------------------------------------------------------- /sdk/common/Constant.d.ts: -------------------------------------------------------------------------------- 1 | export namespace AVAILABLE_PAGE_TYPE { 2 | const EXTERNAL: string; 3 | const LOGIN: string; 4 | const HOME: string; 5 | const TRANSACTIONS: string; 6 | const TRANSACTIONDETAILS: string; 7 | const REWARDS: string; 8 | const REFERANDEARN: string; 9 | const PROFILE: string; 10 | const SETUPAUTOPAY: string; 11 | const UPDATEEMAIL: string; 12 | const REPORTISSUE: string; 13 | const CREDITSCORE: string; 14 | const AUTOPAY: string; 15 | const HELPCENTER: string; 16 | const KYCINIT: string; 17 | const ACCESSDIGILOCKER: string; 18 | const LIVELINESS: string; 19 | const LENDERONBOARD: string; 20 | const LENDER: string; 21 | const KYCDOCS: string; 22 | const KYCSELFIE: string; 23 | const KYCSTATUS: string; 24 | const KYCERROR: string; 25 | const KYCDIGILOCKERRESPONSE: string; 26 | const KYCINITRESPONSE: string; 27 | const REPAYMENT: string; 28 | const NETBANKINGREPAYMENT: string; 29 | const UPIREPAYMENT: string; 30 | const SANCTIONLETTER: string; 31 | const KFS: string; 32 | const DYNAMICPAGE: string; 33 | } 34 | export namespace NAVIGATORS { 35 | namespace external { 36 | const canBuildLink: boolean; 37 | const name: string; 38 | const link: string; 39 | const query: { 40 | name: string; 41 | key: string; 42 | required: boolean; 43 | }[]; 44 | } 45 | namespace login { 46 | const canBuildLink_1: boolean; 47 | export { canBuildLink_1 as canBuildLink }; 48 | const name_1: string; 49 | export { name_1 as name }; 50 | const link_1: string; 51 | export { link_1 as link }; 52 | } 53 | namespace home { 54 | const canBuildLink_2: boolean; 55 | export { canBuildLink_2 as canBuildLink }; 56 | export const screenType: string; 57 | const name_2: string; 58 | export { name_2 as name }; 59 | const link_2: string; 60 | export { link_2 as link }; 61 | } 62 | namespace transactions { 63 | const canBuildLink_3: boolean; 64 | export { canBuildLink_3 as canBuildLink }; 65 | const name_3: string; 66 | export { name_3 as name }; 67 | const link_3: string; 68 | export { link_3 as link }; 69 | } 70 | namespace transactionDetails { 71 | const canBuildLink_4: boolean; 72 | export { canBuildLink_4 as canBuildLink }; 73 | const name_4: string; 74 | export { name_4 as name }; 75 | const link_4: string; 76 | export { link_4 as link }; 77 | export const params: { 78 | name: string; 79 | key: string; 80 | required: boolean; 81 | }[]; 82 | } 83 | namespace rewards { 84 | const canBuildLink_5: boolean; 85 | export { canBuildLink_5 as canBuildLink }; 86 | const name_5: string; 87 | export { name_5 as name }; 88 | const link_5: string; 89 | export { link_5 as link }; 90 | } 91 | namespace referAndEarn { 92 | const canBuildLink_6: boolean; 93 | export { canBuildLink_6 as canBuildLink }; 94 | const name_6: string; 95 | export { name_6 as name }; 96 | const link_6: string; 97 | export { link_6 as link }; 98 | } 99 | namespace profile { 100 | const canBuildLink_7: boolean; 101 | export { canBuildLink_7 as canBuildLink }; 102 | const name_7: string; 103 | export { name_7 as name }; 104 | const link_7: string; 105 | export { link_7 as link }; 106 | } 107 | namespace setupAutopay { 108 | const canBuildLink_8: boolean; 109 | export { canBuildLink_8 as canBuildLink }; 110 | const name_8: string; 111 | export { name_8 as name }; 112 | const link_8: string; 113 | export { link_8 as link }; 114 | } 115 | namespace updateEmail { 116 | const canBuildLink_9: boolean; 117 | export { canBuildLink_9 as canBuildLink }; 118 | const name_9: string; 119 | export { name_9 as name }; 120 | const link_9: string; 121 | export { link_9 as link }; 122 | } 123 | namespace reportIssue { 124 | const canBuildLink_10: boolean; 125 | export { canBuildLink_10 as canBuildLink }; 126 | const name_10: string; 127 | export { name_10 as name }; 128 | const link_10: string; 129 | export { link_10 as link }; 130 | } 131 | namespace creditScore { 132 | const canBuildLink_11: boolean; 133 | export { canBuildLink_11 as canBuildLink }; 134 | const name_11: string; 135 | export { name_11 as name }; 136 | const link_11: string; 137 | export { link_11 as link }; 138 | } 139 | namespace autoPay { 140 | const canBuildLink_12: boolean; 141 | export { canBuildLink_12 as canBuildLink }; 142 | const name_12: string; 143 | export { name_12 as name }; 144 | const link_12: string; 145 | export { link_12 as link }; 146 | } 147 | namespace helpCenter { 148 | const canBuildLink_13: boolean; 149 | export { canBuildLink_13 as canBuildLink }; 150 | const name_13: string; 151 | export { name_13 as name }; 152 | const link_13: string; 153 | export { link_13 as link }; 154 | } 155 | namespace kycInit { 156 | const canBuildLink_14: boolean; 157 | export { canBuildLink_14 as canBuildLink }; 158 | const name_14: string; 159 | export { name_14 as name }; 160 | const link_14: string; 161 | export { link_14 as link }; 162 | } 163 | namespace accessDigilocker { 164 | const canBuildLink_15: boolean; 165 | export { canBuildLink_15 as canBuildLink }; 166 | const name_15: string; 167 | export { name_15 as name }; 168 | const link_15: string; 169 | export { link_15 as link }; 170 | const params_1: { 171 | name: string; 172 | key: string; 173 | required: boolean; 174 | }[]; 175 | export { params_1 as params }; 176 | } 177 | namespace liveliness { 178 | const canBuildLink_16: boolean; 179 | export { canBuildLink_16 as canBuildLink }; 180 | const name_16: string; 181 | export { name_16 as name }; 182 | const link_16: string; 183 | export { link_16 as link }; 184 | const params_2: { 185 | name: string; 186 | key: string; 187 | required: boolean; 188 | }[]; 189 | export { params_2 as params }; 190 | } 191 | namespace lenderOnboard { 192 | const canBuildLink_17: boolean; 193 | export { canBuildLink_17 as canBuildLink }; 194 | const name_17: string; 195 | export { name_17 as name }; 196 | const link_17: string; 197 | export { link_17 as link }; 198 | const params_3: { 199 | name: string; 200 | key: string; 201 | required: boolean; 202 | }[]; 203 | export { params_3 as params }; 204 | } 205 | namespace lender { 206 | const canBuildLink_18: boolean; 207 | export { canBuildLink_18 as canBuildLink }; 208 | const name_18: string; 209 | export { name_18 as name }; 210 | const link_18: string; 211 | export { link_18 as link }; 212 | const params_4: { 213 | name: string; 214 | key: string; 215 | required: boolean; 216 | }[]; 217 | export { params_4 as params }; 218 | } 219 | namespace kycDocs { 220 | const canBuildLink_19: boolean; 221 | export { canBuildLink_19 as canBuildLink }; 222 | const name_19: string; 223 | export { name_19 as name }; 224 | const link_19: string; 225 | export { link_19 as link }; 226 | } 227 | namespace kycSelfie { 228 | const canBuildLink_20: boolean; 229 | export { canBuildLink_20 as canBuildLink }; 230 | const name_20: string; 231 | export { name_20 as name }; 232 | const link_20: string; 233 | export { link_20 as link }; 234 | } 235 | namespace kycStatus { 236 | const canBuildLink_21: boolean; 237 | export { canBuildLink_21 as canBuildLink }; 238 | const name_21: string; 239 | export { name_21 as name }; 240 | const link_21: string; 241 | export { link_21 as link }; 242 | } 243 | namespace kycError { 244 | const canBuildLink_22: boolean; 245 | export { canBuildLink_22 as canBuildLink }; 246 | const name_22: string; 247 | export { name_22 as name }; 248 | const link_22: string; 249 | export { link_22 as link }; 250 | } 251 | namespace kycDigilockerResponse { 252 | const canBuildLink_23: boolean; 253 | export { canBuildLink_23 as canBuildLink }; 254 | const name_23: string; 255 | export { name_23 as name }; 256 | const link_23: string; 257 | export { link_23 as link }; 258 | } 259 | namespace kycInitResponse { 260 | const canBuildLink_24: boolean; 261 | export { canBuildLink_24 as canBuildLink }; 262 | const name_24: string; 263 | export { name_24 as name }; 264 | const link_24: string; 265 | export { link_24 as link }; 266 | } 267 | namespace repayment { 268 | const canBuildLink_25: boolean; 269 | export { canBuildLink_25 as canBuildLink }; 270 | const name_25: string; 271 | export { name_25 as name }; 272 | const link_25: string; 273 | export { link_25 as link }; 274 | const query_1: { 275 | name: string; 276 | key: string; 277 | required: boolean; 278 | }[]; 279 | export { query_1 as query }; 280 | } 281 | namespace netBankingRepayment { 282 | const canBuildLink_26: boolean; 283 | export { canBuildLink_26 as canBuildLink }; 284 | const name_26: string; 285 | export { name_26 as name }; 286 | const link_26: string; 287 | export { link_26 as link }; 288 | } 289 | namespace upiRepayment { 290 | const canBuildLink_27: boolean; 291 | export { canBuildLink_27 as canBuildLink }; 292 | const name_27: string; 293 | export { name_27 as name }; 294 | const link_27: string; 295 | export { link_27 as link }; 296 | const query_2: { 297 | name: string; 298 | key: string; 299 | required: boolean; 300 | }[]; 301 | export { query_2 as query }; 302 | } 303 | namespace sanctionLetter { 304 | const canBuildLink_28: boolean; 305 | export { canBuildLink_28 as canBuildLink }; 306 | const name_28: string; 307 | export { name_28 as name }; 308 | const link_28: string; 309 | export { link_28 as link }; 310 | const params_5: { 311 | name: string; 312 | key: string; 313 | required: boolean; 314 | }[]; 315 | export { params_5 as params }; 316 | const query_3: { 317 | name: string; 318 | key: string; 319 | required: boolean; 320 | }[]; 321 | export { query_3 as query }; 322 | } 323 | namespace kfs { 324 | const canBuildLink_29: boolean; 325 | export { canBuildLink_29 as canBuildLink }; 326 | const name_29: string; 327 | export { name_29 as name }; 328 | const link_29: string; 329 | export { link_29 as link }; 330 | const params_6: { 331 | name: string; 332 | key: string; 333 | required: boolean; 334 | }[]; 335 | export { params_6 as params }; 336 | const query_4: { 337 | name: string; 338 | key: string; 339 | required: boolean; 340 | }[]; 341 | export { query_4 as query }; 342 | } 343 | namespace dynamicPage { 344 | const canBuildLink_30: boolean; 345 | export { canBuildLink_30 as canBuildLink }; 346 | const name_30: string; 347 | export { name_30 as name }; 348 | const link_30: string; 349 | export { link_30 as link }; 350 | const params_7: { 351 | name: string; 352 | key: string; 353 | required: boolean; 354 | }[]; 355 | export { params_7 as params }; 356 | } 357 | } 358 | -------------------------------------------------------------------------------- /documentation/platform/PAYMENTS.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ##### [Back to Platform docs](./README.md) 6 | 7 | ## Payments Methods 8 | KYC Service 9 | * [getUserCreditSummary](#getusercreditsummary) 10 | 11 | 12 | 13 | ## Methods with example and description 14 | 15 | 16 | ### getUserCreditSummary 17 | Get user outstanding details. 18 | 19 | 20 | 21 | ```javascript 22 | // Promise 23 | const promise = 24 | payments.getUserCreditSummary( 25 | { 26 | mobile : value, 27 | lenderSlugs : value 28 | 29 | } 30 | ); 31 | 32 | // Async/Await 33 | const data = await 34 | payments.getUserCreditSummary( 35 | { 36 | mobile : value, 37 | lenderSlugs : value 38 | 39 | }); 40 | ``` 41 | 42 | 43 | 44 | 45 | 46 | | Argument | Type | Required | Description | 47 | | --------- | ----- | -------- | ----------- | 48 | | mobile | string | yes | mobile number of the user | 49 | | lenderSlugs | Array | no | This is list of lender slugs. eg. ['cashe','liquiloans'] | 50 | 51 | 52 | 53 | This api is for getting outstanding details for the user with all the lenders. 54 | 55 | *Returned Response:* 56 | 57 | 58 | 59 | 60 | [OutstandingDetailsResponse](#OutstandingDetailsResponse) 61 | 62 | Success. Returns a JSON object as shown below. Refer `PaymentLinkResponse` for more details. 63 | 64 | 65 | 66 | 67 |
68 |   Examples: 69 | 70 | 71 |
72 |   OutstandingDetailsResponse 73 | 74 | ```json 75 | { 76 | "value": { 77 | "message": "The request has been processed successfully.", 78 | "data": { 79 | "outstandingDetails": [ 80 | { 81 | "lender": { 82 | "id": "315f60f4-1238-462c-8108-cfff9fbc400f", 83 | "name": "Bhanix Finance and Investment Limited", 84 | "slug": "cashe", 85 | "theme": { 86 | "iconUrl": "https://cdn.pixelbin.io/v2/potlee/original/public/lenders/lenderLogo/v2/512h-logo/cashe-icon.png", 87 | "logoUrl": "https://cdn.pixelbin.io/v2/potlee/original/public/lenders/lenderLogo/v2/512h-logo/cashe-logo.png" 88 | } 89 | }, 90 | "availableLimit": 40000, 91 | "creditLimit": 40000, 92 | "dueAmount": 0, 93 | "outstandingAmount": 0, 94 | "dueDate": null 95 | } 96 | ] 97 | }, 98 | "meta": { 99 | "timestamp": "2024-07-26T08:01:02.592Z", 100 | "version": "v1.0", 101 | "product": "Settle Checkout", 102 | "requestId": "048dcf5c1d4ab39a9f39e1d07c584983" 103 | } 104 | } 105 | } 106 | ``` 107 |
108 | 109 |
110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | --- 120 | 121 | 122 | 123 | ### Schemas 124 | 125 | 126 | 127 | #### [IntegrationResponseMeta](#IntegrationResponseMeta) 128 | 129 | | Properties | Type | Nullable | Description | 130 | | ---------- | ---- | -------- | ----------- | 131 | | timestamp | string | yes | The timestamp when the response was generated. | 132 | | version | string | yes | The version of the API. | 133 | | product | string | yes | The name of the product or service. | 134 | | requestId | string | no | An optional request identifier. | 135 | 136 | --- 137 | 138 | 139 | 140 | 141 | #### [IntegrationResponseError](#IntegrationResponseError) 142 | 143 | | Properties | Type | Nullable | Description | 144 | | ---------- | ---- | -------- | ----------- | 145 | | code | string | yes | Error code representing the type of error. | 146 | | message | string | yes | A human-readable message providing more details about the error. | 147 | | exception | string | yes | The exception name or type. | 148 | | field | string | no | The field associated with the error, if applicable. | 149 | | location | string | no | The location of the field, such as 'query', 'param' or 'body'. | 150 | 151 | --- 152 | 153 | 154 | 155 | 156 | #### [IntegrationSuccessResponse](#IntegrationSuccessResponse) 157 | 158 | | Properties | Type | Nullable | Description | 159 | | ---------- | ---- | -------- | ----------- | 160 | | message | string | yes | A message indicating the success of the operation. | 161 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | yes | | 162 | | data | string | yes | The data payload of the response. The structure of this object will vary depending on the specific API endpoint. | 163 | 164 | --- 165 | 166 | 167 | 168 | 169 | #### [IntegrationErrorResponse](#IntegrationErrorResponse) 170 | 171 | | Properties | Type | Nullable | Description | 172 | | ---------- | ---- | -------- | ----------- | 173 | | message | string | yes | A message indicating the failure of the operation. | 174 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | yes | | 175 | | errors | [[IntegrationResponseError](#IntegrationResponseError)] | no | | 176 | 177 | --- 178 | 179 | 180 | 181 | 182 | #### [ErrorResponse](#ErrorResponse) 183 | 184 | | Properties | Type | Nullable | Description | 185 | | ---------- | ---- | -------- | ----------- | 186 | | message | string | no | | 187 | | info | string | no | | 188 | | code | string | no | | 189 | | requestId | string | no | | 190 | | meta | string | no | | 191 | 192 | --- 193 | 194 | 195 | 196 | 197 | #### [RepaymentUsingNetbanking](#RepaymentUsingNetbanking) 198 | 199 | | Properties | Type | Nullable | Description | 200 | | ---------- | ---- | -------- | ----------- | 201 | | amount | number | yes | | 202 | | bankId | string | yes | | 203 | | bankName | string | yes | | 204 | | chargeToken | string | no | | 205 | | transactionId | string | no | | 206 | 207 | --- 208 | 209 | 210 | 211 | 212 | #### [RepaymentUsingNetbankingResponse](#RepaymentUsingNetbankingResponse) 213 | 214 | | Properties | Type | Nullable | Description | 215 | | ---------- | ---- | -------- | ----------- | 216 | | form | string | no | | 217 | | isDifferent | boolean | no | | 218 | | outstanding | string | no | | 219 | 220 | --- 221 | 222 | 223 | 224 | 225 | #### [RepaymentUsingUPI](#RepaymentUsingUPI) 226 | 227 | | Properties | Type | Nullable | Description | 228 | | ---------- | ---- | -------- | ----------- | 229 | | amount | number | yes | | 230 | | vpa | string | yes | | 231 | | chargeToken | string | no | | 232 | | transactionId | string | no | | 233 | 234 | --- 235 | 236 | 237 | 238 | 239 | #### [RepaymentUsingUPIResponse](#RepaymentUsingUPIResponse) 240 | 241 | | Properties | Type | Nullable | Description | 242 | | ---------- | ---- | -------- | ----------- | 243 | | isDifferent | boolean | no | | 244 | | outstanding | string | no | | 245 | | status | string | no | | 246 | | intentId | string | no | | 247 | | transactionId | string | no | | 248 | | expiry | number | no | | 249 | | interval | number | no | | 250 | 251 | --- 252 | 253 | 254 | 255 | 256 | #### [RegisterUPIMandateRequest](#RegisterUPIMandateRequest) 257 | 258 | | Properties | Type | Nullable | Description | 259 | | ---------- | ---- | -------- | ----------- | 260 | | vpa | string | no | | 261 | 262 | --- 263 | 264 | 265 | 266 | 267 | #### [RegisterUPIMandateResponse](#RegisterUPIMandateResponse) 268 | 269 | | Properties | Type | Nullable | Description | 270 | | ---------- | ---- | -------- | ----------- | 271 | | transactionId | string | no | | 272 | | expiry | number | no | | 273 | | interval | number | no | | 274 | 275 | --- 276 | 277 | 278 | 279 | 280 | #### [RegisterUPIMandateStatusCheckRequest](#RegisterUPIMandateStatusCheckRequest) 281 | 282 | | Properties | Type | Nullable | Description | 283 | | ---------- | ---- | -------- | ----------- | 284 | | transactionId | string | no | | 285 | 286 | --- 287 | 288 | 289 | 290 | 291 | #### [RegisterMandateStatusCheckResponse](#RegisterMandateStatusCheckResponse) 292 | 293 | | Properties | Type | Nullable | Description | 294 | | ---------- | ---- | -------- | ----------- | 295 | | status | string | no | | 296 | 297 | --- 298 | 299 | 300 | 301 | 302 | #### [TransactionStatusRequest](#TransactionStatusRequest) 303 | 304 | | Properties | Type | Nullable | Description | 305 | | ---------- | ---- | -------- | ----------- | 306 | | intentId | string | yes | | 307 | | transactionId | string | yes | | 308 | 309 | --- 310 | 311 | 312 | 313 | 314 | #### [TransactionStatusResponse](#TransactionStatusResponse) 315 | 316 | | Properties | Type | Nullable | Description | 317 | | ---------- | ---- | -------- | ----------- | 318 | | success | boolean | yes | | 319 | | methodType | string | no | | 320 | | methodSubType | string | no | | 321 | | status | string | no | | 322 | 323 | --- 324 | 325 | 326 | 327 | 328 | #### [BankList](#BankList) 329 | 330 | | Properties | Type | Nullable | Description | 331 | | ---------- | ---- | -------- | ----------- | 332 | | bankId | string | no | | 333 | | bankName | string | no | | 334 | | rank | number | no | | 335 | | popular | boolean | no | | 336 | | imageUrl | string | no | | 337 | 338 | --- 339 | 340 | 341 | 342 | 343 | #### [PaymentOptions](#PaymentOptions) 344 | 345 | | Properties | Type | Nullable | Description | 346 | | ---------- | ---- | -------- | ----------- | 347 | | title | string | no | | 348 | | shortTitle | string | no | | 349 | | uid | string | no | | 350 | | imageUrl | string | no | | 351 | 352 | --- 353 | 354 | 355 | 356 | 357 | #### [PaymentsObject](#PaymentsObject) 358 | 359 | | Properties | Type | Nullable | Description | 360 | | ---------- | ---- | -------- | ----------- | 361 | | title | string | no | | 362 | | kind | string | no | | 363 | | options | [[PaymentOptions](#PaymentOptions)] | no | | 364 | 365 | --- 366 | 367 | 368 | 369 | 370 | #### [LenderTheme](#LenderTheme) 371 | 372 | | Properties | Type | Nullable | Description | 373 | | ---------- | ---- | -------- | ----------- | 374 | | iconUrl | string | yes | | 375 | | logoUrl | string | yes | | 376 | 377 | --- 378 | 379 | 380 | 381 | 382 | #### [LenderDetails](#LenderDetails) 383 | 384 | | Properties | Type | Nullable | Description | 385 | | ---------- | ---- | -------- | ----------- | 386 | | slug | string | yes | | 387 | | name | string | yes | | 388 | | id | string | yes | | 389 | | theme | [LenderTheme](#LenderTheme) | yes | | 390 | 391 | --- 392 | 393 | 394 | 395 | 396 | #### [OutstandingDetail](#OutstandingDetail) 397 | 398 | | Properties | Type | Nullable | Description | 399 | | ---------- | ---- | -------- | ----------- | 400 | | status | string | no | | 401 | | action | boolean | no | | 402 | | message | [OutstandingMessage](#OutstandingMessage) | no | | 403 | | credit | [UserCredit](#UserCredit) | no | | 404 | | dueSummary | [DueSummaryOutstanding](#DueSummaryOutstanding) | no | | 405 | | outstandingSummary | [OutstandingSummary](#OutstandingSummary) | no | | 406 | | entityMapId | string | no | | 407 | 408 | --- 409 | 410 | 411 | 412 | 413 | #### [OutstandingSummary](#OutstandingSummary) 414 | 415 | | Properties | Type | Nullable | Description | 416 | | ---------- | ---- | -------- | ----------- | 417 | | totalOutstanding | number | no | | 418 | | totalOutstandingWithInterest | number | no | | 419 | | totalOutstandingPenalty | number | no | | 420 | | availableLimit | number | no | | 421 | | isOverdue | boolean | no | | 422 | | dueFromDate | string | no | | 423 | | repaymentSummary | [[RepaymentSummaryOutstanding](#RepaymentSummaryOutstanding)] | no | | 424 | 425 | --- 426 | 427 | 428 | 429 | 430 | #### [DueSummaryOutstanding](#DueSummaryOutstanding) 431 | 432 | | Properties | Type | Nullable | Description | 433 | | ---------- | ---- | -------- | ----------- | 434 | | dueDate | string | no | | 435 | | totalDue | number | no | | 436 | | totalDueWithInterest | number | no | | 437 | | totalDuePenalty | number | no | | 438 | | dueTransactions | [[DueTransactionsOutstanding](#DueTransactionsOutstanding)] | no | | 439 | | minAmntDue | number | no | | 440 | 441 | --- 442 | 443 | 444 | 445 | 446 | #### [OutstandingMessage](#OutstandingMessage) 447 | 448 | | Properties | Type | Nullable | Description | 449 | | ---------- | ---- | -------- | ----------- | 450 | | dueMessage | string | no | | 451 | | backgroundColor | string | no | | 452 | | textColor | string | no | | 453 | | isFlexiRepayEnabled | boolean | no | | 454 | 455 | --- 456 | 457 | 458 | 459 | 460 | #### [UserCredit](#UserCredit) 461 | 462 | | Properties | Type | Nullable | Description | 463 | | ---------- | ---- | -------- | ----------- | 464 | | availableLimit | number | no | | 465 | | approvedLimit | number | no | | 466 | | isEligibleToDrawdown | boolean | no | | 467 | 468 | --- 469 | 470 | 471 | 472 | 473 | #### [DueTransactionsOutstanding](#DueTransactionsOutstanding) 474 | 475 | | Properties | Type | Nullable | Description | 476 | | ---------- | ---- | -------- | ----------- | 477 | | loanRequestNo | string | no | | 478 | | merchantCategory | string | no | | 479 | | installmentAmountWithInterest | number | no | | 480 | | installmentAmount | number | no | | 481 | | dueAmount | number | no | | 482 | | loanType | string | no | | 483 | | installmentNo | string | no | | 484 | | installmentDueDate | string | no | | 485 | | isPastDue | boolean | no | | 486 | | isPenaltyCharged | boolean | no | | 487 | | penaltyAmount | number | no | | 488 | | noOfDaysPenaltyCharged | number | no | | 489 | | daysDifference | number | no | | 490 | | lenderTransactionId | string | no | | 491 | 492 | --- 493 | 494 | 495 | 496 | 497 | #### [RepaymentSummaryOutstanding](#RepaymentSummaryOutstanding) 498 | 499 | | Properties | Type | Nullable | Description | 500 | | ---------- | ---- | -------- | ----------- | 501 | | loanRequestNo | string | no | | 502 | | loanType | string | no | | 503 | | merchantCategory | string | no | | 504 | | isBbillingTransaction | boolean | no | | 505 | | totalInstallmentAmount | number | no | | 506 | | totalInstallmentAmountWithInterest | number | no | | 507 | | outstandingDetails | [[OutstandingDetailsRepayment](#OutstandingDetailsRepayment)] | no | | 508 | 509 | --- 510 | 511 | 512 | 513 | 514 | #### [OutstandingDetailsRepayment](#OutstandingDetailsRepayment) 515 | 516 | | Properties | Type | Nullable | Description | 517 | | ---------- | ---- | -------- | ----------- | 518 | | installmentAmountWithInterest | number | no | | 519 | | installmentAmount | number | no | | 520 | | dueAmount | number | no | | 521 | | installmentNo | string | no | | 522 | | installmentDueDate | string | no | | 523 | | isPastDue | boolean | no | | 524 | | loanType | string | no | | 525 | | isPenaltyCharged | boolean | no | | 526 | | penaltyAmount | number | no | | 527 | | noOfDaysPenaltyCharged | number | no | | 528 | | lenderTransactionId | string | no | | 529 | 530 | --- 531 | 532 | 533 | 534 | 535 | #### [PaymentOptionsResponse](#PaymentOptionsResponse) 536 | 537 | | Properties | Type | Nullable | Description | 538 | | ---------- | ---- | -------- | ----------- | 539 | | paymentOptions | [[PaymentsObject](#PaymentsObject)] | no | | 540 | 541 | --- 542 | 543 | 544 | 545 | 546 | #### [CheckEMandateStatusRequest](#CheckEMandateStatusRequest) 547 | 548 | | Properties | Type | Nullable | Description | 549 | | ---------- | ---- | -------- | ----------- | 550 | | orderId | string | no | | 551 | | paymentId | string | no | | 552 | | scheduledEnd | string | no | | 553 | | ruleAmountValue | string | no | | 554 | 555 | --- 556 | 557 | 558 | 559 | 560 | #### [AutoPayStatusResponse](#AutoPayStatusResponse) 561 | 562 | | Properties | Type | Nullable | Description | 563 | | ---------- | ---- | -------- | ----------- | 564 | | status | string | no | | 565 | 566 | --- 567 | 568 | 569 | 570 | 571 | #### [OutstandingData](#OutstandingData) 572 | 573 | | Properties | Type | Nullable | Description | 574 | | ---------- | ---- | -------- | ----------- | 575 | | lenderDetails | [LenderDetails](#LenderDetails) | no | | 576 | | availableLimit | number | yes | | 577 | | creditLimit | number | yes | | 578 | | dueAmount | number | no | | 579 | | outstandingAmount | number | no | | 580 | | dueDate | string | no | | 581 | 582 | --- 583 | 584 | 585 | 586 | 587 | #### [OutstandingDetailsData](#OutstandingDetailsData) 588 | 589 | | Properties | Type | Nullable | Description | 590 | | ---------- | ---- | -------- | ----------- | 591 | | outstandingDetails | [[OutstandingData](#OutstandingData)] | yes | | 592 | 593 | --- 594 | 595 | 596 | 597 | 598 | #### [OutstandingDetailsResponse](#OutstandingDetailsResponse) 599 | 600 | | Properties | Type | Nullable | Description | 601 | | ---------- | ---- | -------- | ----------- | 602 | | message | string | yes | | 603 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | yes | | 604 | | data | [OutstandingDetailsData](#OutstandingDetailsData) | yes | | 605 | 606 | --- 607 | 608 | 609 | 610 | 611 | -------------------------------------------------------------------------------- /documentation/platform/MERCHANT.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ##### [Back to Platform docs](./README.md) 6 | 7 | ## Merchant Methods 8 | Authentication Service 9 | * [getAccessToken](#getaccesstoken) 10 | * [renewAccessToken](#renewaccesstoken) 11 | * [validateCredentials](#validatecredentials) 12 | 13 | 14 | 15 | ## Methods with example and description 16 | 17 | 18 | ### getAccessToken 19 | Get Access Token 20 | 21 | 22 | 23 | ```javascript 24 | // Promise 25 | const promise = 26 | merchant.getAccessToken( 27 | 28 | 29 | 30 | ); 31 | 32 | // Async/Await 33 | const data = await 34 | merchant.getAccessToken( 35 | 36 | 37 | ); 38 | ``` 39 | 40 | 41 | 42 | 43 | 44 | 45 | Use this API to get access token 46 | 47 | *Returned Response:* 48 | 49 | 50 | 51 | 52 | [GetAccessTokenResponse](#GetAccessTokenResponse) 53 | 54 | Success. Returns a JSON object as shown below. Refer `GetAccessTokenResponse` for more details. 55 | 56 | 57 | 58 | 59 |
60 |   Examples: 61 | 62 | 63 |
64 |   success 65 | 66 | ```json 67 | true 68 | ``` 69 |
70 | 71 |
72 |   accessToken 73 | 74 | ```json 75 | "oa-0a7a064dd15ef22fe002946f90c1e7b22eea47de" 76 | ``` 77 |
78 | 79 |
80 |   refreshToken 81 | 82 | ```json 83 | "oa-d2f33b6be9957050386be051501b84b008f5ef6f" 84 | ``` 85 |
86 | 87 |
88 |   tokenExpireAt 89 | 90 | ```json 91 | "2023-06-27T09:43:07.818Z" 92 | ``` 93 |
94 | 95 |
96 |   tokenExpiryIn 97 | 98 | ```json 99 | "600" 100 | ``` 101 |
102 | 103 |
104 |   refreshTokenExpiryAt 105 | 106 | ```json 107 | "2023-06-27T10:33:07.822Z" 108 | ``` 109 |
110 | 111 |
112 |   refreshTokenExpiryIn 113 | 114 | ```json 115 | "3600" 116 | ``` 117 |
118 | 119 |
120 |   scope 121 | 122 | ```json 123 | [ 124 | "transaction" 125 | ] 126 | ``` 127 |
128 | 129 |
130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | --- 140 | 141 | 142 | ### renewAccessToken 143 | Renew Access Token 144 | 145 | 146 | 147 | ```javascript 148 | // Promise 149 | const promise = 150 | merchant.renewAccessToken( 151 | { 152 | body : value 153 | 154 | } 155 | ); 156 | 157 | // Async/Await 158 | const data = await 159 | merchant.renewAccessToken( 160 | { 161 | body : value 162 | 163 | }); 164 | ``` 165 | 166 | 167 | 168 | 169 | 170 | | Argument | Type | Required | Description | 171 | | --------- | ----- | -------- | ----------- | 172 | | body | [RefreshTokenRequest](#RefreshTokenRequest) | yes | Request body | 173 | 174 | 175 | Use this API to renew access token 176 | 177 | *Returned Response:* 178 | 179 | 180 | 181 | 182 | [RefreshTokenResponse](#RefreshTokenResponse) 183 | 184 | Success. Returns a JSON object as shown below. Refer `RefreshTokenResponse` for more details. 185 | 186 | 187 | 188 | 189 |
190 |   Examples: 191 | 192 | 193 |
194 |   success 195 | 196 | ```json 197 | true 198 | ``` 199 |
200 | 201 |
202 |   accessToken 203 | 204 | ```json 205 | "oa-de1496c16c91c45396ba87a888eed20fb223995d" 206 | ``` 207 |
208 | 209 |
210 |   tokenExpireAt 211 | 212 | ```json 213 | "2023-06-26T19:23:46.977Z" 214 | ``` 215 |
216 | 217 |
218 |   tokenExpiryIn 219 | 220 | ```json 221 | "600" 222 | ``` 223 |
224 | 225 |
226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | --- 236 | 237 | 238 | ### validateCredentials 239 | Validate organization's credentials 240 | 241 | 242 | 243 | ```javascript 244 | // Promise 245 | const promise = 246 | merchant.validateCredentials( 247 | 248 | 249 | 250 | ); 251 | 252 | // Async/Await 253 | const data = await 254 | merchant.validateCredentials( 255 | 256 | 257 | ); 258 | ``` 259 | 260 | 261 | 262 | 263 | 264 | 265 | Use this API to validate organization's credentials 266 | 267 | *Returned Response:* 268 | 269 | 270 | 271 | 272 | [ValidateCredentialsResponse](#ValidateCredentialsResponse) 273 | 274 | Success. Returns a JSON object as shown below. Refer `ValidateCredentialsResponse` for more details. 275 | 276 | 277 | 278 | 279 |
280 |   Examples: 281 | 282 | 283 |
284 |   $ref 285 | 286 | ```json 287 | "#/components/schemas/ValidateCredentialsResponseExample" 288 | ``` 289 |
290 | 291 |
292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | --- 302 | 303 | 304 | 305 | ### Schemas 306 | 307 | 308 | 309 | #### [ErrorResponse](#ErrorResponse) 310 | 311 | | Properties | Type | Nullable | Description | 312 | | ---------- | ---- | -------- | ----------- | 313 | | message | string | no | | 314 | | info | string | no | | 315 | | code | string | no | | 316 | | requestId | string | no | | 317 | | meta | string | no | | 318 | 319 | --- 320 | 321 | 322 | 323 | 324 | #### [BlockUserRequestSchema](#BlockUserRequestSchema) 325 | 326 | | Properties | Type | Nullable | Description | 327 | | ---------- | ---- | -------- | ----------- | 328 | | status | boolean | no | | 329 | | userid | [string] | no | | 330 | | reason | string | no | | 331 | 332 | --- 333 | 334 | 335 | 336 | 337 | #### [EditEmailRequestSchema](#EditEmailRequestSchema) 338 | 339 | | Properties | Type | Nullable | Description | 340 | | ---------- | ---- | -------- | ----------- | 341 | | email | string | no | | 342 | 343 | --- 344 | 345 | 346 | 347 | 348 | #### [SendVerificationLinkMobileRequestSchema](#SendVerificationLinkMobileRequestSchema) 349 | 350 | | Properties | Type | Nullable | Description | 351 | | ---------- | ---- | -------- | ----------- | 352 | | verified | boolean | no | | 353 | | active | boolean | no | | 354 | | countryCode | string | no | | 355 | | phone | string | no | | 356 | | primary | boolean | no | | 357 | 358 | --- 359 | 360 | 361 | 362 | 363 | #### [EditMobileRequestSchema](#EditMobileRequestSchema) 364 | 365 | | Properties | Type | Nullable | Description | 366 | | ---------- | ---- | -------- | ----------- | 367 | | countryCode | string | no | | 368 | | phone | string | no | | 369 | 370 | --- 371 | 372 | 373 | 374 | 375 | #### [UpdateEmail](#UpdateEmail) 376 | 377 | | Properties | Type | Nullable | Description | 378 | | ---------- | ---- | -------- | ----------- | 379 | | email | string | yes | | 380 | | additionalProperties | any | no | | 381 | 382 | --- 383 | 384 | 385 | 386 | 387 | #### [EditProfileRequestSchema](#EditProfileRequestSchema) 388 | 389 | | Properties | Type | Nullable | Description | 390 | | ---------- | ---- | -------- | ----------- | 391 | | firstName | string | yes | | 392 | | lastName | string | yes | | 393 | | countryCode | string | no | | 394 | | mobile | string | no | | 395 | | email | string | no | | 396 | | gender | string | no | | 397 | | registrationToken | string | no | | 398 | 399 | --- 400 | 401 | 402 | 403 | 404 | #### [EditProfileMobileSchema](#EditProfileMobileSchema) 405 | 406 | | Properties | Type | Nullable | Description | 407 | | ---------- | ---- | -------- | ----------- | 408 | | phone | string | no | | 409 | | countryCode | string | no | | 410 | 411 | --- 412 | 413 | 414 | 415 | 416 | #### [SendEmailOtpRequestSchema](#SendEmailOtpRequestSchema) 417 | 418 | | Properties | Type | Nullable | Description | 419 | | ---------- | ---- | -------- | ----------- | 420 | | email | string | no | | 421 | | action | string | no | | 422 | | token | string | no | | 423 | | registerToken | string | no | | 424 | 425 | --- 426 | 427 | 428 | 429 | 430 | #### [VerifyEmailOtpRequestSchema](#VerifyEmailOtpRequestSchema) 431 | 432 | | Properties | Type | Nullable | Description | 433 | | ---------- | ---- | -------- | ----------- | 434 | | email | string | no | | 435 | | action | string | no | | 436 | | registerToken | string | no | | 437 | | otp | string | no | | 438 | 439 | --- 440 | 441 | 442 | 443 | 444 | #### [VerifyOtpRequest](#VerifyOtpRequest) 445 | 446 | | Properties | Type | Nullable | Description | 447 | | ---------- | ---- | -------- | ----------- | 448 | | requestId | string | yes | | 449 | | otp | string | yes | | 450 | | captchaCode | string | no | | 451 | | androidHash | string | no | | 452 | 453 | --- 454 | 455 | 456 | 457 | 458 | #### [SendMobileOtpRequest](#SendMobileOtpRequest) 459 | 460 | | Properties | Type | Nullable | Description | 461 | | ---------- | ---- | -------- | ----------- | 462 | | countryCode | string | yes | | 463 | | mobile | string | yes | | 464 | | captchaCode | string | no | | 465 | | androidHash | string | no | | 466 | | force | string | no | | 467 | 468 | --- 469 | 470 | 471 | 472 | 473 | #### [ReSendMobileOtpRequestSchema](#ReSendMobileOtpRequestSchema) 474 | 475 | | Properties | Type | Nullable | Description | 476 | | ---------- | ---- | -------- | ----------- | 477 | | captchaCode | string | no | | 478 | | token | string | yes | | 479 | | androidHash | string | no | | 480 | 481 | --- 482 | 483 | 484 | 485 | 486 | #### [LoginSuccess](#LoginSuccess) 487 | 488 | | Properties | Type | Nullable | Description | 489 | | ---------- | ---- | -------- | ----------- | 490 | | user | [UserSchema](#UserSchema) | no | | 491 | | requestId | string | no | | 492 | | registerToken | string | no | | 493 | 494 | --- 495 | 496 | 497 | 498 | 499 | #### [VerifyOtpSuccess](#VerifyOtpSuccess) 500 | 501 | | Properties | Type | Nullable | Description | 502 | | ---------- | ---- | -------- | ----------- | 503 | | user | [UserSchema](#UserSchema) | no | | 504 | | userExists | boolean | no | | 505 | | registerToken | string | no | | 506 | 507 | --- 508 | 509 | 510 | 511 | 512 | #### [ResetPasswordSuccess](#ResetPasswordSuccess) 513 | 514 | | Properties | Type | Nullable | Description | 515 | | ---------- | ---- | -------- | ----------- | 516 | | status | string | no | | 517 | 518 | --- 519 | 520 | 521 | 522 | 523 | #### [RegisterFormSuccess](#RegisterFormSuccess) 524 | 525 | | Properties | Type | Nullable | Description | 526 | | ---------- | ---- | -------- | ----------- | 527 | | email | string | no | | 528 | | resendTimer | number | no | | 529 | | resendToken | string | no | | 530 | | resendEmailToken | string | no | | 531 | | registerToken | string | no | | 532 | | success | boolean | no | | 533 | | requestId | string | no | | 534 | | message | string | no | | 535 | | mobile | string | no | | 536 | | countryCode | string | no | | 537 | | verifyEmailOtp | boolean | no | | 538 | | verifyMobileOtp | boolean | no | | 539 | | userExists | boolean | no | | 540 | 541 | --- 542 | 543 | 544 | 545 | 546 | #### [VerifyEmailSuccess](#VerifyEmailSuccess) 547 | 548 | | Properties | Type | Nullable | Description | 549 | | ---------- | ---- | -------- | ----------- | 550 | | message | string | no | | 551 | 552 | --- 553 | 554 | 555 | 556 | 557 | #### [LogoutSuccess](#LogoutSuccess) 558 | 559 | | Properties | Type | Nullable | Description | 560 | | ---------- | ---- | -------- | ----------- | 561 | | logout | boolean | no | | 562 | 563 | --- 564 | 565 | 566 | 567 | 568 | #### [BlockUserSuccess](#BlockUserSuccess) 569 | 570 | | Properties | Type | Nullable | Description | 571 | | ---------- | ---- | -------- | ----------- | 572 | | success | boolean | no | | 573 | 574 | --- 575 | 576 | 577 | 578 | 579 | #### [ProfileEditSuccess](#ProfileEditSuccess) 580 | 581 | | Properties | Type | Nullable | Description | 582 | | ---------- | ---- | -------- | ----------- | 583 | | user | [UserSchema](#UserSchema) | no | | 584 | | registerToken | string | no | | 585 | | resendEmailToken | string | no | | 586 | | userExists | boolean | no | | 587 | | verifyEmailLink | boolean | no | | 588 | | verifyEmailOtp | boolean | no | | 589 | | verifyMobileOtp | boolean | no | | 590 | | email | string | no | | 591 | | requestId | string | no | | 592 | | countryCode | string | no | | 593 | | mobile | string | no | | 594 | | success | boolean | no | | 595 | | message | string | no | | 596 | | resendTimer | number | no | | 597 | | resendToken | string | no | | 598 | 599 | --- 600 | 601 | 602 | 603 | 604 | #### [OtpSuccess](#OtpSuccess) 605 | 606 | | Properties | Type | Nullable | Description | 607 | | ---------- | ---- | -------- | ----------- | 608 | | resendTimer | number | no | | 609 | | resendToken | string | no | | 610 | | registerToken | string | no | | 611 | | success | boolean | no | | 612 | | requestId | string | no | | 613 | | message | string | no | | 614 | | mobile | string | no | | 615 | | countryCode | string | no | | 616 | 617 | --- 618 | 619 | 620 | 621 | 622 | #### [EmailOtpSuccess](#EmailOtpSuccess) 623 | 624 | | Properties | Type | Nullable | Description | 625 | | ---------- | ---- | -------- | ----------- | 626 | | success | boolean | no | | 627 | 628 | --- 629 | 630 | 631 | 632 | 633 | #### [SessionListSuccess](#SessionListSuccess) 634 | 635 | | Properties | Type | Nullable | Description | 636 | | ---------- | ---- | -------- | ----------- | 637 | | sessions | [string] | no | | 638 | 639 | --- 640 | 641 | 642 | 643 | 644 | #### [VerifyMobileOTPSuccess](#VerifyMobileOTPSuccess) 645 | 646 | | Properties | Type | Nullable | Description | 647 | | ---------- | ---- | -------- | ----------- | 648 | | user | [UserSchema](#UserSchema) | no | | 649 | | verifyMobileLink | boolean | no | | 650 | 651 | --- 652 | 653 | 654 | 655 | 656 | #### [VerifyEmailOTPSuccess](#VerifyEmailOTPSuccess) 657 | 658 | | Properties | Type | Nullable | Description | 659 | | ---------- | ---- | -------- | ----------- | 660 | | user | [UserSchema](#UserSchema) | no | | 661 | | verifyEmailLink | boolean | no | | 662 | 663 | --- 664 | 665 | 666 | 667 | 668 | #### [SendMobileVerifyLinkSuccess](#SendMobileVerifyLinkSuccess) 669 | 670 | | Properties | Type | Nullable | Description | 671 | | ---------- | ---- | -------- | ----------- | 672 | | verifyMobileLink | boolean | no | | 673 | 674 | --- 675 | 676 | 677 | 678 | 679 | #### [SendEmailVerifyLinkSuccess](#SendEmailVerifyLinkSuccess) 680 | 681 | | Properties | Type | Nullable | Description | 682 | | ---------- | ---- | -------- | ----------- | 683 | | verifyEmailLink | boolean | no | | 684 | 685 | --- 686 | 687 | 688 | 689 | 690 | #### [UserSearchResponseSchema](#UserSearchResponseSchema) 691 | 692 | | Properties | Type | Nullable | Description | 693 | | ---------- | ---- | -------- | ----------- | 694 | | users | [[UserSchema](#UserSchema)] | no | | 695 | 696 | --- 697 | 698 | 699 | 700 | 701 | #### [CustomerListResponseSchema](#CustomerListResponseSchema) 702 | 703 | | Properties | Type | Nullable | Description | 704 | | ---------- | ---- | -------- | ----------- | 705 | | items | [[UserSchema](#UserSchema)] | no | | 706 | | page | [PaginationSchema](#PaginationSchema) | no | | 707 | 708 | --- 709 | 710 | 711 | 712 | 713 | #### [PaginationSchema](#PaginationSchema) 714 | 715 | | Properties | Type | Nullable | Description | 716 | | ---------- | ---- | -------- | ----------- | 717 | | size | number | no | | 718 | | itemTotal | number | no | | 719 | | hasNext | boolean | no | | 720 | | type | string | no | | 721 | | current | number | no | | 722 | 723 | --- 724 | 725 | 726 | 727 | 728 | #### [UserObjectSchema](#UserObjectSchema) 729 | 730 | | Properties | Type | Nullable | Description | 731 | | ---------- | ---- | -------- | ----------- | 732 | | user | [UserSchema](#UserSchema) | no | | 733 | 734 | --- 735 | 736 | 737 | 738 | 739 | #### [CreateOrganization](#CreateOrganization) 740 | 741 | | Properties | Type | Nullable | Description | 742 | | ---------- | ---- | -------- | ----------- | 743 | | name | string | no | | 744 | | logo | string | no | | 745 | | website | string | no | | 746 | | disbursementAccountHolderName | string | no | | 747 | | disbursementAccountNumber | string | no | | 748 | | disbursementIfsc | string | no | | 749 | | businessName | string | no | | 750 | | email | string | no | | 751 | | supportEmail | string | no | | 752 | | description | string | no | | 753 | | businessAddress | string | no | | 754 | | pincode | string | no | | 755 | | b2b | boolean | no | | 756 | | b2c | boolean | no | | 757 | | docType | string | no | | 758 | | docNumber | string | no | | 759 | | organizationId | string | no | | 760 | 761 | --- 762 | 763 | 764 | 765 | 766 | #### [UpdateLogo](#UpdateLogo) 767 | 768 | | Properties | Type | Nullable | Description | 769 | | ---------- | ---- | -------- | ----------- | 770 | | logo | string | no | | 771 | 772 | --- 773 | 774 | 775 | 776 | 777 | #### [AddMetaSchemaRequest](#AddMetaSchemaRequest) 778 | 779 | | Properties | Type | Nullable | Description | 780 | | ---------- | ---- | -------- | ----------- | 781 | | merchantId | string | no | | 782 | | schema | string | no | | 783 | 784 | --- 785 | 786 | 787 | 788 | 789 | #### [AddMetaSchemaResponse](#AddMetaSchemaResponse) 790 | 791 | | Properties | Type | Nullable | Description | 792 | | ---------- | ---- | -------- | ----------- | 793 | | merchantId | string | no | | 794 | | lenderId | string | no | | 795 | | mid | string | no | | 796 | | data | string | no | | 797 | 798 | --- 799 | 800 | 801 | 802 | 803 | #### [UpdateOrganization](#UpdateOrganization) 804 | 805 | | Properties | Type | Nullable | Description | 806 | | ---------- | ---- | -------- | ----------- | 807 | | id | string | yes | | 808 | | name | any | no | | 809 | | logo | any | no | | 810 | | website | any | no | | 811 | | disbursementAccountHolderName | any | no | | 812 | | disbursementAccountNumber | any | no | | 813 | | disbursementIfsc | any | no | | 814 | | active | boolean | no | | 815 | 816 | --- 817 | 818 | 819 | 820 | 821 | #### [UpdateFinancials](#UpdateFinancials) 822 | 823 | | Properties | Type | Nullable | Description | 824 | | ---------- | ---- | -------- | ----------- | 825 | | disbursementAccountHolderName | string | yes | | 826 | | disbursementAccountNumber | string | yes | | 827 | | disbursementIfsc | string | yes | | 828 | 829 | --- 830 | 831 | 832 | 833 | 834 | #### [Documents](#Documents) 835 | 836 | | Properties | Type | Nullable | Description | 837 | | ---------- | ---- | -------- | ----------- | 838 | | docType | string | yes | | 839 | | docNumber | string | yes | | 840 | 841 | --- 842 | 843 | 844 | 845 | 846 | #### [FinancialDetails](#FinancialDetails) 847 | 848 | | Properties | Type | Nullable | Description | 849 | | ---------- | ---- | -------- | ----------- | 850 | | disbursementAccountHolderName | string | no | | 851 | | disbursementAccountNumber | string | no | | 852 | | disbursementIfsc | string | no | | 853 | | b2b | boolean | no | | 854 | | b2c | boolean | no | | 855 | | businessName | string | no | | 856 | | email | string | no | | 857 | | supportEmail | string | no | | 858 | | description | string | no | | 859 | | businessAddress | string | no | | 860 | | pincode | string | no | | 861 | | documents | [[Documents](#Documents)] | no | | 862 | 863 | --- 864 | 865 | 866 | 867 | 868 | #### [GetOrganization](#GetOrganization) 869 | 870 | | Properties | Type | Nullable | Description | 871 | | ---------- | ---- | -------- | ----------- | 872 | | organizationId | string | no | | 873 | | createdAt | string | no | | 874 | | updatedAt | string | no | | 875 | | isAdmin | boolean | no | | 876 | | name | string | no | | 877 | | isActive | boolean | no | | 878 | 879 | --- 880 | 881 | 882 | 883 | 884 | #### [OrganizationDetails](#OrganizationDetails) 885 | 886 | | Properties | Type | Nullable | Description | 887 | | ---------- | ---- | -------- | ----------- | 888 | | name | string | no | | 889 | | organizationId | string | no | | 890 | | isAdmin | boolean | no | | 891 | | createdAt | string | no | | 892 | | updatedAt | string | no | | 893 | | deletedAt | string | no | | 894 | | isActive | boolean | no | | 895 | | logo | string | no | | 896 | | website | string | no | | 897 | | disbursementAccountHolderName | string | no | | 898 | | disbursementAccountNumber | string | no | | 899 | | disbursementIfsc | string | no | | 900 | 901 | --- 902 | 903 | 904 | 905 | 906 | #### [Organization](#Organization) 907 | 908 | | Properties | Type | Nullable | Description | 909 | | ---------- | ---- | -------- | ----------- | 910 | | id | string | no | | 911 | | name | string | no | | 912 | | active | boolean | no | | 913 | | createdAt | string | no | | 914 | | updatedAt | string | no | | 915 | | deletedAt | string | no | | 916 | 917 | --- 918 | 919 | 920 | 921 | 922 | #### [OrganizationList](#OrganizationList) 923 | 924 | | Properties | Type | Nullable | Description | 925 | | ---------- | ---- | -------- | ----------- | 926 | | name | string | no | | 927 | | logo | string | no | | 928 | | id | boolean | no | | 929 | | createdAt | string | no | | 930 | | updatedAt | string | no | | 931 | | deletedAt | string | no | | 932 | | isActive | boolean | no | | 933 | | epikId | string | no | | 934 | | website | string | no | | 935 | | disbursementAccountHolderName | string | no | | 936 | | disbursementAccountNumber | string | no | | 937 | | disbursementIfsc | string | no | | 938 | 939 | --- 940 | 941 | 942 | 943 | 944 | #### [OrganizationCount](#OrganizationCount) 945 | 946 | | Properties | Type | Nullable | Description | 947 | | ---------- | ---- | -------- | ----------- | 948 | | count | string | no | | 949 | 950 | --- 951 | 952 | 953 | 954 | 955 | #### [TeamMembers](#TeamMembers) 956 | 957 | | Properties | Type | Nullable | Description | 958 | | ---------- | ---- | -------- | ----------- | 959 | | members | [[Member](#Member)] | no | | 960 | 961 | --- 962 | 963 | 964 | 965 | 966 | #### [Member](#Member) 967 | 968 | | Properties | Type | Nullable | Description | 969 | | ---------- | ---- | -------- | ----------- | 970 | | id | string | no | | 971 | | userId | string | no | | 972 | | organizationId | string | no | | 973 | | isAdmin | boolean | no | | 974 | | createdAt | string | no | | 975 | | updatedAt | string | no | | 976 | | deletedAt | string | no | | 977 | | profile | [Profile](#Profile) | no | | 978 | 979 | --- 980 | 981 | 982 | 983 | 984 | #### [Profile](#Profile) 985 | 986 | | Properties | Type | Nullable | Description | 987 | | ---------- | ---- | -------- | ----------- | 988 | | id | string | no | | 989 | | userId | string | no | | 990 | | organizationId | string | no | | 991 | | isAdmin | boolean | no | | 992 | | createdAt | string | no | | 993 | | updatedAt | string | no | | 994 | | deletedAt | string | no | | 995 | 996 | --- 997 | 998 | 999 | 1000 | 1001 | #### [AddTeamMember](#AddTeamMember) 1002 | 1003 | | Properties | Type | Nullable | Description | 1004 | | ---------- | ---- | -------- | ----------- | 1005 | | countryCode | string | no | | 1006 | | mobile | string | no | | 1007 | | email | string | no | | 1008 | | userIsAdmin | boolean | no | | 1009 | 1010 | --- 1011 | 1012 | 1013 | 1014 | 1015 | #### [UpdateTeamMemberRole](#UpdateTeamMemberRole) 1016 | 1017 | | Properties | Type | Nullable | Description | 1018 | | ---------- | ---- | -------- | ----------- | 1019 | | userIsAdmin | boolean | no | | 1020 | | userId | string | no | | 1021 | 1022 | --- 1023 | 1024 | 1025 | 1026 | 1027 | #### [RemoveTeamMemberResponse](#RemoveTeamMemberResponse) 1028 | 1029 | | Properties | Type | Nullable | Description | 1030 | | ---------- | ---- | -------- | ----------- | 1031 | | success | boolean | no | | 1032 | 1033 | --- 1034 | 1035 | 1036 | 1037 | 1038 | #### [AddTeamMemberResponse](#AddTeamMemberResponse) 1039 | 1040 | | Properties | Type | Nullable | Description | 1041 | | ---------- | ---- | -------- | ----------- | 1042 | | id | string | no | | 1043 | | userId | string | no | | 1044 | | organizationId | string | no | | 1045 | | isAdmin | boolean | no | | 1046 | | createdAt | string | no | | 1047 | | updatedAt | string | no | | 1048 | | deletedAt | string | no | | 1049 | 1050 | --- 1051 | 1052 | 1053 | 1054 | 1055 | #### [ApiKey](#ApiKey) 1056 | 1057 | | Properties | Type | Nullable | Description | 1058 | | ---------- | ---- | -------- | ----------- | 1059 | | key | string | no | | 1060 | | secret | string | no | | 1061 | 1062 | --- 1063 | 1064 | 1065 | 1066 | 1067 | #### [UpdateApiHook](#UpdateApiHook) 1068 | 1069 | | Properties | Type | Nullable | Description | 1070 | | ---------- | ---- | -------- | ----------- | 1071 | | apiKey | string | yes | | 1072 | | url | string | yes | | 1073 | | customHeaders | string | no | | 1074 | 1075 | --- 1076 | 1077 | 1078 | 1079 | 1080 | #### [ApiHookDetails](#ApiHookDetails) 1081 | 1082 | | Properties | Type | Nullable | Description | 1083 | | ---------- | ---- | -------- | ----------- | 1084 | | apiKey | string | yes | | 1085 | | url | string | yes | | 1086 | | customHeaders | string | no | | 1087 | | createdAt | string | no | | 1088 | | updatedAt | string | no | | 1089 | 1090 | --- 1091 | 1092 | 1093 | 1094 | 1095 | #### [UpdateApiHookResponse](#UpdateApiHookResponse) 1096 | 1097 | | Properties | Type | Nullable | Description | 1098 | | ---------- | ---- | -------- | ----------- | 1099 | | success | boolean | no | | 1100 | 1101 | --- 1102 | 1103 | 1104 | 1105 | 1106 | #### [OrganizationIp](#OrganizationIp) 1107 | 1108 | | Properties | Type | Nullable | Description | 1109 | | ---------- | ---- | -------- | ----------- | 1110 | | id | string | no | | 1111 | | ip | string | yes | | 1112 | 1113 | --- 1114 | 1115 | 1116 | 1117 | 1118 | #### [AddOrganizationIpDetails](#AddOrganizationIpDetails) 1119 | 1120 | | Properties | Type | Nullable | Description | 1121 | | ---------- | ---- | -------- | ----------- | 1122 | | organizationIps | [[OrganizationIp](#OrganizationIp)] | no | | 1123 | | delete | string | no | | 1124 | 1125 | --- 1126 | 1127 | 1128 | 1129 | 1130 | #### [AddUpdateCsvFileResponse](#AddUpdateCsvFileResponse) 1131 | 1132 | | Properties | Type | Nullable | Description | 1133 | | ---------- | ---- | -------- | ----------- | 1134 | | message | string | no | | 1135 | 1136 | --- 1137 | 1138 | 1139 | 1140 | 1141 | #### [AddUpdateCsvFileRequest](#AddUpdateCsvFileRequest) 1142 | 1143 | | Properties | Type | Nullable | Description | 1144 | | ---------- | ---- | -------- | ----------- | 1145 | | csv | string | no | | 1146 | | organizationId | string | no | | 1147 | 1148 | --- 1149 | 1150 | 1151 | 1152 | 1153 | #### [CsvFile](#CsvFile) 1154 | 1155 | | Properties | Type | Nullable | Description | 1156 | | ---------- | ---- | -------- | ----------- | 1157 | | csv | string | no | | 1158 | 1159 | --- 1160 | 1161 | 1162 | 1163 | 1164 | #### [AddReportCsvFileResponse](#AddReportCsvFileResponse) 1165 | 1166 | | Properties | Type | Nullable | Description | 1167 | | ---------- | ---- | -------- | ----------- | 1168 | | message | string | no | | 1169 | 1170 | --- 1171 | 1172 | 1173 | 1174 | 1175 | #### [AddReportCsvFileRequest](#AddReportCsvFileRequest) 1176 | 1177 | | Properties | Type | Nullable | Description | 1178 | | ---------- | ---- | -------- | ----------- | 1179 | | csv | string | no | | 1180 | | organizationId | string | no | | 1181 | | name | string | no | | 1182 | | type | string | no | | 1183 | 1184 | --- 1185 | 1186 | 1187 | 1188 | 1189 | #### [ReportCsvFileResponse](#ReportCsvFileResponse) 1190 | 1191 | | Properties | Type | Nullable | Description | 1192 | | ---------- | ---- | -------- | ----------- | 1193 | | csv | string | no | | 1194 | 1195 | --- 1196 | 1197 | 1198 | 1199 | 1200 | #### [AddReportRequestArray](#AddReportRequestArray) 1201 | 1202 | | Properties | Type | Nullable | Description | 1203 | | ---------- | ---- | -------- | ----------- | 1204 | | mobile | string | no | | 1205 | | merchantId | string | no | | 1206 | | category | string | no | | 1207 | | shopName | string | no | | 1208 | | legalName | string | no | | 1209 | | firstName | string | no | | 1210 | | middleName | string | no | | 1211 | | lastName | string | no | | 1212 | | aadhaar | string | no | | 1213 | | nameOnPan | string | no | | 1214 | | gstNumber | string | no | | 1215 | | gstBusinessName | string | no | | 1216 | | panNumber | string | no | | 1217 | | udyam | string | no | | 1218 | | ownershipType | string | no | | 1219 | | address | string | no | | 1220 | | pincode | string | no | | 1221 | | license1Type | string | no | | 1222 | | license1 | string | no | | 1223 | | license2Type | string | no | | 1224 | | license2 | string | no | | 1225 | 1226 | --- 1227 | 1228 | 1229 | 1230 | 1231 | #### [AddReportRequest](#AddReportRequest) 1232 | 1233 | | Properties | Type | Nullable | Description | 1234 | | ---------- | ---- | -------- | ----------- | 1235 | | businessDetails | [any] | no | | 1236 | 1237 | --- 1238 | 1239 | 1240 | 1241 | 1242 | #### [AddReportResponseArray](#AddReportResponseArray) 1243 | 1244 | | Properties | Type | Nullable | Description | 1245 | | ---------- | ---- | -------- | ----------- | 1246 | | mobile | string | no | | 1247 | | merchantId | string | no | | 1248 | | anchorId | string | no | | 1249 | | category | string | no | | 1250 | | shopName | string | no | | 1251 | | legalName | string | no | | 1252 | | firstName | string | no | | 1253 | | middleName | string | no | | 1254 | | lastName | string | no | | 1255 | | aadhaar | string | no | | 1256 | | nameOnPan | string | no | | 1257 | | gstNumber | string | no | | 1258 | | gstBusinessName | string | no | | 1259 | | panNumber | string | no | | 1260 | | udyam | string | no | | 1261 | | ownershipType | string | no | | 1262 | | address | string | no | | 1263 | | pincode | string | no | | 1264 | | license1Type | string | no | | 1265 | | license1 | string | no | | 1266 | | license2Type | string | no | | 1267 | | license2 | string | no | | 1268 | 1269 | --- 1270 | 1271 | 1272 | 1273 | 1274 | #### [AddReportResponse](#AddReportResponse) 1275 | 1276 | | Properties | Type | Nullable | Description | 1277 | | ---------- | ---- | -------- | ----------- | 1278 | | businessDetails | [[AddReportResponseArray](#AddReportResponseArray)] | no | | 1279 | 1280 | --- 1281 | 1282 | 1283 | 1284 | 1285 | #### [VintageDataResponseObject](#VintageDataResponseObject) 1286 | 1287 | | Properties | Type | Nullable | Description | 1288 | | ---------- | ---- | -------- | ----------- | 1289 | | month | string | no | | 1290 | | year | number | no | | 1291 | | revenue | string | no | | 1292 | | businessId | string | no | | 1293 | | createdBy | string | no | | 1294 | | id | string | no | | 1295 | | createdAt | string | no | | 1296 | | updatedBy | string | no | | 1297 | | updatedAt | string | no | | 1298 | 1299 | --- 1300 | 1301 | 1302 | 1303 | 1304 | #### [VintageDataResponse](#VintageDataResponse) 1305 | 1306 | | Properties | Type | Nullable | Description | 1307 | | ---------- | ---- | -------- | ----------- | 1308 | | vintageData | [[VintageDataResponseObject](#VintageDataResponseObject)] | no | | 1309 | 1310 | --- 1311 | 1312 | 1313 | 1314 | 1315 | #### [AddSkuRequestArray](#AddSkuRequestArray) 1316 | 1317 | | Properties | Type | Nullable | Description | 1318 | | ---------- | ---- | -------- | ----------- | 1319 | | sku | string | yes | | 1320 | | productName | string | yes | | 1321 | | creditPurchaseOptionFlag | string | yes | | 1322 | | effectiveDates | string | yes | | 1323 | | organizationId | string | yes | | 1324 | 1325 | --- 1326 | 1327 | 1328 | 1329 | 1330 | #### [AddSkuRequest](#AddSkuRequest) 1331 | 1332 | | Properties | Type | Nullable | Description | 1333 | | ---------- | ---- | -------- | ----------- | 1334 | | skuDetails | [[AddSkuRequestArray](#AddSkuRequestArray)] | no | | 1335 | 1336 | --- 1337 | 1338 | 1339 | 1340 | 1341 | #### [AddSkuResponse](#AddSkuResponse) 1342 | 1343 | | Properties | Type | Nullable | Description | 1344 | | ---------- | ---- | -------- | ----------- | 1345 | | message | string | no | | 1346 | 1347 | --- 1348 | 1349 | 1350 | 1351 | 1352 | #### [RestrictedSkuSchema](#RestrictedSkuSchema) 1353 | 1354 | | Properties | Type | Nullable | Description | 1355 | | ---------- | ---- | -------- | ----------- | 1356 | | skuDetails | [any] | no | | 1357 | 1358 | --- 1359 | 1360 | 1361 | 1362 | 1363 | #### [OrganizationIpResponse](#OrganizationIpResponse) 1364 | 1365 | | Properties | Type | Nullable | Description | 1366 | | ---------- | ---- | -------- | ----------- | 1367 | | organizationId | string | yes | | 1368 | | ip | string | yes | | 1369 | | createdAt | string | no | | 1370 | | updatedAt | string | no | | 1371 | | id | string | yes | | 1372 | 1373 | --- 1374 | 1375 | 1376 | 1377 | 1378 | #### [OrganizationIpDetails](#OrganizationIpDetails) 1379 | 1380 | | Properties | Type | Nullable | Description | 1381 | | ---------- | ---- | -------- | ----------- | 1382 | | organizationIps | [[OrganizationIpResponse](#OrganizationIpResponse)] | no | | 1383 | 1384 | --- 1385 | 1386 | 1387 | 1388 | 1389 | #### [TrFilterKeys](#TrFilterKeys) 1390 | 1391 | | Properties | Type | Nullable | Description | 1392 | | ---------- | ---- | -------- | ----------- | 1393 | | display | string | no | | 1394 | | name | string | no | | 1395 | | kind | string | no | | 1396 | 1397 | --- 1398 | 1399 | 1400 | 1401 | 1402 | #### [TrFilterValues](#TrFilterValues) 1403 | 1404 | | Properties | Type | Nullable | Description | 1405 | | ---------- | ---- | -------- | ----------- | 1406 | | display | string | no | | 1407 | | isSelected | boolean | no | | 1408 | | value | string | no | | 1409 | 1410 | --- 1411 | 1412 | 1413 | 1414 | 1415 | #### [TrFilters](#TrFilters) 1416 | 1417 | | Properties | Type | Nullable | Description | 1418 | | ---------- | ---- | -------- | ----------- | 1419 | | key | [TrFilterKeys](#TrFilterKeys) | no | | 1420 | | values | [[TrFilterValues](#TrFilterValues)] | no | | 1421 | 1422 | --- 1423 | 1424 | 1425 | 1426 | 1427 | #### [TrPageResponse](#TrPageResponse) 1428 | 1429 | | Properties | Type | Nullable | Description | 1430 | | ---------- | ---- | -------- | ----------- | 1431 | | type | string | yes | | 1432 | | current | number | yes | | 1433 | | hasPrevious | boolean | yes | | 1434 | | hasNext | boolean | yes | | 1435 | | size | number | yes | | 1436 | | itemTotal | number | yes | | 1437 | 1438 | --- 1439 | 1440 | 1441 | 1442 | 1443 | #### [RefundSuccess](#RefundSuccess) 1444 | 1445 | | Properties | Type | Nullable | Description | 1446 | | ---------- | ---- | -------- | ----------- | 1447 | | status | string | yes | | 1448 | | message | number | yes | | 1449 | | transactionId | string | yes | | 1450 | | refundId | string | yes | | 1451 | 1452 | --- 1453 | 1454 | 1455 | 1456 | 1457 | #### [RefundItem](#RefundItem) 1458 | 1459 | | Properties | Type | Nullable | Description | 1460 | | ---------- | ---- | -------- | ----------- | 1461 | | items | [any] | yes | | 1462 | 1463 | --- 1464 | 1465 | 1466 | 1467 | 1468 | #### [FilterByDate](#FilterByDate) 1469 | 1470 | | Properties | Type | Nullable | Description | 1471 | | ---------- | ---- | -------- | ----------- | 1472 | | startDate | string | no | | 1473 | | endDate | string | no | | 1474 | 1475 | --- 1476 | 1477 | 1478 | 1479 | 1480 | #### [Refund](#Refund) 1481 | 1482 | | Properties | Type | Nullable | Description | 1483 | | ---------- | ---- | -------- | ----------- | 1484 | | refundItems | [RefundItem](#RefundItem) | no | | 1485 | | refundId | string | yes | | 1486 | | refundAmount | number | yes | | 1487 | 1488 | --- 1489 | 1490 | 1491 | 1492 | 1493 | #### [GetAccessTokenResponse](#GetAccessTokenResponse) 1494 | 1495 | | Properties | Type | Nullable | Description | 1496 | | ---------- | ---- | -------- | ----------- | 1497 | | success | boolean | no | | 1498 | | accessToken | string | no | | 1499 | | refreshToken | string | no | | 1500 | | tokenExpireAt | string | no | | 1501 | | tokenExpiryIn | string | no | | 1502 | | refreshTokenExpiryAt | string | no | | 1503 | | refreshTokenExpiryIn | string | no | | 1504 | | scope | [string] | no | | 1505 | 1506 | --- 1507 | 1508 | 1509 | 1510 | 1511 | #### [RefreshTokenResponse](#RefreshTokenResponse) 1512 | 1513 | | Properties | Type | Nullable | Description | 1514 | | ---------- | ---- | -------- | ----------- | 1515 | | success | boolean | no | | 1516 | | accessToken | string | no | | 1517 | | tokenExpireAt | string | no | | 1518 | | tokenExpiryIn | string | no | | 1519 | 1520 | --- 1521 | 1522 | 1523 | 1524 | 1525 | #### [RefreshTokenRequest](#RefreshTokenRequest) 1526 | 1527 | | Properties | Type | Nullable | Description | 1528 | | ---------- | ---- | -------- | ----------- | 1529 | | token | string | yes | | 1530 | 1531 | --- 1532 | 1533 | 1534 | 1535 | 1536 | #### [IntegrationResponseMeta](#IntegrationResponseMeta) 1537 | 1538 | | Properties | Type | Nullable | Description | 1539 | | ---------- | ---- | -------- | ----------- | 1540 | | timestamp | string | yes | The timestamp when the response was generated. | 1541 | | version | string | yes | The version of the API. | 1542 | | product | string | yes | The name of the product or service. | 1543 | | requestId | string | no | An optional request identifier. | 1544 | 1545 | --- 1546 | 1547 | 1548 | 1549 | 1550 | #### [IntegrationResponseError](#IntegrationResponseError) 1551 | 1552 | | Properties | Type | Nullable | Description | 1553 | | ---------- | ---- | -------- | ----------- | 1554 | | code | string | yes | Error code representing the type of error. | 1555 | | message | string | yes | A human-readable message providing more details about the error. | 1556 | | exception | string | yes | The exception name or type. | 1557 | | field | string | no | The field associated with the error, if applicable. | 1558 | | location | string | no | The location of the field, such as 'query', 'param' or 'body'. | 1559 | 1560 | --- 1561 | 1562 | 1563 | 1564 | 1565 | #### [IntegrationErrorResponse](#IntegrationErrorResponse) 1566 | 1567 | | Properties | Type | Nullable | Description | 1568 | | ---------- | ---- | -------- | ----------- | 1569 | | message | string | yes | A message indicating the failure of the operation. | 1570 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | yes | | 1571 | | error | [IntegrationResponseError](#IntegrationResponseError) | yes | | 1572 | 1573 | --- 1574 | 1575 | 1576 | 1577 | 1578 | #### [ValidateCredentialsData](#ValidateCredentialsData) 1579 | 1580 | | Properties | Type | Nullable | Description | 1581 | | ---------- | ---- | -------- | ----------- | 1582 | | success | boolean | yes | | 1583 | | organizationId | string | yes | | 1584 | | organizationName | string | no | | 1585 | 1586 | --- 1587 | 1588 | 1589 | 1590 | 1591 | #### [ValidateCredentialsResponse](#ValidateCredentialsResponse) 1592 | 1593 | | Properties | Type | Nullable | Description | 1594 | | ---------- | ---- | -------- | ----------- | 1595 | | message | string | yes | Response message indicating the result of the operation. | 1596 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | yes | | 1597 | | data | [ValidateCredentialsData](#ValidateCredentialsData) | yes | | 1598 | 1599 | --- 1600 | 1601 | 1602 | 1603 | 1604 | #### [PaymentLinkResponse](#PaymentLinkResponse) 1605 | 1606 | | Properties | Type | Nullable | Description | 1607 | | ---------- | ---- | -------- | ----------- | 1608 | | status | string | no | | 1609 | | message | string | no | | 1610 | | paymentLink | string | no | | 1611 | 1612 | --- 1613 | 1614 | 1615 | 1616 | 1617 | #### [ApplicationCutomer](#ApplicationCutomer) 1618 | 1619 | | Properties | Type | Nullable | Description | 1620 | | ---------- | ---- | -------- | ----------- | 1621 | | countryCode | string | no | | 1622 | | mobile | string | yes | | 1623 | | uid | string | no | | 1624 | | email | string | no | | 1625 | 1626 | --- 1627 | 1628 | 1629 | 1630 | 1631 | #### [GeoLocation](#GeoLocation) 1632 | 1633 | | Properties | Type | Nullable | Description | 1634 | | ---------- | ---- | -------- | ----------- | 1635 | | latitude | number | yes | | 1636 | | longitude | number | yes | | 1637 | 1638 | --- 1639 | 1640 | 1641 | 1642 | 1643 | #### [Address](#Address) 1644 | 1645 | | Properties | Type | Nullable | Description | 1646 | | ---------- | ---- | -------- | ----------- | 1647 | | line1 | string | no | | 1648 | | line2 | string | no | | 1649 | | city | string | no | | 1650 | | state | string | no | | 1651 | | country | string | no | | 1652 | | pincode | string | no | | 1653 | | type | string | no | | 1654 | | geoLocation | [GeoLocation](#GeoLocation) | no | | 1655 | 1656 | --- 1657 | 1658 | 1659 | 1660 | 1661 | #### [OrderItems](#OrderItems) 1662 | 1663 | | Properties | Type | Nullable | Description | 1664 | | ---------- | ---- | -------- | ----------- | 1665 | | category | string | no | | 1666 | | sku | string | no | | 1667 | | rate | number | no | | 1668 | | quantity | number | no | | 1669 | 1670 | --- 1671 | 1672 | 1673 | 1674 | 1675 | #### [Order](#Order) 1676 | 1677 | | Properties | Type | Nullable | Description | 1678 | | ---------- | ---- | -------- | ----------- | 1679 | | valueInPaise | number | yes | | 1680 | | uid | string | yes | | 1681 | | items | [[OrderItems](#OrderItems)] | no | | 1682 | | shippingAddress | [Address](#Address) | no | | 1683 | | billingAddress | [Address](#Address) | no | | 1684 | 1685 | --- 1686 | 1687 | 1688 | 1689 | 1690 | #### [Device](#Device) 1691 | 1692 | | Properties | Type | Nullable | Description | 1693 | | ---------- | ---- | -------- | ----------- | 1694 | | ipAddress | string | yes | | 1695 | | userAgent | string | yes | | 1696 | | latitude | number | no | | 1697 | | longitude | number | no | | 1698 | 1699 | --- 1700 | 1701 | 1702 | 1703 | 1704 | #### [PaymentLinkRequest](#PaymentLinkRequest) 1705 | 1706 | | Properties | Type | Nullable | Description | 1707 | | ---------- | ---- | -------- | ----------- | 1708 | | autoCapture | boolean | no | | 1709 | | lenderId | string | no | | 1710 | | emiTenure | number | no | | 1711 | | customer | [ApplicationCutomer](#ApplicationCutomer) | yes | | 1712 | | order | [Order](#Order) | yes | | 1713 | | device | [Device](#Device) | no | | 1714 | | meta | string | no | | 1715 | 1716 | --- 1717 | 1718 | 1719 | 1720 | 1721 | #### [UpdateLenderStatusSchemaRequest](#UpdateLenderStatusSchemaRequest) 1722 | 1723 | | Properties | Type | Nullable | Description | 1724 | | ---------- | ---- | -------- | ----------- | 1725 | | merchantId | string | no | | 1726 | | enable | boolean | no | | 1727 | 1728 | --- 1729 | 1730 | 1731 | 1732 | 1733 | #### [UpdateLenderStatusSchemaResponse](#UpdateLenderStatusSchemaResponse) 1734 | 1735 | | Properties | Type | Nullable | Description | 1736 | | ---------- | ---- | -------- | ----------- | 1737 | | merchantId | string | no | | 1738 | | lenderId | string | no | | 1739 | | mid | string | no | | 1740 | | enable | boolean | no | | 1741 | | data | string | no | | 1742 | 1743 | --- 1744 | 1745 | 1746 | 1747 | 1748 | #### [LenderTheme](#LenderTheme) 1749 | 1750 | | Properties | Type | Nullable | Description | 1751 | | ---------- | ---- | -------- | ----------- | 1752 | | iconUrl | string | no | | 1753 | | logoUrl | string | no | | 1754 | 1755 | --- 1756 | 1757 | 1758 | 1759 | 1760 | #### [LenderDetails](#LenderDetails) 1761 | 1762 | | Properties | Type | Nullable | Description | 1763 | | ---------- | ---- | -------- | ----------- | 1764 | | slug | string | no | | 1765 | | name | string | no | | 1766 | | id | string | no | | 1767 | | theme | [LenderTheme](#LenderTheme) | no | | 1768 | 1769 | --- 1770 | 1771 | 1772 | 1773 | 1774 | #### [OutstandingData](#OutstandingData) 1775 | 1776 | | Properties | Type | Nullable | Description | 1777 | | ---------- | ---- | -------- | ----------- | 1778 | | lenderDetails | [LenderDetails](#LenderDetails) | no | | 1779 | | availableLimit | number | no | | 1780 | | creditLimit | number | no | | 1781 | | dueAmount | number | no | | 1782 | | outstandingAmount | number | no | | 1783 | | dueDate | string | no | | 1784 | 1785 | --- 1786 | 1787 | 1788 | 1789 | 1790 | #### [OutstandingDetailsResponse](#OutstandingDetailsResponse) 1791 | 1792 | | Properties | Type | Nullable | Description | 1793 | | ---------- | ---- | -------- | ----------- | 1794 | | outstandingDetails | [[OutstandingData](#OutstandingData)] | no | | 1795 | 1796 | --- 1797 | 1798 | 1799 | 1800 | 1801 | #### [CreateUserRequestSchema](#CreateUserRequestSchema) 1802 | 1803 | | Properties | Type | Nullable | Description | 1804 | | ---------- | ---- | -------- | ----------- | 1805 | | mobile | string | yes | | 1806 | | email | string | no | | 1807 | | firstName | string | no | | 1808 | | lastName | string | no | | 1809 | | gender | string | no | | 1810 | 1811 | --- 1812 | 1813 | 1814 | 1815 | 1816 | #### [CreateUserResponseSchema](#CreateUserResponseSchema) 1817 | 1818 | | Properties | Type | Nullable | Description | 1819 | | ---------- | ---- | -------- | ----------- | 1820 | | user | [UserSchema](#UserSchema) | no | | 1821 | 1822 | --- 1823 | 1824 | 1825 | 1826 | 1827 | #### [UserSchema](#UserSchema) 1828 | 1829 | | Properties | Type | Nullable | Description | 1830 | | ---------- | ---- | -------- | ----------- | 1831 | | id | string | no | | 1832 | | firstName | string | no | | 1833 | | lastName | string | no | | 1834 | | mobile | string | no | | 1835 | | email | string | no | | 1836 | | gender | string | no | | 1837 | | dob | string | no | | 1838 | | active | boolean | no | | 1839 | | profilePicUrl | string | no | | 1840 | | isEmailVerified | boolean | no | | 1841 | | createdAt | string | no | | 1842 | | updatedAt | string | no | | 1843 | | deletedAt | string | no | | 1844 | 1845 | --- 1846 | 1847 | 1848 | 1849 | 1850 | -------------------------------------------------------------------------------- /documentation/platform/CREDIT.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ##### [Back to Platform docs](./README.md) 6 | 7 | ## Credit Methods 8 | Transaction Service 9 | * [getOrderStatus](#getorderstatus) 10 | * [getEligiblePlans](#geteligibleplans) 11 | * [updateOrderDeliveryStatus](#updateorderdeliverystatus) 12 | * [getTransactions](#gettransactions) 13 | * [getSettledTransactions](#getsettledtransactions) 14 | 15 | 16 | 17 | ## Methods with example and description 18 | 19 | 20 | ### getOrderStatus 21 | check status of the order 22 | 23 | 24 | 25 | ```javascript 26 | // Promise 27 | const promise = 28 | credit.getOrderStatus( 29 | { 30 | orderId : value 31 | 32 | } 33 | ); 34 | 35 | // Async/Await 36 | const data = await 37 | credit.getOrderStatus( 38 | { 39 | orderId : value 40 | 41 | }); 42 | ``` 43 | 44 | 45 | 46 | 47 | 48 | | Argument | Type | Required | Description | 49 | | --------- | ----- | -------- | ----------- | 50 | | orderId | string | yes | This is order ID | 51 | 52 | 53 | 54 | Use this API to check status the order. 55 | 56 | *Returned Response:* 57 | 58 | 59 | 60 | 61 | [OrderStatus](#OrderStatus) 62 | 63 | Success. Returns a JSON object as shown below. Refer `OrderStatus` for more details. 64 | 65 | 66 | 67 | 68 |
69 |   Examples: 70 | 71 | 72 |
73 |   orderId 74 | 75 | ```json 76 | "FY12345" 77 | ``` 78 |
79 | 80 |
81 |   transactionId 82 | 83 | ```json 84 | "TXN123567890" 85 | ``` 86 |
87 | 88 |
89 |   status 90 | 91 | ```json 92 | "PAYMENT_CAPTURED" 93 | ``` 94 |
95 | 96 |
97 |   message 98 | 99 | ```json 100 | "Payment Accepted" 101 | ``` 102 |
103 | 104 |
105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | --- 115 | 116 | 117 | ### getEligiblePlans 118 | Get eligible plans 119 | 120 | 121 | 122 | ```javascript 123 | // Promise 124 | const promise = 125 | credit.getEligiblePlans( 126 | { 127 | lenderSlug : value, 128 | body : value 129 | 130 | } 131 | ); 132 | 133 | // Async/Await 134 | const data = await 135 | credit.getEligiblePlans( 136 | { 137 | lenderSlug : value, 138 | body : value 139 | 140 | }); 141 | ``` 142 | 143 | 144 | 145 | 146 | 147 | | Argument | Type | Required | Description | 148 | | --------- | ----- | -------- | ----------- | 149 | | lenderSlug | string | yes | This is lender slug | 150 | | body | [EligiblePlansRequest](#EligiblePlansRequest) | yes | Request body | 151 | 152 | 153 | Use this API to Get eligible plans. 154 | 155 | *Returned Response:* 156 | 157 | 158 | 159 | 160 | [EligiblePlansResponse](#EligiblePlansResponse) 161 | 162 | Success. Returns a JSON object as shown below. Refer `EligiblePlansResponse` for more details. 163 | 164 | 165 | 166 | 167 |
168 |   Examples: 169 | 170 | 171 |
172 |   success 173 | 174 | ```json 175 | true 176 | ``` 177 |
178 | 179 |
180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | --- 190 | 191 | 192 | ### updateOrderDeliveryStatus 193 | Update delivery status for an order 194 | 195 | 196 | 197 | ```javascript 198 | // Promise 199 | const promise = 200 | credit.updateOrderDeliveryStatus( 201 | { 202 | body : value 203 | 204 | } 205 | ); 206 | 207 | // Async/Await 208 | const data = await 209 | credit.updateOrderDeliveryStatus( 210 | { 211 | body : value 212 | 213 | }); 214 | ``` 215 | 216 | 217 | 218 | 219 | 220 | | Argument | Type | Required | Description | 221 | | --------- | ----- | -------- | ----------- | 222 | | body | [OrderDeliveryUpdatesBody](#OrderDeliveryUpdatesBody) | yes | Request body | 223 | 224 | 225 | This API updates an order's delivery status using the order ID or transaction ID and manages loan disbursal or cancellation following delivery. It is utilized when the system configuration is set to delay loan disbursal until after delivery, indicated by the 'DELAYED' type and 'DELIVERY' event. If 'delayDays' is set to 0, disbursal occurs within an hour after delivery. Additionally, this API facilitates loan cancellation through specific shipment statuses, offering a precise method for loan management based on delivery outcomes. 226 | 227 | *Returned Response:* 228 | 229 | 230 | 231 | 232 | [OrderDeliveryUpdatesResponse](#OrderDeliveryUpdatesResponse) 233 | 234 | Success. Returns a JSON object as shown below. Refer `OrderDeliveryUpdatesResponse` for more details. 235 | 236 | 237 | 238 | 239 |
240 |   Examples: 241 | 242 | 243 |
244 |   OrderDeliveryUpdatesResponseExample 245 | 246 | ```json 247 | { 248 | "value": { 249 | "message": "The request has been processed successfully.", 250 | "data": { 251 | "orderId": "ORD1234", 252 | "transactionId": "TXN1234", 253 | "shipments": [ 254 | { 255 | "id": "ship12345", 256 | "urn": "ship12345_0", 257 | "shipmentStatus": "CANCELLED", 258 | "shipmentAmount": 100, 259 | "processingStatus": "CAPTURED" 260 | }, 261 | { 262 | "id": "ship12345", 263 | "urn": "ship12345_1", 264 | "shipmentStatus": "DELIVERED", 265 | "shipmentAmount": 500, 266 | "processingStatus": "CAPTURED" 267 | } 268 | ], 269 | "summary": { 270 | "orderAmount": 600, 271 | "capturedAmount": 600, 272 | "uncapturedAmount": 0, 273 | "capturedAmountForDisbursal": 500, 274 | "capturedAmountForCancellation": 100 275 | } 276 | }, 277 | "meta": { 278 | "timestamp": "2024-07-16T12:07:26.979Z", 279 | "version": "v1.0", 280 | "product": "Settle Checkout" 281 | } 282 | } 283 | } 284 | ``` 285 |
286 | 287 |
288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | [OrderDeliveryUpdatesPartialResponse](#OrderDeliveryUpdatesPartialResponse) 298 | 299 | Partial Success. The request was successfully processed for some shipments, but not for others. The response includes detailed information about which parts of the request were successful and which were not. 300 | 301 | 302 | 303 | 304 |
305 |   Examples: 306 | 307 | 308 |
309 |   OrderDeliveryUpdatesPartialExample 310 | 311 | ```json 312 | { 313 | "$ref": "#/components/examples/OrderDeliveryUpdatesPartialExample" 314 | } 315 | ``` 316 |
317 | 318 |
319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | --- 329 | 330 | 331 | ### getTransactions 332 | Get list of user transactions 333 | 334 | 335 | 336 | ```javascript 337 | // Promise 338 | const promise = 339 | credit.getTransactions( 340 | { 341 | mobile : value, 342 | countryCode : value, 343 | page : value, 344 | limit : value, 345 | orderId : value, 346 | transactionId : value, 347 | type : value, 348 | status : value, 349 | onlySelf : value, 350 | granularity : value 351 | 352 | } 353 | ); 354 | 355 | // Async/Await 356 | const data = await 357 | credit.getTransactions( 358 | { 359 | mobile : value, 360 | countryCode : value, 361 | page : value, 362 | limit : value, 363 | orderId : value, 364 | transactionId : value, 365 | type : value, 366 | status : value, 367 | onlySelf : value, 368 | granularity : value 369 | 370 | }); 371 | ``` 372 | 373 | 374 | 375 | 376 | 377 | | Argument | Type | Required | Description | 378 | | --------- | ----- | -------- | ----------- | 379 | | mobile | string | yes | The mobile number of the user | 380 | | countryCode | string | no | The country code of the user's mobile number. | 381 | | page | number | no | The page number of the transaction list | 382 | | limit | number | no | The number of transactions to fetch | 383 | | orderId | string | no | The order ID | 384 | | transactionId | string | no | The transaction ID | 385 | | type | Array | string | no | The transaction type | 386 | | status | Array | string | no | The transaction status | 387 | | onlySelf | boolean | no | Set this flag to true to fetch transactions exclusively for your organization, excluding other organizations. | 388 | | granularity | string | no | Defines the granularity of transaction details. | 389 | 390 | 391 | 392 | Retrieves a paginated list of transactions associated with a specific organization, sorted from the latest to the oldest. This endpoint allows filtering transactions based on various criteria and supports pagination. 393 | 394 | *Returned Response:* 395 | 396 | 397 | 398 | 399 | [GetTransactionsResponse](#GetTransactionsResponse) 400 | 401 | Success. The request has been processed successfully and the response contains the requested data. 402 | 403 | 404 | 405 | 406 |
407 |   Examples: 408 | 409 | 410 |
411 |   GetTransactionsExample 412 | 413 | ```json 414 | { 415 | "value": { 416 | "message": "The request has been processed successfully.", 417 | "data": { 418 | "transactions": [ 419 | { 420 | "id": "TXN1234PKoGu", 421 | "amount": 5000, 422 | "type": "DEBIT", 423 | "status": "SUCCESS", 424 | "settlementUtr": null, 425 | "createdAt": "2024-06-10T12:56:46.396Z", 426 | "merchant": { 427 | "name": "J Company", 428 | "logo": "https://cdn.pixelbin.io/v2/muddy-glitter-1091e5/original/public/logos/j.png" 429 | }, 430 | "order": { 431 | "id": "ORD1234", 432 | "amount": 5000, 433 | "summary": { 434 | "uncapturedAmount": 2000, 435 | "capturedAmount": 3000, 436 | "capturedAmountForDisbursal": 1800, 437 | "capturedAmountForCancellation": 1200 438 | } 439 | }, 440 | "loans": [ 441 | { 442 | "number": "LN123456", 443 | "amount": 5000, 444 | "type": "EMI", 445 | "dueDate": "2024-09-04T18:30:00.000Z", 446 | "repaidAmount": 2600, 447 | "isSettled": false, 448 | "emis": [ 449 | { 450 | "amount": 2600, 451 | "dueDate": "2024-08-04T18:30:00.000Z", 452 | "installmentNo": 1, 453 | "repaidAmount": 2600, 454 | "isSettled": true 455 | }, 456 | { 457 | "amount": 2550, 458 | "dueDate": "2024-09-04T18:30:00.000Z", 459 | "installmentNo": 2, 460 | "repaidAmount": 0, 461 | "isSettled": false 462 | } 463 | ] 464 | } 465 | ], 466 | "lender": { 467 | "name": "Bank of J Limited", 468 | "slug": "j-bank", 469 | "logo": "https://cdn.pixelbin.io/v2/muddy-glitter-1091e5/original/public/logos/j.png", 470 | "shortName": "J Bank" 471 | }, 472 | "isMasked": false 473 | }, 474 | { 475 | "id": "XXXXXPKoGu", 476 | "amount": 500, 477 | "type": "DEBIT", 478 | "status": "SUCCESS", 479 | "settlementUtr": null, 480 | "createdAt": "2024-07-01T11:56:46.396Z", 481 | "merchant": { 482 | "name": "Other Merchant", 483 | "logo": "https://cdn.pixelbin.io/v2/potlee/t.grey()/public/logos/settle/square-dark.png" 484 | }, 485 | "isMasked": true 486 | } 487 | ], 488 | "page": { 489 | "type": "number", 490 | "current": 1, 491 | "hasPrevious": false, 492 | "hasNext": false, 493 | "size": 25, 494 | "itemTotal": 1 495 | } 496 | }, 497 | "meta": { 498 | "timestamp": "2024-07-10T13:56:46.396Z", 499 | "version": "v1.0", 500 | "product": "Settle Checkout" 501 | } 502 | } 503 | } 504 | ``` 505 |
506 | 507 |
508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | --- 518 | 519 | 520 | ### getSettledTransactions 521 | Get list of settled transactions 522 | 523 | 524 | 525 | ```javascript 526 | // Promise 527 | const promise = 528 | credit.getSettledTransactions( 529 | { 530 | page : value, 531 | limit : value, 532 | orderId : value, 533 | transactionId : value, 534 | startDate : value, 535 | endDate : value 536 | 537 | } 538 | ); 539 | 540 | // Async/Await 541 | const data = await 542 | credit.getSettledTransactions( 543 | { 544 | page : value, 545 | limit : value, 546 | orderId : value, 547 | transactionId : value, 548 | startDate : value, 549 | endDate : value 550 | 551 | }); 552 | ``` 553 | 554 | 555 | 556 | 557 | 558 | | Argument | Type | Required | Description | 559 | | --------- | ----- | -------- | ----------- | 560 | | page | number | no | The page number of the transaction list | 561 | | limit | number | no | The number of transactions to fetch | 562 | | orderId | string | no | The order ID | 563 | | transactionId | string | no | The transaction ID | 564 | | startDate | string | no | This is used to filter from date | 565 | | endDate | string | no | This is used to filter till date | 566 | 567 | 568 | 569 | Retrieves a paginated list of Settled transactions associated with a specific organization, sorted from the latest to the oldest. This endpoint allows filtering transactions based on various criteria and supports pagination. 570 | 571 | *Returned Response:* 572 | 573 | 574 | 575 | 576 | [GetSettlementTransactionsResponse](#GetSettlementTransactionsResponse) 577 | 578 | Success. The request has been processed successfully and the response contains the requested data. 579 | 580 | 581 | 582 | 583 |
584 |   Examples: 585 | 586 | 587 |
588 |   GetSettlemetTransactionsExample 589 | 590 | ```json 591 | { 592 | "value": { 593 | "message": "The request has been processed successfully.", 594 | "data": { 595 | "transactions": [ 596 | { 597 | "id": "TXN", 598 | "amount": 10000, 599 | "createdAt": "2024-08-20T06:37:27.150Z", 600 | "orderId": "DEMO-TRANSACTIOn", 601 | "settlementStatus": "PENDING", 602 | "settlementTime": "2024-08-22T15:20:02.274Z" 603 | } 604 | ], 605 | "page": { 606 | "type": "number", 607 | "current": 1, 608 | "hasPrevious": false, 609 | "hasNext": false, 610 | "size": 100, 611 | "itemTotal": null 612 | } 613 | }, 614 | "meta": { 615 | "timestamp": "2024-08-30T10:48:01.915Z", 616 | "version": "v1.0", 617 | "product": "Settle Checkout" 618 | } 619 | } 620 | } 621 | ``` 622 |
623 | 624 |
625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | --- 635 | 636 | 637 | 638 | ### Schemas 639 | 640 | 641 | 642 | #### [ErrorResponse](#ErrorResponse) 643 | 644 | | Properties | Type | Nullable | Description | 645 | | ---------- | ---- | -------- | ----------- | 646 | | message | string | no | | 647 | | info | string | no | | 648 | | code | string | no | | 649 | | requestId | string | no | | 650 | | meta | string | no | | 651 | 652 | --- 653 | 654 | 655 | 656 | 657 | #### [IntegrationResponseMeta](#IntegrationResponseMeta) 658 | 659 | | Properties | Type | Nullable | Description | 660 | | ---------- | ---- | -------- | ----------- | 661 | | timestamp | string | yes | The timestamp when the response was generated. | 662 | | version | string | yes | The version of the API. | 663 | | product | string | yes | The name of the product or service. | 664 | | requestId | string | no | An optional request identifier. | 665 | 666 | --- 667 | 668 | 669 | 670 | 671 | #### [IntegrationResponseError](#IntegrationResponseError) 672 | 673 | | Properties | Type | Nullable | Description | 674 | | ---------- | ---- | -------- | ----------- | 675 | | code | string | yes | Error code representing the type of error. | 676 | | message | string | yes | A human-readable message providing more details about the error. | 677 | | exception | string | yes | The exception name or type. | 678 | | field | string | no | The field associated with the error, if applicable. | 679 | | location | string | no | The location of the field, such as 'query', 'param' or 'body'. | 680 | 681 | --- 682 | 683 | 684 | 685 | 686 | #### [IntegrationSuccessResponse](#IntegrationSuccessResponse) 687 | 688 | | Properties | Type | Nullable | Description | 689 | | ---------- | ---- | -------- | ----------- | 690 | | message | string | yes | A message indicating the success of the operation. | 691 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | yes | | 692 | | data | string | yes | The data payload of the response. The structure of this object will vary depending on the specific API endpoint. | 693 | 694 | --- 695 | 696 | 697 | 698 | 699 | #### [IntegrationErrorResponse](#IntegrationErrorResponse) 700 | 701 | | Properties | Type | Nullable | Description | 702 | | ---------- | ---- | -------- | ----------- | 703 | | message | string | yes | A message indicating the failure of the operation. | 704 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | yes | | 705 | | errors | [[IntegrationResponseError](#IntegrationResponseError)] | no | | 706 | 707 | --- 708 | 709 | 710 | 711 | 712 | #### [DisbursalRequest](#DisbursalRequest) 713 | 714 | | Properties | Type | Nullable | Description | 715 | | ---------- | ---- | -------- | ----------- | 716 | | fingerprint | string | no | | 717 | | chargeToken | string | yes | | 718 | | loanTypeId | number | no | | 719 | | emiTenure | number | no | | 720 | | isDownpaymentRequired | boolean | no | | 721 | | downpaymentAmount | number | no | | 722 | | loanAmount | number | no | | 723 | | data | string | no | | 724 | | transactionId | string | no | | 725 | | lenderSlug | string | no | | 726 | | intent | string | no | | 727 | 728 | --- 729 | 730 | 731 | 732 | 733 | #### [WorkflowUser](#WorkflowUser) 734 | 735 | | Properties | Type | Nullable | Description | 736 | | ---------- | ---- | -------- | ----------- | 737 | | mobile | string | no | | 738 | 739 | --- 740 | 741 | 742 | 743 | 744 | #### [EligiblePlansRequest](#EligiblePlansRequest) 745 | 746 | | Properties | Type | Nullable | Description | 747 | | ---------- | ---- | -------- | ----------- | 748 | | chargeToken | string | no | | 749 | 750 | --- 751 | 752 | 753 | 754 | 755 | #### [EligiblePlans](#EligiblePlans) 756 | 757 | | Properties | Type | Nullable | Description | 758 | | ---------- | ---- | -------- | ----------- | 759 | | name | string | no | | 760 | | displayName | string | no | | 761 | | description | string | no | | 762 | | brokenInterest | number | no | | 763 | | noOfEmi | number | no | | 764 | | emiAmount | number | no | | 765 | | processingFee | number | no | | 766 | | installmentInterestRate | number | no | | 767 | 768 | --- 769 | 770 | 771 | 772 | 773 | #### [EligiblePlansResponse](#EligiblePlansResponse) 774 | 775 | | Properties | Type | Nullable | Description | 776 | | ---------- | ---- | -------- | ----------- | 777 | | eligiblePlans | [[EligiblePlans](#EligiblePlans)] | no | | 778 | 779 | --- 780 | 781 | 782 | 783 | 784 | #### [DisbursalResponse](#DisbursalResponse) 785 | 786 | | Properties | Type | Nullable | Description | 787 | | ---------- | ---- | -------- | ----------- | 788 | | transactionId | string | no | | 789 | | status | string | no | | 790 | | message | string | no | | 791 | 792 | --- 793 | 794 | 795 | 796 | 797 | #### [OrderStatus](#OrderStatus) 798 | 799 | | Properties | Type | Nullable | Description | 800 | | ---------- | ---- | -------- | ----------- | 801 | | orderId | string | yes | | 802 | | transactionId | string | no | | 803 | | status | string | yes | | 804 | | message | string | yes | | 805 | 806 | --- 807 | 808 | 809 | 810 | 811 | #### [DisbursalStatusRequest](#DisbursalStatusRequest) 812 | 813 | | Properties | Type | Nullable | Description | 814 | | ---------- | ---- | -------- | ----------- | 815 | | fingerprint | string | no | | 816 | | transactionId | string | yes | | 817 | 818 | --- 819 | 820 | 821 | 822 | 823 | #### [Transactions](#Transactions) 824 | 825 | | Properties | Type | Nullable | Description | 826 | | ---------- | ---- | -------- | ----------- | 827 | | id | string | yes | | 828 | | userId | string | yes | | 829 | | partnerId | string | no | | 830 | | partner | string | no | | 831 | | partnerLogo | string | no | | 832 | | status | string | yes | | 833 | | type | string | no | | 834 | | remark | string | no | | 835 | | amount | number | yes | | 836 | | loanAccountNumber | string | no | | 837 | | kfs | string | no | | 838 | | utr | string | no | | 839 | | sanctionLetter | string | no | | 840 | | orderId | string | no | | 841 | | refundId | string | no | | 842 | | createdAt | string | yes | | 843 | | lenderId | string | no | | 844 | | lenderName | string | no | | 845 | | lenderLogo | string | no | | 846 | | loanType | string | no | | 847 | | nextDueDate | string | no | | 848 | | paidPercent | number | no | | 849 | | lenderDetail | [LenderDetail](#LenderDetail) | no | | 850 | | emis | [[Emi](#Emi)] | no | | 851 | 852 | --- 853 | 854 | 855 | 856 | 857 | #### [GroupedEmiLoanAccount](#GroupedEmiLoanAccount) 858 | 859 | | Properties | Type | Nullable | Description | 860 | | ---------- | ---- | -------- | ----------- | 861 | | loanAccountNumber | string | yes | | 862 | | kfs | string | no | | 863 | | sanctionLetter | string | no | | 864 | | remark | string | no | | 865 | | createdAt | string | yes | | 866 | | updatedAt | string | yes | | 867 | | amount | number | yes | | 868 | | repaidAmount | number | yes | | 869 | | paid | boolean | yes | | 870 | | overdue | boolean | yes | | 871 | | repaymentDate | string | no | | 872 | | paidPercent | number | yes | | 873 | | lenderDetail | [LenderDetail](#LenderDetail) | yes | | 874 | 875 | --- 876 | 877 | 878 | 879 | 880 | #### [GroupedEmi](#GroupedEmi) 881 | 882 | | Properties | Type | Nullable | Description | 883 | | ---------- | ---- | -------- | ----------- | 884 | | id | string | no | | 885 | | installmentno | number | no | | 886 | | amount | number | no | | 887 | | dueDate | string | no | | 888 | | referenceTransactionId | string | no | | 889 | | createdAt | string | no | | 890 | | updatedAt | string | no | | 891 | | paid | boolean | no | | 892 | | overdue | boolean | no | | 893 | | repaymentDate | string | no | | 894 | | paidPercent | number | no | | 895 | | repaidAmount | number | no | | 896 | | loanAccounts | [[GroupedEmiLoanAccount](#GroupedEmiLoanAccount)] | no | | 897 | 898 | --- 899 | 900 | 901 | 902 | 903 | #### [TransactionDetails](#TransactionDetails) 904 | 905 | | Properties | Type | Nullable | Description | 906 | | ---------- | ---- | -------- | ----------- | 907 | | id | string | yes | | 908 | | userId | string | yes | | 909 | | partnerId | string | yes | | 910 | | partner | string | yes | | 911 | | partnerLogo | string | yes | | 912 | | status | string | yes | | 913 | | type | string | no | | 914 | | remark | string | no | | 915 | | amount | number | yes | | 916 | | loanAccountNumber | string | no | | 917 | | kfs | string | no | | 918 | | utr | string | no | | 919 | | sanctionLetter | string | no | | 920 | | orderId | string | no | | 921 | | refundId | string | no | | 922 | | createdAt | string | yes | | 923 | | lenderId | string | no | | 924 | | lenderName | string | no | | 925 | | lenderLogo | string | no | | 926 | | loanType | string | no | | 927 | | nextDueDate | string | no | | 928 | | paidPercent | number | no | | 929 | | lenderDetail | [LenderDetail](#LenderDetail) | no | | 930 | | emis | [[GroupedEmi](#GroupedEmi)] | no | | 931 | | summary | [TransactionSummary](#TransactionSummary) | no | | 932 | 933 | --- 934 | 935 | 936 | 937 | 938 | #### [TransactionSummary](#TransactionSummary) 939 | 940 | | Properties | Type | Nullable | Description | 941 | | ---------- | ---- | -------- | ----------- | 942 | | capturedAmount | number | yes | The total captured amount. This is the sum of the amounts of all captured shipments. | 943 | | uncapturedAmount | number | yes | The total uncaptured amount. This is calculated as totalAmount - capturedAmount. | 944 | | capturedAmountForDisbursal | number | yes | The total amount captured for disbursal. This represents the sum of amounts from all shipments marked for disbursal. | 945 | | capturedAmountForCancellation | number | yes | The total amount captured for cancellation. This aggregates the amounts from all shipments identified for cancellation. | 946 | | data | [[TransactionSummaryData](#TransactionSummaryData)] | yes | | 947 | 948 | --- 949 | 950 | 951 | 952 | 953 | #### [TransactionSummaryData](#TransactionSummaryData) 954 | 955 | | Properties | Type | Nullable | Description | 956 | | ---------- | ---- | -------- | ----------- | 957 | | display | [TransactionSummaryDataDisplay](#TransactionSummaryDataDisplay) | no | | 958 | 959 | --- 960 | 961 | 962 | 963 | 964 | #### [TransactionSummaryDataDisplay](#TransactionSummaryDataDisplay) 965 | 966 | | Properties | Type | Nullable | Description | 967 | | ---------- | ---- | -------- | ----------- | 968 | | primary | [TransactionSummaryDataDisplayType](#TransactionSummaryDataDisplayType) | no | | 969 | | secondary | [TransactionSummaryDataDisplayType](#TransactionSummaryDataDisplayType) | no | | 970 | 971 | --- 972 | 973 | 974 | 975 | 976 | #### [TransactionSummaryDataDisplayType](#TransactionSummaryDataDisplayType) 977 | 978 | | Properties | Type | Nullable | Description | 979 | | ---------- | ---- | -------- | ----------- | 980 | | text | string | no | | 981 | 982 | --- 983 | 984 | 985 | 986 | 987 | #### [LenderDetail](#LenderDetail) 988 | 989 | | Properties | Type | Nullable | Description | 990 | | ---------- | ---- | -------- | ----------- | 991 | | id | string | no | | 992 | | name | string | no | | 993 | | imageUrl | string | no | | 994 | | slug | string | no | | 995 | | active | boolean | no | | 996 | | b2b | boolean | no | | 997 | | b2c | boolean | no | | 998 | | theme | [Theme](#Theme) | no | | 999 | | createdAt | string | no | | 1000 | | updatedAt | string | no | | 1001 | | deletedAt | string | no | | 1002 | 1003 | --- 1004 | 1005 | 1006 | 1007 | 1008 | #### [FilterKeys](#FilterKeys) 1009 | 1010 | | Properties | Type | Nullable | Description | 1011 | | ---------- | ---- | -------- | ----------- | 1012 | | display | string | no | | 1013 | | name | string | no | | 1014 | | kind | string | no | | 1015 | 1016 | --- 1017 | 1018 | 1019 | 1020 | 1021 | #### [FilterValues](#FilterValues) 1022 | 1023 | | Properties | Type | Nullable | Description | 1024 | | ---------- | ---- | -------- | ----------- | 1025 | | display | string | no | | 1026 | | isSelected | boolean | no | | 1027 | | value | string | no | | 1028 | 1029 | --- 1030 | 1031 | 1032 | 1033 | 1034 | #### [Filters](#Filters) 1035 | 1036 | | Properties | Type | Nullable | Description | 1037 | | ---------- | ---- | -------- | ----------- | 1038 | | key | [FilterKeys](#FilterKeys) | no | | 1039 | | values | [[FilterValues](#FilterValues)] | no | | 1040 | 1041 | --- 1042 | 1043 | 1044 | 1045 | 1046 | #### [PageResponse](#PageResponse) 1047 | 1048 | | Properties | Type | Nullable | Description | 1049 | | ---------- | ---- | -------- | ----------- | 1050 | | type | string | yes | | 1051 | | current | number | yes | | 1052 | | hasPrevious | boolean | yes | | 1053 | | hasNext | boolean | yes | | 1054 | | size | number | yes | | 1055 | | itemTotal | number | yes | | 1056 | 1057 | --- 1058 | 1059 | 1060 | 1061 | 1062 | #### [FilterByDate](#FilterByDate) 1063 | 1064 | | Properties | Type | Nullable | Description | 1065 | | ---------- | ---- | -------- | ----------- | 1066 | | startDate | string | no | | 1067 | | endDate | string | no | | 1068 | 1069 | --- 1070 | 1071 | 1072 | 1073 | 1074 | #### [TransactionResponse](#TransactionResponse) 1075 | 1076 | | Properties | Type | Nullable | Description | 1077 | | ---------- | ---- | -------- | ----------- | 1078 | | filters | [[Filters](#Filters)] | yes | | 1079 | | page | [PageResponse](#PageResponse) | yes | | 1080 | | transactions | [[Transactions](#Transactions)] | yes | | 1081 | 1082 | --- 1083 | 1084 | 1085 | 1086 | 1087 | #### [GetReconciliationFileResponse](#GetReconciliationFileResponse) 1088 | 1089 | | Properties | Type | Nullable | Description | 1090 | | ---------- | ---- | -------- | ----------- | 1091 | | files | [[ReconFile](#ReconFile)] | yes | | 1092 | 1093 | --- 1094 | 1095 | 1096 | 1097 | 1098 | #### [ReconFile](#ReconFile) 1099 | 1100 | | Properties | Type | Nullable | Description | 1101 | | ---------- | ---- | -------- | ----------- | 1102 | | base64 | string | yes | | 1103 | | name | string | yes | | 1104 | 1105 | --- 1106 | 1107 | 1108 | 1109 | 1110 | #### [UploadReconciliationFileRequest](#UploadReconciliationFileRequest) 1111 | 1112 | | Properties | Type | Nullable | Description | 1113 | | ---------- | ---- | -------- | ----------- | 1114 | | base64File | string | yes | | 1115 | | format | string | no | | 1116 | | lenderId | string | no | | 1117 | 1118 | --- 1119 | 1120 | 1121 | 1122 | 1123 | #### [UploadReconciliationFileResponse](#UploadReconciliationFileResponse) 1124 | 1125 | | Properties | Type | Nullable | Description | 1126 | | ---------- | ---- | -------- | ----------- | 1127 | | success | boolean | no | | 1128 | 1129 | --- 1130 | 1131 | 1132 | 1133 | 1134 | #### [TransactionCount](#TransactionCount) 1135 | 1136 | | Properties | Type | Nullable | Description | 1137 | | ---------- | ---- | -------- | ----------- | 1138 | | totalTransactions | string | no | | 1139 | 1140 | --- 1141 | 1142 | 1143 | 1144 | 1145 | #### [RefundCount](#RefundCount) 1146 | 1147 | | Properties | Type | Nullable | Description | 1148 | | ---------- | ---- | -------- | ----------- | 1149 | | refundTransactions | string | no | | 1150 | 1151 | --- 1152 | 1153 | 1154 | 1155 | 1156 | #### [OrganizationTransactionsCount](#OrganizationTransactionsCount) 1157 | 1158 | | Properties | Type | Nullable | Description | 1159 | | ---------- | ---- | -------- | ----------- | 1160 | | count | number | no | | 1161 | 1162 | --- 1163 | 1164 | 1165 | 1166 | 1167 | #### [OrganizationTransactionsSum](#OrganizationTransactionsSum) 1168 | 1169 | | Properties | Type | Nullable | Description | 1170 | | ---------- | ---- | -------- | ----------- | 1171 | | sum | number | no | | 1172 | 1173 | --- 1174 | 1175 | 1176 | 1177 | 1178 | #### [UniqueCustomersInOrg](#UniqueCustomersInOrg) 1179 | 1180 | | Properties | Type | Nullable | Description | 1181 | | ---------- | ---- | -------- | ----------- | 1182 | | count | number | no | | 1183 | 1184 | --- 1185 | 1186 | 1187 | 1188 | 1189 | #### [TransactionAmount](#TransactionAmount) 1190 | 1191 | | Properties | Type | Nullable | Description | 1192 | | ---------- | ---- | -------- | ----------- | 1193 | | totalTransactionAmount | string | no | | 1194 | 1195 | --- 1196 | 1197 | 1198 | 1199 | 1200 | #### [SchemaForOneDayTotal](#SchemaForOneDayTotal) 1201 | 1202 | | Properties | Type | Nullable | Description | 1203 | | ---------- | ---- | -------- | ----------- | 1204 | | orgId | string | no | | 1205 | | createdAt | string | no | | 1206 | | count | number | no | | 1207 | | sum | string | no | | 1208 | | refund | string | no | | 1209 | | difference | string | no | | 1210 | 1211 | --- 1212 | 1213 | 1214 | 1215 | 1216 | #### [SumofOneDayTransactions](#SumofOneDayTransactions) 1217 | 1218 | | Properties | Type | Nullable | Description | 1219 | | ---------- | ---- | -------- | ----------- | 1220 | | dayTotal | [[SchemaForOneDayTotal](#SchemaForOneDayTotal)] | no | | 1221 | 1222 | --- 1223 | 1224 | 1225 | 1226 | 1227 | #### [AverageTransaction](#AverageTransaction) 1228 | 1229 | | Properties | Type | Nullable | Description | 1230 | | ---------- | ---- | -------- | ----------- | 1231 | | average | number | no | | 1232 | 1233 | --- 1234 | 1235 | 1236 | 1237 | 1238 | #### [AllTransactionsResponse](#AllTransactionsResponse) 1239 | 1240 | | Properties | Type | Nullable | Description | 1241 | | ---------- | ---- | -------- | ----------- | 1242 | | id | string | no | | 1243 | | userId | string | no | | 1244 | | partnerId | string | no | | 1245 | | status | string | no | | 1246 | | type | string | no | | 1247 | | remark | string | no | | 1248 | | amount | number | no | | 1249 | | loanAccountNumber | string | no | | 1250 | | createdAt | string | no | | 1251 | 1252 | --- 1253 | 1254 | 1255 | 1256 | 1257 | #### [TotalRefund](#TotalRefund) 1258 | 1259 | | Properties | Type | Nullable | Description | 1260 | | ---------- | ---- | -------- | ----------- | 1261 | | totalRefund | string | no | | 1262 | 1263 | --- 1264 | 1265 | 1266 | 1267 | 1268 | #### [TotalRepayment](#TotalRepayment) 1269 | 1270 | | Properties | Type | Nullable | Description | 1271 | | ---------- | ---- | -------- | ----------- | 1272 | | totalRepayment | string | no | | 1273 | 1274 | --- 1275 | 1276 | 1277 | 1278 | 1279 | #### [TotalOverDue](#TotalOverDue) 1280 | 1281 | | Properties | Type | Nullable | Description | 1282 | | ---------- | ---- | -------- | ----------- | 1283 | | totalDue | string | no | | 1284 | 1285 | --- 1286 | 1287 | 1288 | 1289 | 1290 | #### [TotalLoansDisbursed](#TotalLoansDisbursed) 1291 | 1292 | | Properties | Type | Nullable | Description | 1293 | | ---------- | ---- | -------- | ----------- | 1294 | | totalLoansDisbursed | string | no | | 1295 | 1296 | --- 1297 | 1298 | 1299 | 1300 | 1301 | #### [OrganizationTransactionResponse](#OrganizationTransactionResponse) 1302 | 1303 | | Properties | Type | Nullable | Description | 1304 | | ---------- | ---- | -------- | ----------- | 1305 | | filters | [[TrFilters](#TrFilters)] | yes | | 1306 | | page | [TrPageResponse](#TrPageResponse) | yes | | 1307 | | transactions | [[OrgTransactions](#OrgTransactions)] | yes | | 1308 | 1309 | --- 1310 | 1311 | 1312 | 1313 | 1314 | #### [TrFilters](#TrFilters) 1315 | 1316 | | Properties | Type | Nullable | Description | 1317 | | ---------- | ---- | -------- | ----------- | 1318 | | key | [TrFilterKeys](#TrFilterKeys) | no | | 1319 | | values | [[TrFilterValues](#TrFilterValues)] | no | | 1320 | 1321 | --- 1322 | 1323 | 1324 | 1325 | 1326 | #### [TrPageResponse](#TrPageResponse) 1327 | 1328 | | Properties | Type | Nullable | Description | 1329 | | ---------- | ---- | -------- | ----------- | 1330 | | type | string | yes | | 1331 | | current | number | yes | | 1332 | | hasPrevious | boolean | yes | | 1333 | | hasNext | boolean | yes | | 1334 | | size | number | yes | | 1335 | | itemTotal | number | yes | | 1336 | 1337 | --- 1338 | 1339 | 1340 | 1341 | 1342 | #### [OrgTransactions](#OrgTransactions) 1343 | 1344 | | Properties | Type | Nullable | Description | 1345 | | ---------- | ---- | -------- | ----------- | 1346 | | id | string | yes | | 1347 | | userId | string | yes | | 1348 | | userName | string | no | | 1349 | | partnerId | string | no | | 1350 | | partner | string | no | | 1351 | | partnerLogo | string | no | | 1352 | | status | string | yes | | 1353 | | type | string | no | | 1354 | | remark | string | no | | 1355 | | amount | number | yes | | 1356 | | orderId | string | no | | 1357 | | loanAccountNumber | string | no | | 1358 | | kfs | string | no | | 1359 | | sanctionLetter | string | no | | 1360 | | createdAt | string | yes | | 1361 | 1362 | --- 1363 | 1364 | 1365 | 1366 | 1367 | #### [TrFilterKeys](#TrFilterKeys) 1368 | 1369 | | Properties | Type | Nullable | Description | 1370 | | ---------- | ---- | -------- | ----------- | 1371 | | display | string | no | | 1372 | | name | string | no | | 1373 | | kind | string | no | | 1374 | 1375 | --- 1376 | 1377 | 1378 | 1379 | 1380 | #### [TrFilterValues](#TrFilterValues) 1381 | 1382 | | Properties | Type | Nullable | Description | 1383 | | ---------- | ---- | -------- | ----------- | 1384 | | display | string | no | | 1385 | | isSelected | boolean | no | | 1386 | | value | string | no | | 1387 | 1388 | --- 1389 | 1390 | 1391 | 1392 | 1393 | #### [KfsRequest](#KfsRequest) 1394 | 1395 | | Properties | Type | Nullable | Description | 1396 | | ---------- | ---- | -------- | ----------- | 1397 | | loanTypeId | number | no | | 1398 | | chargeToken | string | no | | 1399 | 1400 | --- 1401 | 1402 | 1403 | 1404 | 1405 | #### [KfsResponse](#KfsResponse) 1406 | 1407 | | Properties | Type | Nullable | Description | 1408 | | ---------- | ---- | -------- | ----------- | 1409 | | kfsTable | string | no | | 1410 | 1411 | --- 1412 | 1413 | 1414 | 1415 | 1416 | #### [LenderTransactionState](#LenderTransactionState) 1417 | 1418 | | Properties | Type | Nullable | Description | 1419 | | ---------- | ---- | -------- | ----------- | 1420 | | id | string | no | | 1421 | | stepIndex | number | no | | 1422 | | lenderId | string | no | | 1423 | | workflowId | string | no | | 1424 | | workflowName | string | no | | 1425 | | parentStateId | string | no | | 1426 | | workflowUrl | string | no | | 1427 | | isInternal | boolean | no | | 1428 | | active | boolean | no | | 1429 | | ttl | number | no | | 1430 | | name | string | no | | 1431 | | type | string | no | | 1432 | | inputData | string | no | | 1433 | | createdAt | string | no | | 1434 | | updatedAt | string | no | | 1435 | | deletedAt | string | no | | 1436 | 1437 | --- 1438 | 1439 | 1440 | 1441 | 1442 | #### [TransactionStateResponse](#TransactionStateResponse) 1443 | 1444 | | Properties | Type | Nullable | Description | 1445 | | ---------- | ---- | -------- | ----------- | 1446 | | transactionState | [[LenderTransactionState](#LenderTransactionState)] | no | | 1447 | 1448 | --- 1449 | 1450 | 1451 | 1452 | 1453 | #### [Theme](#Theme) 1454 | 1455 | | Properties | Type | Nullable | Description | 1456 | | ---------- | ---- | -------- | ----------- | 1457 | | logoUrl | string | no | | 1458 | | iconUrl | string | no | | 1459 | | landscapeBgUrl | string | no | | 1460 | | portraitBgUrl | string | no | | 1461 | | shortName | string | no | | 1462 | 1463 | --- 1464 | 1465 | 1466 | 1467 | 1468 | #### [Emi](#Emi) 1469 | 1470 | | Properties | Type | Nullable | Description | 1471 | | ---------- | ---- | -------- | ----------- | 1472 | | id | string | no | | 1473 | | userId | string | no | | 1474 | | installmentno | number | no | | 1475 | | loanAccountNumber | string | no | | 1476 | | amount | number | no | | 1477 | | dueDate | string | no | | 1478 | | referenceTransactionId | string | no | | 1479 | | remark | string | no | | 1480 | | createdAt | string | no | | 1481 | | updatedAt | string | no | | 1482 | | entityId | string | no | | 1483 | | paid | boolean | no | | 1484 | | overdue | boolean | no | | 1485 | | repaymentDate | string | no | | 1486 | 1487 | --- 1488 | 1489 | 1490 | 1491 | 1492 | #### [MetricPivots](#MetricPivots) 1493 | 1494 | | Properties | Type | Nullable | Description | 1495 | | ---------- | ---- | -------- | ----------- | 1496 | | date | string | no | | 1497 | | sum | number | no | | 1498 | 1499 | --- 1500 | 1501 | 1502 | 1503 | 1504 | #### [TransactionMetricSubResponse](#TransactionMetricSubResponse) 1505 | 1506 | | Properties | Type | Nullable | Description | 1507 | | ---------- | ---- | -------- | ----------- | 1508 | | total | string | no | | 1509 | | pivots | [[MetricPivots](#MetricPivots)] | no | | 1510 | | title | string | no | | 1511 | | description | string | no | | 1512 | | valueFormat | string | no | | 1513 | | logo | string | no | | 1514 | 1515 | --- 1516 | 1517 | 1518 | 1519 | 1520 | #### [TransactionMetrics](#TransactionMetrics) 1521 | 1522 | | Properties | Type | Nullable | Description | 1523 | | ---------- | ---- | -------- | ----------- | 1524 | | totalDisbursement | [TransactionMetricSubResponse](#TransactionMetricSubResponse) | no | | 1525 | | totalOverdue | [TransactionMetricSubResponse](#TransactionMetricSubResponse) | no | | 1526 | | totalRepayment | [TransactionMetricSubResponse](#TransactionMetricSubResponse) | no | | 1527 | 1528 | --- 1529 | 1530 | 1531 | 1532 | 1533 | #### [LenderCustomerTransactionMetricsFilters](#LenderCustomerTransactionMetricsFilters) 1534 | 1535 | | Properties | Type | Nullable | Description | 1536 | | ---------- | ---- | -------- | ----------- | 1537 | | type | string | yes | | 1538 | | display | string | yes | | 1539 | | value | [string] | yes | | 1540 | | isSelected | boolean | no | | 1541 | | isActive | boolean | yes | | 1542 | 1543 | --- 1544 | 1545 | 1546 | 1547 | 1548 | #### [LenderCustomerTransactionMetrics](#LenderCustomerTransactionMetrics) 1549 | 1550 | | Properties | Type | Nullable | Description | 1551 | | ---------- | ---- | -------- | ----------- | 1552 | | metrics | [TransactionMetrics](#TransactionMetrics) | no | | 1553 | | filters | [[LenderCustomerTransactionMetricsFilters](#LenderCustomerTransactionMetricsFilters)] | no | | 1554 | | sort | [[LenderCustomerTransactionMetricsFilters](#LenderCustomerTransactionMetricsFilters)] | no | | 1555 | 1556 | --- 1557 | 1558 | 1559 | 1560 | 1561 | #### [LenderCustomerTransactionMetricsResponse](#LenderCustomerTransactionMetricsResponse) 1562 | 1563 | | Properties | Type | Nullable | Description | 1564 | | ---------- | ---- | -------- | ----------- | 1565 | | data | string | no | | 1566 | 1567 | --- 1568 | 1569 | 1570 | 1571 | 1572 | #### [LenderCustomerTransactionMetricsRequest](#LenderCustomerTransactionMetricsRequest) 1573 | 1574 | | Properties | Type | Nullable | Description | 1575 | | ---------- | ---- | -------- | ----------- | 1576 | | filters | [[LenderCustomerTransactionMetricsFilters](#LenderCustomerTransactionMetricsFilters)] | no | | 1577 | | sort | [[LenderCustomerTransactionMetricsFilters](#LenderCustomerTransactionMetricsFilters)] | no | | 1578 | | startDate | string | no | | 1579 | | endDate | string | no | | 1580 | | merchantId | string | no | | 1581 | | lenderId | string | no | | 1582 | | pivotPoints | number | no | | 1583 | 1584 | --- 1585 | 1586 | 1587 | 1588 | 1589 | #### [OrderShipmentAddressGeoLocation](#OrderShipmentAddressGeoLocation) 1590 | 1591 | | Properties | Type | Nullable | Description | 1592 | | ---------- | ---- | -------- | ----------- | 1593 | | latitude | number | yes | The latitude of the location. | 1594 | | longitude | number | yes | The longitude of the location. | 1595 | 1596 | --- 1597 | 1598 | 1599 | 1600 | 1601 | #### [OrderShipmentAddress](#OrderShipmentAddress) 1602 | 1603 | | Properties | Type | Nullable | Description | 1604 | | ---------- | ---- | -------- | ----------- | 1605 | | line1 | string | no | The first line of the address. | 1606 | | line2 | string | no | The second line of the address. | 1607 | | city | string | no | The city of the address. | 1608 | | state | string | no | The state of the address. | 1609 | | country | string | no | The country of the address. | 1610 | | pincode | string | no | The postal code of the address. | 1611 | | type | string | no | The type of address (e.g., residential, business). | 1612 | | geoLocation | [OrderShipmentAddressGeoLocation](#OrderShipmentAddressGeoLocation) | no | The geographical location of the address. | 1613 | 1614 | --- 1615 | 1616 | 1617 | 1618 | 1619 | #### [OrderShipmentItem](#OrderShipmentItem) 1620 | 1621 | | Properties | Type | Nullable | Description | 1622 | | ---------- | ---- | -------- | ----------- | 1623 | | category | string | no | The category of the item. | 1624 | | sku | string | no | The stock keeping unit for the item. | 1625 | | rate | number | no | The price of a single item. | 1626 | | quantity | number | no | The quantity of the item. | 1627 | 1628 | --- 1629 | 1630 | 1631 | 1632 | 1633 | #### [OrderShipment](#OrderShipment) 1634 | 1635 | | Properties | Type | Nullable | Description | 1636 | | ---------- | ---- | -------- | ----------- | 1637 | | id | string | yes | The identifier for the shipment. | 1638 | | urn | string | no | A unique reference number for the shipment. This is optional; the system will generate a URN if not provided. There can be multiple shipment objects with the same shipment ID, making the URN a unique identifier within the system. | 1639 | | amount | number | yes | The amount corresponding to the shipment that is subject to the status update. | 1640 | | timestamp | string | yes | The timestamp when the status of the shipment was updated. | 1641 | | status | string | yes | The current status of the shipment. | 1642 | | remark | string | no | Any remarks regarding the shipment. | 1643 | | items | [[OrderShipmentItem](#OrderShipmentItem)] | no | The list of items in the shipment. | 1644 | | shippingAddress | [OrderShipmentAddress](#OrderShipmentAddress) | no | The shipping address for the shipment. | 1645 | | billingAddress | [OrderShipmentAddress](#OrderShipmentAddress) | no | The billing address for the shipment. | 1646 | 1647 | --- 1648 | 1649 | 1650 | 1651 | 1652 | #### [OrderDeliveryUpdatesBody](#OrderDeliveryUpdatesBody) 1653 | 1654 | | Properties | Type | Nullable | Description | 1655 | | ---------- | ---- | -------- | ----------- | 1656 | | orderId | string | no | The unique identifier for the order. Required if transactionId is not provided. | 1657 | | transactionId | string | no | The unique identifier for the transaction. Required if orderId is not provided. | 1658 | | includeSummary | boolean | no | A flag to include a summary object in the response, containing data like processed amount and unprocessed amount. | 1659 | | shipments | [[OrderShipment](#OrderShipment)] | yes | The list of shipments for which the status needs to be updated. Only include shipments requiring a status change. | 1660 | 1661 | --- 1662 | 1663 | 1664 | 1665 | 1666 | #### [OrderShipmentSummary](#OrderShipmentSummary) 1667 | 1668 | | Properties | Type | Nullable | Description | 1669 | | ---------- | ---- | -------- | ----------- | 1670 | | orderAmount | number | yes | The total order amount. | 1671 | | capturedAmount | number | yes | The total captured amount. This is the sum of the amounts of all captured shipments. | 1672 | | uncapturedAmount | number | yes | The total uncaptured amount. This is calculated as totalAmount - capturedAmount. | 1673 | | capturedAmountForDisbursal | number | yes | The total amount captured for disbursal. This represents the sum of amounts from all shipments marked for disbursal. | 1674 | | capturedAmountForCancellation | number | yes | The total amount captured for cancellation. This aggregates the amounts from all shipments identified for cancellation. | 1675 | 1676 | --- 1677 | 1678 | 1679 | 1680 | 1681 | #### [OrderShipmentResponse](#OrderShipmentResponse) 1682 | 1683 | | Properties | Type | Nullable | Description | 1684 | | ---------- | ---- | -------- | ----------- | 1685 | | id | string | yes | The unique identifier of the shipment. | 1686 | | urn | string | yes | A unique resource identifier for the shipment. | 1687 | | shipmentStatus | string | yes | The status of the shipment. | 1688 | | shipmentAmount | number | yes | The total amount associated with the shipment. | 1689 | | processingStatus | string | yes | The processing status of the order shipment. | 1690 | 1691 | --- 1692 | 1693 | 1694 | 1695 | 1696 | #### [OrderDeliveryUpdatesData](#OrderDeliveryUpdatesData) 1697 | 1698 | | Properties | Type | Nullable | Description | 1699 | | ---------- | ---- | -------- | ----------- | 1700 | | orderId | string | yes | The unique identifier for the order. | 1701 | | transactionId | string | yes | The unique identifier for the order. | 1702 | | shipments | [[OrderShipmentResponse](#OrderShipmentResponse)] | yes | The list of shipments for which the status was updated. | 1703 | | summary | [OrderShipmentSummary](#OrderShipmentSummary) | no | A summary object containing various amounts related to the order. | 1704 | 1705 | --- 1706 | 1707 | 1708 | 1709 | 1710 | #### [OrderDeliveryUpdatesResponse](#OrderDeliveryUpdatesResponse) 1711 | 1712 | | Properties | Type | Nullable | Description | 1713 | | ---------- | ---- | -------- | ----------- | 1714 | | message | string | yes | Response message indicating the result of the operation. | 1715 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | yes | | 1716 | | data | [OrderDeliveryUpdatesData](#OrderDeliveryUpdatesData) | yes | | 1717 | 1718 | --- 1719 | 1720 | 1721 | 1722 | 1723 | #### [OrderDeliveryUpdatesPartialResponse](#OrderDeliveryUpdatesPartialResponse) 1724 | 1725 | | Properties | Type | Nullable | Description | 1726 | | ---------- | ---- | -------- | ----------- | 1727 | | message | string | yes | Response message indicating the result of the operation. | 1728 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | yes | | 1729 | | data | [OrderDeliveryUpdatesData](#OrderDeliveryUpdatesData) | yes | | 1730 | | errors | [[OrderDeliveryUpdatesError](#OrderDeliveryUpdatesError)] | no | | 1731 | 1732 | --- 1733 | 1734 | 1735 | 1736 | 1737 | #### [OrderDeliveryUpdatesError](#OrderDeliveryUpdatesError) 1738 | 1739 | | Properties | Type | Nullable | Description | 1740 | | ---------- | ---- | -------- | ----------- | 1741 | | code | string | yes | Error code representing the type of error. | 1742 | | message | string | yes | A human-readable message providing more details about the error. | 1743 | | exception | string | yes | The exception name or type. | 1744 | 1745 | --- 1746 | 1747 | 1748 | 1749 | 1750 | #### [TransactionOrderSummary](#TransactionOrderSummary) 1751 | 1752 | | Properties | Type | Nullable | Description | 1753 | | ---------- | ---- | -------- | ----------- | 1754 | | capturedAmount | number | yes | The total captured amount. This is the sum of the amounts of all captured shipments. | 1755 | | uncapturedAmount | number | yes | The total uncaptured amount. This is calculated as totalAmount - capturedAmount. | 1756 | | capturedAmountForDisbursal | number | yes | The total amount captured for disbursal. This represents the sum of amounts from all shipments marked for disbursal. | 1757 | | capturedAmountForCancellation | number | yes | The total amount captured for cancellation. This aggregates the amounts from all shipments identified for cancellation. | 1758 | 1759 | --- 1760 | 1761 | 1762 | 1763 | 1764 | #### [TransactionOrder](#TransactionOrder) 1765 | 1766 | | Properties | Type | Nullable | Description | 1767 | | ---------- | ---- | -------- | ----------- | 1768 | | id | string | yes | Unique identifier of the order. | 1769 | | amount | number | yes | Total amount of the order. | 1770 | | summary | [TransactionOrderSummary](#TransactionOrderSummary) | no | | 1771 | 1772 | --- 1773 | 1774 | 1775 | 1776 | 1777 | #### [TransactionMerchant](#TransactionMerchant) 1778 | 1779 | | Properties | Type | Nullable | Description | 1780 | | ---------- | ---- | -------- | ----------- | 1781 | | name | string | yes | Name of the merchant. | 1782 | | logo | string | yes | URL to the merchant's logo. | 1783 | 1784 | --- 1785 | 1786 | 1787 | 1788 | 1789 | #### [TransactionLoan](#TransactionLoan) 1790 | 1791 | | Properties | Type | Nullable | Description | 1792 | | ---------- | ---- | -------- | ----------- | 1793 | | number | string | yes | Loan account number. | 1794 | | amount | number | yes | Loan amount. | 1795 | | type | string | yes | Type of loan. | 1796 | | dueDate | string | yes | Due date in ISO format for the loan repayment. | 1797 | | repaidAmount | number | yes | Amount that has been repaid. | 1798 | | isSettled | boolean | yes | Indicates if the loan is fully settled. | 1799 | | emis | [[TransactionLoanEmi](#TransactionLoanEmi)] | no | EMIs associated with the loan. This information is available only if the granularity is set to 'detail' and an EMI schedule is available for this loan. | 1800 | 1801 | --- 1802 | 1803 | 1804 | 1805 | 1806 | #### [TransactionLoanEmi](#TransactionLoanEmi) 1807 | 1808 | | Properties | Type | Nullable | Description | 1809 | | ---------- | ---- | -------- | ----------- | 1810 | | amount | number | yes | EMI amount. | 1811 | | dueDate | string | yes | Due date in ISO format for the EMI payment. | 1812 | | installmentNo | number | yes | Installment number for the EMI. | 1813 | | repaidAmount | number | yes | Amount that has been repaid towards the EMI. | 1814 | | isSettled | boolean | yes | Indicates if the EMI is fully settled. | 1815 | 1816 | --- 1817 | 1818 | 1819 | 1820 | 1821 | #### [TransactionLender](#TransactionLender) 1822 | 1823 | | Properties | Type | Nullable | Description | 1824 | | ---------- | ---- | -------- | ----------- | 1825 | | name | string | yes | Name of the lender. | 1826 | | slug | string | yes | A slug representing the lender. | 1827 | | logo | string | yes | URL to the lender's logo. | 1828 | | shortName | string | yes | Short name of the lender. | 1829 | 1830 | --- 1831 | 1832 | 1833 | 1834 | 1835 | #### [UserTransaction](#UserTransaction) 1836 | 1837 | | Properties | Type | Nullable | Description | 1838 | | ---------- | ---- | -------- | ----------- | 1839 | | id | string | yes | Unique identifier of the transaction. | 1840 | | amount | number | yes | Amount of the transaction. | 1841 | | type | string | yes | Type of the transaction. | 1842 | | status | string | yes | Status of the transaction. | 1843 | | settlementUtr | string | no | Settlement UTR for the transaction. | 1844 | | refundId | string | no | Refund ID if the transaction is a refund. | 1845 | | createdAt | string | yes | Timestamp in ISO format when the transaction was created. | 1846 | | isMasked | boolean | yes | Indicates if the transaction details are masked. This field is true of the transaction if done on some other merchant | 1847 | | order | [TransactionOrder](#TransactionOrder) | no | | 1848 | | merchant | [TransactionMerchant](#TransactionMerchant) | yes | | 1849 | | loans | [[TransactionLoan](#TransactionLoan)] | no | | 1850 | | lender | [TransactionLender](#TransactionLender) | no | | 1851 | 1852 | --- 1853 | 1854 | 1855 | 1856 | 1857 | #### [Pagination](#Pagination) 1858 | 1859 | | Properties | Type | Nullable | Description | 1860 | | ---------- | ---- | -------- | ----------- | 1861 | | type | string | no | The type of pagination. | 1862 | | current | number | yes | The current page number. | 1863 | | hasPrevious | boolean | yes | Indicates if there is a previous page. | 1864 | | hasNext | boolean | yes | Indicates if there is a next page. | 1865 | | size | number | yes | The number of items per page. | 1866 | | itemTotal | number | yes | The total number of items across all pages. | 1867 | 1868 | --- 1869 | 1870 | 1871 | 1872 | 1873 | #### [GetTransactionsData](#GetTransactionsData) 1874 | 1875 | | Properties | Type | Nullable | Description | 1876 | | ---------- | ---- | -------- | ----------- | 1877 | | transactions | [[UserTransaction](#UserTransaction)] | yes | | 1878 | | page | [Pagination](#Pagination) | yes | | 1879 | 1880 | --- 1881 | 1882 | 1883 | 1884 | 1885 | #### [GetTransactionsResponse](#GetTransactionsResponse) 1886 | 1887 | | Properties | Type | Nullable | Description | 1888 | | ---------- | ---- | -------- | ----------- | 1889 | | message | string | yes | Response message indicating the result of the operation. | 1890 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | yes | | 1891 | | data | [GetTransactionsData](#GetTransactionsData) | yes | | 1892 | 1893 | --- 1894 | 1895 | 1896 | 1897 | 1898 | #### [SettlementTransactions](#SettlementTransactions) 1899 | 1900 | | Properties | Type | Nullable | Description | 1901 | | ---------- | ---- | -------- | ----------- | 1902 | | id | string | no | Unique identifier for the transaction. | 1903 | | utr | string | no | Unique transaction reference number. | 1904 | | amount | number | no | The amount involved in the transaction. | 1905 | | settlementStatus | string | no | Status of the transaction. | 1906 | | orderId | string | no | Identifier for the associated order. | 1907 | | createdAt | string | no | The time the transaction occurred | 1908 | | settlementTime | string | no | The time the transaction settles and transaction status updated | 1909 | 1910 | --- 1911 | 1912 | 1913 | 1914 | 1915 | #### [GetSettlementTransactionsData](#GetSettlementTransactionsData) 1916 | 1917 | | Properties | Type | Nullable | Description | 1918 | | ---------- | ---- | -------- | ----------- | 1919 | | transactions | [[SettlementTransactions](#SettlementTransactions)] | yes | | 1920 | | page | [Pagination](#Pagination) | yes | | 1921 | 1922 | --- 1923 | 1924 | 1925 | 1926 | 1927 | #### [GetSettlementTransactionsResponse](#GetSettlementTransactionsResponse) 1928 | 1929 | | Properties | Type | Nullable | Description | 1930 | | ---------- | ---- | -------- | ----------- | 1931 | | message | string | yes | Response message indicating the result of the operation. | 1932 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | yes | | 1933 | | data | [GetSettlementTransactionsData](#GetSettlementTransactionsData) | yes | | 1934 | 1935 | --- 1936 | 1937 | 1938 | 1939 | 1940 | #### [SummaryRequest](#SummaryRequest) 1941 | 1942 | | Properties | Type | Nullable | Description | 1943 | | ---------- | ---- | -------- | ----------- | 1944 | | startDate | string | no | | 1945 | | endDate | string | no | | 1946 | | merchantId | string | no | | 1947 | | type | string | no | | 1948 | 1949 | --- 1950 | 1951 | 1952 | 1953 | 1954 | #### [RegisterTransaction](#RegisterTransaction) 1955 | 1956 | | Properties | Type | Nullable | Description | 1957 | | ---------- | ---- | -------- | ----------- | 1958 | | intent | string | no | | 1959 | | token | string | yes | | 1960 | 1961 | --- 1962 | 1963 | 1964 | 1965 | 1966 | #### [RegisterTransactionResponseData](#RegisterTransactionResponseData) 1967 | 1968 | | Properties | Type | Nullable | Description | 1969 | | ---------- | ---- | -------- | ----------- | 1970 | | isExistingOrder | boolean | no | Indicates whether the order already exists. | 1971 | | transaction | any | no | The transaction details, which is unkown. | 1972 | | action | boolean | no | | 1973 | | status | string | no | The status of the transaction. | 1974 | | message | string | no | A message related to the transaction status. | 1975 | 1976 | --- 1977 | 1978 | 1979 | 1980 | 1981 | #### [RegisterTransactionResponseResult](#RegisterTransactionResponseResult) 1982 | 1983 | | Properties | Type | Nullable | Description | 1984 | | ---------- | ---- | -------- | ----------- | 1985 | | redirectUrl | string | no | URL to redirect the user to, if applicable. | 1986 | 1987 | --- 1988 | 1989 | 1990 | 1991 | 1992 | #### [RegisterTransactionResponse](#RegisterTransactionResponse) 1993 | 1994 | | Properties | Type | Nullable | Description | 1995 | | ---------- | ---- | -------- | ----------- | 1996 | | result | [RegisterTransactionResponseResult](#RegisterTransactionResponseResult) | no | | 1997 | | action | string | no | An object for future use, currently empty. | 1998 | | data | [RegisterTransactionResponseData](#RegisterTransactionResponseData) | no | | 1999 | | transactionId | string | no | The unique identifier of the transaction. | 2000 | | status | string | no | The status of the user related to the payment process. | 2001 | | message | string | no | A message related to the user status. | 2002 | 2003 | --- 2004 | 2005 | 2006 | 2007 | 2008 | #### [UpdateTransactionRequest](#UpdateTransactionRequest) 2009 | 2010 | | Properties | Type | Nullable | Description | 2011 | | ---------- | ---- | -------- | ----------- | 2012 | | intent | string | yes | | 2013 | | token | string | yes | | 2014 | 2015 | --- 2016 | 2017 | 2018 | 2019 | 2020 | #### [UpdateTransactionResponse](#UpdateTransactionResponse) 2021 | 2022 | | Properties | Type | Nullable | Description | 2023 | | ---------- | ---- | -------- | ----------- | 2024 | | result | [RegisterTransactionResponseResult](#RegisterTransactionResponseResult) | no | | 2025 | | action | string | no | An object for future use, currently empty. | 2026 | | data | [RegisterTransactionResponseData](#RegisterTransactionResponseData) | no | | 2027 | | transactionId | string | no | The unique identifier of the transaction. | 2028 | | status | string | no | The status of the user related to the payment process. | 2029 | | message | string | no | A message related to the user status. | 2030 | 2031 | --- 2032 | 2033 | 2034 | 2035 | 2036 | --------------------------------------------------------------------------------