├── src └── main │ └── java │ └── com │ └── sdk │ ├── common │ ├── PaginatorCallback.java │ ├── FDKError.java │ ├── FDKTokenIssueError.java │ ├── FDKLogger.java │ ├── RequestSignerInterceptor.java │ ├── AccessResponse.java │ ├── AccessTokenDto.java │ ├── PlatformHeaderInterceptor.java │ ├── AccessTokenInterceptor.java │ ├── Paginator.java │ ├── RetrofitServiceFactory.java │ └── RequestSigner.java │ └── platform │ ├── PlatformClient.java │ ├── PlatformConfig.java │ ├── PlatformApiList.java │ ├── PlatformOauthClient.java │ └── PlatformService.java ├── documentation ├── platform │ ├── README.md │ └── PAYMENTS.md └── application │ ├── SURL.md │ ├── REWARDS.md │ ├── CONTENT.md │ ├── PAYMENT.md │ └── TRANSACTION.md ├── .github └── workflows │ └── on_merge_main.yml ├── .gitignore ├── README.md └── pom.xml /src/main/java/com/sdk/common/PaginatorCallback.java: -------------------------------------------------------------------------------- 1 | package com.sdk.common; 2 | 3 | public interface PaginatorCallback { 4 | T onNext(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/sdk/common/FDKError.java: -------------------------------------------------------------------------------- 1 | package com.sdk.common; 2 | 3 | public class FDKError extends RuntimeException { 4 | 5 | public FDKError(String message) { 6 | super(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sdk/common/FDKTokenIssueError.java: -------------------------------------------------------------------------------- 1 | package com.sdk.common; 2 | 3 | public class FDKTokenIssueError extends RuntimeException { 4 | 5 | public FDKTokenIssueError(String message) { 6 | super(message); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/sdk/common/FDKLogger.java: -------------------------------------------------------------------------------- 1 | package com.sdk.common; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import okhttp3.logging.HttpLoggingInterceptor.Logger; 5 | 6 | @Slf4j 7 | public class FDKLogger implements Logger { 8 | 9 | @Override 10 | public void log(String s) { 11 | log.debug(s); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /.github/workflows/on_merge_main.yml: -------------------------------------------------------------------------------- 1 | on: 2 | release: 3 | types: [created] 4 | 5 | jobs: 6 | 7 | trigger-jitpack-build: 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - name: checkout repository 12 | uses: actions/checkout@v3 13 | 14 | - name: trigger build on jitpack 15 | run: | 16 | curl --request GET "https://jitpack.io/api/builds/settle-finance/java-integration-sdk/${{ github.event.release.tag_name }}" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | mvnw 5 | mvnw.cmd 6 | .mvn/ 7 | !**/src/main/** 8 | !**/src/test/** 9 | 10 | ### STS ### 11 | .apt_generated 12 | .classpath 13 | .factorypath 14 | .project 15 | .settings 16 | .springBeans 17 | .sts4-cache 18 | 19 | ### IntelliJ IDEA ### 20 | .idea 21 | *.iws 22 | *.iml 23 | *.ipr 24 | 25 | ### NetBeans ### 26 | /nbproject/private/ 27 | /nbbuild/ 28 | /dist/ 29 | /nbdist/ 30 | /.nb-gradle/ 31 | build/ 32 | 33 | ### VS Code ### 34 | .vscode/ 35 | -------------------------------------------------------------------------------- /src/main/java/com/sdk/common/RequestSignerInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.sdk.common; 2 | 3 | import java.io.IOException; 4 | 5 | import lombok.NoArgsConstructor; 6 | import okhttp3.Interceptor; 7 | import okhttp3.Request; 8 | import okhttp3.Response; 9 | 10 | @NoArgsConstructor 11 | public class RequestSignerInterceptor implements Interceptor { 12 | 13 | boolean signQuery; 14 | 15 | public RequestSignerInterceptor(boolean signQuery) { 16 | this.signQuery = signQuery; 17 | } 18 | 19 | @Override 20 | public Response intercept(Chain chain) throws IOException { 21 | Request request = new RequestSigner(chain.request()).sign(signQuery); 22 | return chain.proceed(request); 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/sdk/common/AccessResponse.java: -------------------------------------------------------------------------------- 1 | package com.sdk.common; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | @Getter 12 | @Setter 13 | @JsonIgnoreProperties(ignoreUnknown = true) 14 | public class AccessResponse { 15 | @JsonProperty("accessToken") 16 | String accessToken; 17 | 18 | @JsonProperty("token_type") 19 | String tokenType; 20 | 21 | @JsonProperty("tokenExpiryIn") 22 | Long expiresIn; 23 | 24 | @JsonProperty("scope") 25 | List scope; 26 | 27 | @JsonProperty("current_user") 28 | Map currentUser; 29 | 30 | @JsonProperty("refreshToken") 31 | String refreshToken; 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/main/java/com/sdk/platform/PlatformClient.java: -------------------------------------------------------------------------------- 1 | package com.sdk.platform; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class PlatformClient { 9 | 10 | private PlatformConfig config; 11 | 12 | 13 | public PlatformService.CustomerService customer; 14 | 15 | public PlatformService.CreditService credit; 16 | 17 | public PlatformService.MultiKycService multiKyc; 18 | 19 | public PlatformService.MerchantService merchant; 20 | 21 | public PlatformService.PaymentsService payments; 22 | 23 | 24 | public PlatformClient(PlatformConfig config) 25 | { 26 | this.config = config; 27 | 28 | this.customer = new PlatformService.CustomerService(config); 29 | 30 | this.credit = new PlatformService.CreditService(config); 31 | 32 | this.multiKyc = new PlatformService.MultiKycService(config); 33 | 34 | this.merchant = new PlatformService.MerchantService(config); 35 | 36 | this.payments = new PlatformService.PaymentsService(config); 37 | 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /src/main/java/com/sdk/common/AccessTokenDto.java: -------------------------------------------------------------------------------- 1 | package com.sdk.common; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import java.util.Map; 8 | import java.util.Date; 9 | import java.util.List; 10 | 11 | @Getter 12 | @Setter 13 | public class AccessTokenDto { 14 | 15 | @JsonProperty("accessToken") 16 | String accessToken; 17 | 18 | @JsonProperty("access_mode") 19 | String accessMode; 20 | 21 | @JsonProperty("current_user") 22 | Map currentUser; 23 | 24 | @JsonProperty("expires") 25 | String expires; 26 | 27 | @JsonProperty("refreshToken") 28 | String refreshToken; 29 | 30 | @JsonProperty("access_token_validity") 31 | Long accessTokenValidity; 32 | 33 | @JsonProperty("tokenExpiryIn") 34 | Long expiresIn; 35 | 36 | @JsonProperty("id") 37 | String id; 38 | 39 | @JsonProperty("expire") 40 | Date expire; 41 | 42 | @JsonProperty("extension_Id") 43 | String extensionId; 44 | 45 | @JsonProperty("state") 46 | String state; 47 | 48 | private List scope; 49 | 50 | @JsonProperty("tokenExpireAt") 51 | Long expiresAt; 52 | 53 | 54 | } -------------------------------------------------------------------------------- /src/main/java/com/sdk/common/PlatformHeaderInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.sdk.common; 2 | 3 | import com.sdk.platform.PlatformConfig; 4 | import okhttp3.Interceptor; 5 | import okhttp3.Request; 6 | import okhttp3.Response; 7 | 8 | import java.io.IOException; 9 | import java.util.Base64; 10 | 11 | public class PlatformHeaderInterceptor implements Interceptor { 12 | 13 | private PlatformConfig platformConfig; 14 | 15 | public PlatformHeaderInterceptor(PlatformConfig platformConfig) { 16 | this.platformConfig = platformConfig; 17 | } 18 | 19 | @Override 20 | public Response intercept(Chain chain) throws IOException { 21 | String bearerToken = Base64.getEncoder().encodeToString((platformConfig.getApiKey()+":"+ platformConfig.getApiSecret()).getBytes()); 22 | Request request = chain.request() 23 | .newBuilder() 24 | .addHeader("Accept-Language", "en-IN") 25 | .addHeader("Authorization", "Basic "+ bearerToken) 26 | .addHeader("Content-Type","application/x-www-form-urlencoded") 27 | .addHeader("x-merchant-secret", platformConfig.getTopSecret()) 28 | .addHeader("x-ptl-sdk-version", "v1.0") 29 | .build(); 30 | return chain.proceed(request); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/sdk/common/AccessTokenInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.sdk.common; 2 | 3 | import okhttp3.Interceptor; 4 | import okhttp3.Request; 5 | import okhttp3.Response; 6 | 7 | import com.sdk.platform.*; 8 | 9 | import java.io.IOException; 10 | import java.util.Base64; 11 | 12 | public class AccessTokenInterceptor implements Interceptor { 13 | 14 | private PlatformConfig platformConfig; 15 | 16 | public AccessTokenInterceptor(PlatformConfig platformConfig) { 17 | this.platformConfig = platformConfig; 18 | } 19 | 20 | @Override 21 | public Response intercept(Chain chain) throws IOException { 22 | AccessTokenDto token = platformConfig.getPlatformOauthClient().getAccessTokenObj("authorization_code"); 23 | platformConfig.getPlatformOauthClient().setToken(token); 24 | okhttp3.Request original = chain.request(); 25 | okhttp3.Request.Builder builder = original.newBuilder() 26 | .addHeader("Authorization", "Bearer "+ platformConfig.getPlatformOauthClient().getToken()) 27 | .addHeader("Content-Type", "application/json") 28 | .addHeader("x-merchant-secret", platformConfig.getTopSecret()); 29 | okhttp3.Request request = builder.build(); 30 | return chain.proceed(request); 31 | } 32 | 33 | 34 | 35 | } -------------------------------------------------------------------------------- /src/main/java/com/sdk/common/Paginator.java: -------------------------------------------------------------------------------- 1 | package com.sdk.common; 2 | 3 | import lombok.Getter; 4 | import lombok.NoArgsConstructor; 5 | import lombok.Setter; 6 | 7 | @Getter 8 | @Setter 9 | @NoArgsConstructor 10 | public class Paginator { 11 | 12 | private PaginatorCallback actionCallBack; 13 | private boolean hasNext = true; 14 | private String nextId ="*"; 15 | private int pageNo=0; 16 | private String pageType; 17 | private int pageSize; 18 | 19 | 20 | public Paginator(int pageSize, String pageType) { 21 | this.pageSize = pageSize; 22 | this.pageType = pageType; 23 | if(pageType.equalsIgnoreCase("cursor")) { 24 | this.nextId = "*"; 25 | } else { 26 | this.pageNo = 0; 27 | } 28 | } 29 | 30 | public boolean hasNext(){ 31 | return hasNext; 32 | } 33 | 34 | public void setPaginator(boolean hasNext , String nextId, int pageNo) { 35 | this.hasNext = hasNext; 36 | this.nextId = nextId; 37 | this.pageNo = pageNo; 38 | } 39 | 40 | public T next() { 41 | return actionCallBack.onNext(); 42 | } 43 | 44 | public void reset() { 45 | this.hasNext = true; 46 | this.nextId = "*"; 47 | this.pageNo = 0; 48 | } 49 | 50 | public void setCallback(PaginatorCallback callback) { 51 | this.actionCallBack = callback; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/sdk/platform/PlatformConfig.java: -------------------------------------------------------------------------------- 1 | package com.sdk.platform; 2 | 3 | import com.sdk.common.AccessTokenDto; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import java.net.CookieManager; 8 | import java.net.CookieStore; 9 | import java.util.Objects; 10 | 11 | @Getter 12 | @Setter 13 | public final class PlatformConfig { 14 | private String organizationId; 15 | private String domain = "https://api.potleex0.de"; 16 | private String apiKey; 17 | private String apiSecret; 18 | private String token; 19 | private String topSecret; 20 | private Boolean useAutoRenewTimer; 21 | private CookieStore persistentCookieStore; 22 | private PlatformOauthClient platformOauthClient; 23 | 24 | public PlatformConfig(String companyId, String apiKey, String apiSecret, String apiToken, String domain, boolean useAutoRenewTimer) { 25 | if (Objects.isNull(companyId)) { 26 | throw new IllegalArgumentException("Please enter Valid Company ID"); 27 | } 28 | this.organizationId = companyId; 29 | this.apiKey = apiKey; 30 | this.apiSecret = apiToken; 31 | this.token = apiToken; 32 | this.domain = domain; 33 | this.topSecret = apiSecret; 34 | this.useAutoRenewTimer = useAutoRenewTimer; 35 | this.platformOauthClient = new PlatformOauthClient(this); 36 | } 37 | 38 | public AccessTokenDto getAccessToken() { 39 | return this.platformOauthClient.getRawToken(); 40 | } 41 | } -------------------------------------------------------------------------------- /documentation/application/SURL.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ##### [Back to Application docs](./README.md) 6 | 7 | ## Surl Methods 8 | Short URL Service 9 | * [getOriginal](#getoriginal) 10 | 11 | 12 | 13 | ## Methods with example and description 14 | 15 | 16 | ### getOriginal 17 | Get original URL 18 | 19 | 20 | 21 | 22 | ```java 23 | surl.getOriginal( hash) { 24 | //use response 25 | } 26 | ``` 27 | 28 | 29 | 30 | | Argument | Type | Required | Description | 31 | | --------- | ----- | -------- | ----------- | 32 | | hash | String | yes | This is the hash | 33 | 34 | 35 | 36 | Use this API to get original URL. 37 | 38 | *Returned Response:* 39 | 40 | 41 | 42 | 43 | [OriginalUrlSchema](#OriginalUrlSchema) 44 | 45 | Success. Returns a success message as shown below. Refer `OriginalUrlSchema` for more details. 46 | 47 | 48 | 49 | 50 |
51 |   Example: 52 | 53 | ```json 54 | 55 | ``` 56 |
57 | 58 | 59 | 60 | 61 | 62 | [Object](#Object) 63 | 64 | Success. Returns a success message as shown below. Refer `OriginalUrlSchema` for more details. 65 | 66 | 67 | 68 | 69 |
70 |   Example: 71 | 72 | ```json 73 | 74 | ``` 75 |
76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | --- 86 | 87 | 88 | 89 | ### Schemas 90 | 91 | 92 | 93 | #### [OriginalUrlSchema](#OriginalUrlSchema) 94 | 95 | | Properties | Type | Nullable | Description | 96 | | ---------- | ---- | -------- | ----------- | 97 | | originalLink | String | no | | 98 | | hash | String? | yes | | 99 | | headers | HashMap? | yes | | 100 | 101 | --- 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Settle Java 2 | 3 | 4 | Settle client for Java language 5 | [![](https://jitpack.io/v/settle-finance/java-integration-sdk.svg)](https://jitpack.io/#settle-finance/java-integration-sdk) 6 | 7 | 8 | 9 | ## Getting Started 10 | Get started with the Java Development SDK for Settle, Compatible with Java 8 11 | 12 | # Usage 13 | 14 | 1. Create Maven project and add the dependency in the pom.xml 15 | ```xml 16 | 17 | com.github.settle-finance 18 | java-integration-sdk 19 | 1.0.3 20 | 21 | ``` 22 | 23 | 2. Add it in your root pom.xml at the end of repositories: 24 | ```xml 25 | 26 | 27 | jitpack.io 28 | https://jitpack.io 29 | 30 | 31 | ``` 32 | 33 | 3. Start integrating 34 | 35 | ### Exampe Usage 36 | ```java 37 | public class Example { 38 | static PlatformConfig platformConfig; 39 | static PlatformClient platformClient; 40 | 41 | public static void main(String[] args) { 42 | try { 43 | platformConfig = new PlatformConfig( 44 | "COMPANY_ID", 45 | "API_KEY", 46 | "API_SECRET", 47 | "API_TOKEN", 48 | "https://api.settle.club", 49 | false 50 | ); 51 | 52 | platformClient = new PlatformClient(platformConfig); 53 | 54 | PlatformModels.CustomerObject customer = PlatformModels.CustomerObject.builder().countryCode("91").mobile("8898518242").uid("1").build(); 55 | 56 | PlatformModels.Device device = PlatformModels.Device.builder().ipAddress("127.0.0.1").userAgent("moz").build(); 57 | 58 | PlatformModels.Order order = PlatformModels.Order.builder().valueInPaise(100000).uid("123").build(); 59 | 60 | PlatformModels.ValidateCustomer validateCustomer = PlatformModels.ValidateCustomer.builder().customer(customer).order(order).device(device).build(); 61 | 62 | // Use this API to verify the customer. 63 | PlatformModels.VerifyCustomerSuccess verifyCustomerSuccess = platformClient.customer.validate( 64 | platformConfig.getOrganizationId(), 65 | verifyCustomer 66 | ); 67 | 68 | PlatformModels.CreateTransaction createTransaction = PlatformModels.CreateTransaction.builder().customer(customer).order(order).redirectUrl("https://www.google.com").build(); 69 | 70 | // Use this API to create transaction for user. 71 | PlatformModels.CreateTransactionSuccess createTransactionSuccess = platformClient.customer.createTransaction( 72 | "", 73 | platformConfig.getOrganizationId(), 74 | createTransaction 75 | ); 76 | 77 | } catch (Exception e) { 78 | System.out.println(e); 79 | } 80 | } 81 | } 82 | ``` 83 | 84 | ### Documentation 85 | * [Platform](documentation/platform/README.md) 86 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.github.settle-finance 8 | java-integration-sdk 9 | 1.0.3 10 | 11 | 12 | 1.8 13 | 1.8 14 | UTF-8 15 | 16 | 17 | 18 | org.springframework.boot 19 | spring-boot-starter-parent 20 | 2.7.18 21 | 22 | 23 | 24 | 25 | org.apache.maven.plugins 26 | maven-compiler-plugin 27 | 2.5.1 28 | 29 | 1.8 30 | 1.8 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | com.squareup.retrofit2 39 | retrofit 40 | 2.11.0 41 | 42 | 43 | 44 | com.squareup.retrofit2 45 | converter-jackson 46 | 2.3.0 47 | 48 | 49 | 50 | com.squareup.okhttp3 51 | logging-interceptor 52 | 3.9.0 53 | 54 | 55 | 56 | com.squareup.okhttp3 57 | okhttp-urlconnection 58 | 3.0.0-RC1 59 | 60 | 61 | 62 | org.projectlombok 63 | lombok 64 | 1.18.30 65 | 66 | 67 | 68 | 69 | commons-codec 70 | commons-codec 71 | 1.9 72 | 73 | 74 | 75 | 76 | org.apache.commons 77 | commons-lang3 78 | 3.11 79 | 80 | 81 | 82 | 83 | javax.annotation 84 | javax.annotation-api 85 | 1.3.2 86 | 87 | 88 | 89 | org.springframework.boot 90 | spring-boot-starter-web 91 | 92 | 93 | 94 | com.github.mrmike 95 | ok2curl 96 | 0.7.0 97 | 98 | 99 | 100 | com.fasterxml.jackson.core 101 | jackson-databind 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /documentation/application/REWARDS.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ##### [Back to Application docs](./README.md) 6 | 7 | ## Rewards Methods 8 | Rewards Service 9 | * [addUserReferral](#adduserreferral) 10 | * [getUserReferrals](#getuserreferrals) 11 | * [getReferralCode](#getreferralcode) 12 | 13 | 14 | 15 | ## Methods with example and description 16 | 17 | 18 | ### addUserReferral 19 | Add user referral 20 | 21 | 22 | 23 | 24 | ```java 25 | rewards.addUserReferral(body body) { 26 | //use response 27 | } 28 | ``` 29 | 30 | 31 | 32 | | Argument | Type | Required | Description | 33 | | --------- | ----- | -------- | ----------- | 34 | | body | [AddUserReferralRequest](#AddUserReferralRequest) | yes | Request body | 35 | 36 | 37 | 38 | 39 | *Returned Response:* 40 | 41 | 42 | 43 | 44 | [AddUserReferralResponse](#AddUserReferralResponse) 45 | 46 | Successful operation 47 | 48 | 49 | 50 | 51 |
52 |   Example: 53 | 54 | ```json 55 | { 56 | "success": true 57 | } 58 | ``` 59 |
60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | --- 70 | 71 | 72 | ### getUserReferrals 73 | Get user referrals 74 | 75 | 76 | 77 | 78 | ```java 79 | rewards.getUserReferrals() { 80 | //use response 81 | } 82 | ``` 83 | 84 | 85 | 86 | 87 | 88 | 89 | *Returned Response:* 90 | 91 | 92 | 93 | 94 | [UserReferralsResponse](#UserReferralsResponse) 95 | 96 | Successful operation 97 | 98 | 99 | 100 | 101 |
102 |   Example: 103 | 104 | ```json 105 | { 106 | "referrals": [ 107 | { 108 | "name": "John Doe", 109 | "mobile": "86******35", 110 | "registeredOn": "2022-11-03T13:22:22.561Z", 111 | "isVerified": false 112 | } 113 | ], 114 | "totalCount": 1, 115 | "verifiedCount": 0 116 | } 117 | ``` 118 |
119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | --- 129 | 130 | 131 | ### getReferralCode 132 | Get user referral code 133 | 134 | 135 | 136 | 137 | ```java 138 | rewards.getReferralCode() { 139 | //use response 140 | } 141 | ``` 142 | 143 | 144 | 145 | 146 | 147 | 148 | *Returned Response:* 149 | 150 | 151 | 152 | 153 | [UserReferralCodeResponse](#UserReferralCodeResponse) 154 | 155 | Successful operation 156 | 157 | 158 | 159 | 160 |
161 |   Example: 162 | 163 | ```json 164 | { 165 | "referralCode": "4WW40IW", 166 | "referralLink": "https://www.potlee.co.in/r/4WW40IW", 167 | "referralMessage": "Join Potlee using my referral link https://www.potlee.co.in/r/4WW40IW", 168 | "isEligible": true, 169 | "hasBeenReferred": false 170 | } 171 | ``` 172 |
173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | --- 183 | 184 | 185 | 186 | ### Schemas 187 | 188 | 189 | 190 | #### [UserReferralsResponse](#UserReferralsResponse) 191 | 192 | | Properties | Type | Nullable | Description | 193 | | ---------- | ---- | -------- | ----------- | 194 | | totalCount | Integer | no | | 195 | | verifiedCount | Integer | no | | 196 | | referrals | ArrayList<[UserReferrals](#UserReferrals)> | no | | 197 | | headers | HashMap? | yes | | 198 | 199 | --- 200 | 201 | 202 | 203 | 204 | #### [UserReferrals](#UserReferrals) 205 | 206 | | Properties | Type | Nullable | Description | 207 | | ---------- | ---- | -------- | ----------- | 208 | | name | String? | yes | | 209 | | mobile | String? | yes | | 210 | | registeredOn | String | no | | 211 | | isVerified | Boolean | no | | 212 | 213 | --- 214 | 215 | 216 | 217 | 218 | #### [UserReferralCodeResponse](#UserReferralCodeResponse) 219 | 220 | | Properties | Type | Nullable | Description | 221 | | ---------- | ---- | -------- | ----------- | 222 | | referralCode | String | no | | 223 | | referralLink | String | no | | 224 | | isEligible | Boolean | no | | 225 | | hasBeenReferred | Boolean | no | | 226 | | referralMessage | String | no | | 227 | | headers | HashMap? | yes | | 228 | 229 | --- 230 | 231 | 232 | 233 | 234 | #### [AddUserReferralRequest](#AddUserReferralRequest) 235 | 236 | | Properties | Type | Nullable | Description | 237 | | ---------- | ---- | -------- | ----------- | 238 | | referralCode | String | no | | 239 | 240 | --- 241 | 242 | 243 | 244 | 245 | #### [AddUserReferralResponse](#AddUserReferralResponse) 246 | 247 | | Properties | Type | Nullable | Description | 248 | | ---------- | ---- | -------- | ----------- | 249 | | success | Boolean? | yes | | 250 | | headers | HashMap? | yes | | 251 | 252 | --- 253 | 254 | 255 | 256 | -------------------------------------------------------------------------------- /documentation/application/CONTENT.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ##### [Back to Application docs](./README.md) 6 | 7 | ## Content Methods 8 | Content Service 9 | * [checkForUpdates](#checkforupdates) 10 | 11 | 12 | 13 | ## Methods with example and description 14 | 15 | 16 | ### checkForUpdates 17 | Check for app updates 18 | 19 | 20 | 21 | 22 | ```java 23 | content.checkForUpdates() { 24 | //use response 25 | } 26 | ``` 27 | 28 | 29 | 30 | 31 | 32 | 33 | *Returned Response:* 34 | 35 | 36 | 37 | 38 | [AppUpdateResponse](#AppUpdateResponse) 39 | 40 | Successful operation 41 | 42 | 43 | 44 | 45 |
46 |   Example: 47 | 48 | ```json 49 | { 50 | "available": true, 51 | "type": "HARD", 52 | "version": "1.0.3", 53 | "title": "A new update is available", 54 | "description": "Please update your app", 55 | "releasedOn": "2022-11-14", 56 | "appLink": "https://apps.apple.com/us/app/potlee/id6444611798" 57 | } 58 | ``` 59 |
60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | --- 70 | 71 | 72 | 73 | ### Schemas 74 | 75 | 76 | 77 | #### [AppUpdateResponse](#AppUpdateResponse) 78 | 79 | | Properties | Type | Nullable | Description | 80 | | ---------- | ---- | -------- | ----------- | 81 | | available | Boolean | no | | 82 | | type | String? | yes | | 83 | | version | String? | yes | | 84 | | title | String | no | | 85 | | description | String | no | | 86 | | releasedOn | String? | yes | | 87 | | appLink | String? | yes | | 88 | 89 | --- 90 | 91 | 92 | 93 | 94 | #### [CreateVersionRequest](#CreateVersionRequest) 95 | 96 | | Properties | Type | Nullable | Description | 97 | | ---------- | ---- | -------- | ----------- | 98 | | status | String | no | | 99 | | version | String | no | | 100 | | additionalNotes | String? | yes | | 101 | | title | String? | yes | | 102 | | description | String? | yes | | 103 | | releasedOn | String? | yes | | 104 | 105 | --- 106 | 107 | 108 | 109 | 110 | #### [UpdateVersionRequest](#UpdateVersionRequest) 111 | 112 | | Properties | Type | Nullable | Description | 113 | | ---------- | ---- | -------- | ----------- | 114 | | additionalNotes | String? | yes | | 115 | | status | String | no | | 116 | | title | String? | yes | | 117 | | description | String? | yes | | 118 | | releasedOn | String? | yes | | 119 | 120 | --- 121 | 122 | 123 | 124 | 125 | #### [CreateVersionResponse](#CreateVersionResponse) 126 | 127 | | Properties | Type | Nullable | Description | 128 | | ---------- | ---- | -------- | ----------- | 129 | | additionalNotes | String? | yes | | 130 | | status | String | no | | 131 | | version | String | no | | 132 | | title | String? | yes | | 133 | | description | String? | yes | | 134 | | releasedOn | String | no | | 135 | | updatedAt | String | no | | 136 | | createdAt | String | no | | 137 | 138 | --- 139 | 140 | 141 | 142 | 143 | #### [VersionResponse](#VersionResponse) 144 | 145 | | Properties | Type | Nullable | Description | 146 | | ---------- | ---- | -------- | ----------- | 147 | | additionalNotes | String? | yes | | 148 | | status | String | no | | 149 | | version | String | no | | 150 | | title | String? | yes | | 151 | | description | String? | yes | | 152 | | releasedOn | String | no | | 153 | | updatedAt | String | no | | 154 | | createdAt | String | no | | 155 | 156 | --- 157 | 158 | 159 | 160 | 161 | #### [GetVersionsResponseExample](#GetVersionsResponseExample) 162 | 163 | | Properties | Type | Nullable | Description | 164 | | ---------- | ---- | -------- | ----------- | 165 | | versions | ArrayList<[VersionResponse](#VersionResponse)>? | yes | | 166 | 167 | --- 168 | 169 | 170 | 171 | 172 | #### [GenerateSignedUrlRequest](#GenerateSignedUrlRequest) 173 | 174 | | Properties | Type | Nullable | Description | 175 | | ---------- | ---- | -------- | ----------- | 176 | | provider | String? | yes | The name of the storage provider (e.g., 'gcp') to be used. | 177 | | fileName | String? | yes | The name of the file for which the signed URL is generated. File name will be auto generated if not provided. | 178 | | filePath | String? | yes | The path within the storage where the file is located or will be stored. File will be uploaded in root of bucket if path is not provided. | 179 | | fileUrl | String? | yes | The URL of the file to be downloaded. This is only allowed if the action is 'download'. | 180 | | action | String | no | The action that the signed URL will allow, such as 'upload' or 'download'. | 181 | | access | String? | yes | The access level for the file (e.g., 'publicRead', 'private'). | 182 | | expires | Double? | yes | The expiration time for the signed URL in milliseconds. If not provided, a default value is used. | 183 | 184 | --- 185 | 186 | 187 | 188 | 189 | #### [SignedDetails](#SignedDetails) 190 | 191 | | Properties | Type | Nullable | Description | 192 | | ---------- | ---- | -------- | ----------- | 193 | | provider | String | no | The cloud provider where the file is stored. | 194 | | signedUrl | String | no | The signed URL that allows access or actions on the specified file. | 195 | 196 | --- 197 | 198 | 199 | 200 | 201 | #### [GenerateSignedUrlResponse](#GenerateSignedUrlResponse) 202 | 203 | | Properties | Type | Nullable | Description | 204 | | ---------- | ---- | -------- | ----------- | 205 | | fileUrl | String? | yes | The URL of the uploaded file. | 206 | | signedDetails | [SignedDetails](#SignedDetails) | no | | 207 | 208 | --- 209 | 210 | 211 | 212 | 213 | #### [ErrorResponse](#ErrorResponse) 214 | 215 | | Properties | Type | Nullable | Description | 216 | | ---------- | ---- | -------- | ----------- | 217 | | message | String? | yes | | 218 | | info | String? | yes | | 219 | | code | String? | yes | | 220 | | requestId | String? | yes | | 221 | | meta | HashMap? | yes | | 222 | 223 | --- 224 | 225 | 226 | 227 | -------------------------------------------------------------------------------- /src/main/java/com/sdk/common/RetrofitServiceFactory.java: -------------------------------------------------------------------------------- 1 | package com.sdk.common; 2 | 3 | import okhttp3.*; 4 | import okhttp3.internal.JavaNetCookieJar; 5 | import okhttp3.logging.HttpLoggingInterceptor; 6 | import retrofit2.Retrofit; 7 | import retrofit2.converter.jackson.JacksonConverterFactory; 8 | 9 | import javax.net.ssl.SSLContext; 10 | import javax.net.ssl.SSLSocketFactory; 11 | import javax.net.ssl.TrustManager; 12 | import javax.net.ssl.X509TrustManager; 13 | import java.net.CookieManager; 14 | import java.net.CookiePolicy; 15 | import java.net.CookieStore; 16 | import java.security.cert.CertificateException; 17 | import java.time.Duration; 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | import java.util.Map; 21 | import java.util.Objects; 22 | import java.util.concurrent.TimeUnit; 23 | import com.moczul.ok2curl.CurlInterceptor; 24 | 25 | 26 | /** Service Generator class for Retrofit communication Depends on baseUrl property */ 27 | public class RetrofitServiceFactory { 28 | 29 | private String baseURL; 30 | 31 | private Retrofit.Builder builder; 32 | 33 | private Retrofit retrofit; 34 | 35 | private OkHttpClient.Builder httpClient; 36 | 37 | private FDKLogger fdkLogger; 38 | 39 | private HttpLoggingInterceptor logging; 40 | 41 | private CurlInterceptor ok2CurlInterceptor; 42 | 43 | public RetrofitServiceFactory() { 44 | baseURL = "http://localhost:8080"; 45 | builder = 46 | new Retrofit.Builder() 47 | .baseUrl(baseURL) 48 | .addConverterFactory(JacksonConverterFactory.create()); 49 | retrofit = builder.build(); 50 | fdkLogger = new FDKLogger(); 51 | httpClient = new OkHttpClient.Builder(); 52 | logging = new HttpLoggingInterceptor(fdkLogger).setLevel(HttpLoggingInterceptor.Level.BODY); 53 | ok2CurlInterceptor = new CurlInterceptor(s ->System.out.println(s)); 54 | } 55 | 56 | public S createService(String baseUrl, Class serviceClass, List interceptorList) { 57 | return createService(baseUrl, serviceClass, interceptorList, null); 58 | } 59 | 60 | /** 61 | * This method generates retrofit Service call object 62 | * 63 | * @param baseUrl the base url for retrofit 64 | * @param serviceClass the class call object which needs to be returned 65 | * @return the service class call object 66 | */ 67 | public S createService(String baseUrl, Class serviceClass, List interceptorList, CookieStore cookieStore) { 68 | setApiBaseUrl(baseUrl); 69 | if (!httpClient.interceptors().contains(logging)) { 70 | httpClient.addInterceptor(logging); 71 | } 72 | if(!interceptorList.contains(ok2CurlInterceptor)){ 73 | interceptorList.add(ok2CurlInterceptor); 74 | } 75 | builder.client(getUnsafeOkHttpClient(interceptorList, cookieStore)); 76 | retrofit = builder.build(); 77 | return retrofit.create(serviceClass); 78 | } 79 | 80 | private static OkHttpClient getUnsafeOkHttpClient(List interceptorList, CookieStore cookieStore) { 81 | try { 82 | // Create a trust manager that does not validate certificate chains 83 | final TrustManager[] trustAllCerts = 84 | new TrustManager[] { 85 | new X509TrustManager() { 86 | @Override 87 | public void checkClientTrusted( 88 | java.security.cert.X509Certificate[] chain, String authType) 89 | throws CertificateException {} 90 | 91 | @Override 92 | public void checkServerTrusted( 93 | java.security.cert.X509Certificate[] chain, String authType) 94 | throws CertificateException {} 95 | 96 | @Override 97 | public java.security.cert.X509Certificate[] getAcceptedIssuers() { 98 | return new java.security.cert.X509Certificate[] {}; 99 | } 100 | } 101 | }; 102 | 103 | // Install the all-trusting trust manager 104 | final SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); 105 | sslContext.init(null, trustAllCerts, new java.security.SecureRandom()); 106 | // Create an ssl socket factory with our all-trusting manager 107 | final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory(); 108 | 109 | OkHttpClient.Builder builder = new OkHttpClient.Builder(); 110 | builder.sslSocketFactory(sslSocketFactory, (X509TrustManager) trustAllCerts[0]); 111 | builder.hostnameVerifier((hostname, session) -> true); 112 | if(!interceptorList.isEmpty()) { 113 | interceptorList.forEach(builder::addInterceptor); 114 | } 115 | CookieJar cookieJar = addCookie(cookieStore); 116 | if(Objects.nonNull(cookieJar)) { 117 | builder.cookieJar(cookieJar); 118 | } 119 | builder.readTimeout(Duration.ofMinutes(Constants.READ_TIMEOUT).toMinutes(), TimeUnit.MINUTES); 120 | builder.connectTimeout(Duration.ofSeconds(Constants.CONNECT_TIMEOUT).getSeconds(), TimeUnit.MINUTES); 121 | builder.writeTimeout(Duration.ofSeconds(Constants.WRITE_TIMEOUT).getSeconds(), TimeUnit.MINUTES); 122 | builder.connectionPool( 123 | new ConnectionPool(Constants.IDLE_CONNECTION, Constants.KEEP_ALIVE, TimeUnit.MINUTES)); 124 | return builder.build(); 125 | } catch (Exception e) { 126 | throw new FDKError(e.getMessage()); 127 | } 128 | } 129 | 130 | private static CookieJar addCookie(CookieStore cookieStore) { 131 | if(Objects.nonNull(cookieStore)) { 132 | CookieManager cookieManager = new CookieManager(cookieStore, CookiePolicy.ACCEPT_ALL); 133 | return new JavaNetCookieJar(cookieManager); 134 | } 135 | return null; 136 | } 137 | 138 | public S getInstance(String baseUrl, Class serviceClass) { 139 | return getInstance(baseUrl, serviceClass, null); 140 | } 141 | 142 | /** 143 | * This method generates retrofit Service call object 144 | * 145 | * @param baseUrl the base url for retrofit 146 | * @param serviceClass the class call object which needs to be returned 147 | * @return the service class call object 148 | */ 149 | public S getInstance(String baseUrl, Class serviceClass, CookieStore cookieStore) { 150 | setApiBaseUrl(baseUrl); 151 | List interceptorList = new ArrayList<>(); 152 | interceptorList.add(new RequestSignerInterceptor()); 153 | if (!interceptorList.contains(logging)) { 154 | interceptorList.add(logging); 155 | } 156 | if(!interceptorList.contains(ok2CurlInterceptor)){ 157 | interceptorList.add(ok2CurlInterceptor); 158 | } 159 | builder.client(getUnsafeOkHttpClient(interceptorList, cookieStore)); 160 | retrofit = builder.build(); 161 | return retrofit.create(serviceClass); 162 | } 163 | 164 | private void setApiBaseUrl(String baseUrl) { 165 | baseURL = baseUrl; 166 | builder = 167 | new Retrofit.Builder() 168 | .addConverterFactory(JacksonConverterFactory.create()) 169 | .baseUrl(baseURL); 170 | } 171 | 172 | interface Constants { 173 | int READ_TIMEOUT = 15; 174 | int CONNECT_TIMEOUT = 15; 175 | int WRITE_TIMEOUT = 15; 176 | int KEEP_ALIVE = 10; 177 | int IDLE_CONNECTION = 0; 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /src/main/java/com/sdk/platform/PlatformApiList.java: -------------------------------------------------------------------------------- 1 | package com.sdk.platform; 2 | 3 | import retrofit2.http.*; 4 | import retrofit2.Call; 5 | import java.util.*; 6 | 7 | 8 | interface CustomerApiList { 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | @POST ("/service/integration/user/authentication/{organizationId}/validate-customer") 17 | Call validate(@Path("organizationId") String organizationId ,@Body PlatformModels.ValidateCustomer payload); 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | @POST ("/service/integration/user/authentication/{organizationId}/transaction") 29 | Call createTransaction(@Path("organizationId") String organizationId ,@Body PlatformModels.CreateTransaction payload); 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | @POST ("/service/integration/user/authentication/{organizationId}/account/link") 38 | Call link(@Path("organizationId") String organizationId ,@Body PlatformModels.LinkAccount payload); 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | @POST ("/service/integration/user/authentication/{organizationId}/account/unlink") 47 | Call unlink(@Path("organizationId") String organizationId ,@Body PlatformModels.UnlinkAccount payload); 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | @POST ("/service/integration/user/authentication/{organizationId}/refund") 56 | Call refund(@Path("organizationId") String organizationId ,@Body PlatformModels.Refund payload); 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | @GET ("/service/integration/user/authentication/{organizationId}/refund/status") 71 | Call refundStatus(@Path("organizationId") String organizationId , @Query("refundId") String refundId , @Query("orderId") String orderId ); 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | @POST ("/service/integration/user/authentication/{organizationId}/schemes") 80 | Call getSchemes(@Path("organizationId") String organizationId ,@Body PlatformModels.GetSchemesRequest payload); 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | @POST ("/service/integration/user/authentication/{organizationId}/eligibility") 89 | Call checkEligibility(@Path("organizationId") String organizationId ,@Body PlatformModels.CheckEligibilityRequest payload); 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | @POST ("/service/integration/user/authentication/{organizationId}/repayment-link") 98 | Call getRepaymentLink(@Path("organizationId") String organizationId ,@Body PlatformModels.RepaymentRequest payload); 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | @GET ("/service/integration/user/authentication/{organizationId}/users") 119 | Call getAllCustomers(@Path("organizationId") String organizationId , @Query("page") Integer page , @Query("limit") Integer limit , @Query("name") String name , @Query("mobile") String mobile ); 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | @POST ("/service/integration/user/authentication/{organizationId}/vintage") 128 | Call addVintageData(@Path("organizationId") String organizationId ,@Body PlatformModels.VintageData payload); 129 | 130 | } 131 | 132 | interface CreditApiList { 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | @GET ("/service/integration/credit/credit/{organizationId}/orders/{orderId}/status") 144 | Call getOrderStatus(@Path("organizationId") String organizationId , @Path("orderId") String orderId ); 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | @POST ("/service/integration/credit/credit/{organizationId}/{lenderSlug}/plans") 156 | Call getEligiblePlans(@Path("organizationId") String organizationId , @Path("lenderSlug") String lenderSlug ,@Body PlatformModels.EligiblePlansRequest payload); 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | @POST ("/service/integration/credit/orders/organization/{organizationId}/delivery-updates") 165 | Call updateOrderDeliveryStatus(@Path("organizationId") String organizationId ,@Body PlatformModels.OrderDeliveryUpdatesBody payload); 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | @GET ("/service/integration/credit/summary/organization/{organizationId}/transactions") 204 | Call getTransactions(@Path("organizationId") String organizationId , @Query("mobile") String mobile , @Query("countryCode") String countryCode , @Query("page") Integer page , @Query("limit") Integer limit , @Query("orderId") String orderId , @Query("transactionId") String transactionId , @Query("type") Object type , @Query("status") Object status , @Query("onlySelf") Boolean onlySelf , @Query("granularity") String granularity ); 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | @GET ("/service/integration/credit/summary/organization/{organizationId}/settled/transactions") 231 | Call getSettledTransactions(@Path("organizationId") String organizationId , @Query("page") Integer page , @Query("limit") Integer limit , @Query("orderId") String orderId , @Query("transactionId") String transactionId , @Query("startDate") String startDate , @Query("endDate") String endDate ); 232 | 233 | } 234 | 235 | interface MultiKycApiList { 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | @GET ("/service/integration/kyc-onboarding/bre/{organizationId}/approved-lenders") 244 | Call approvedLenders(@Path("organizationId") Object organizationId ); 245 | 246 | } 247 | 248 | interface MerchantApiList { 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | @POST ("/service/integration/staff/authentication/oauth/{organizationId}/authorize") 257 | Call getAccessToken(@Path("organizationId") String organizationId ); 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | @POST ("/service/integration/staff/authentication/oauth/{organizationId}/token") 266 | Call renewAccessToken(@Path("organizationId") String organizationId ,@Body PlatformModels.RefreshTokenRequest payload); 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | @POST ("/service/integration/staff/authentication/oauth/{organizationId}/validate-credentials") 275 | Call validateCredentials(@Path("organizationId") String organizationId ); 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | @POST ("/service/integration/staff/organization/{organizationId}/api-hook") 284 | Call updateWebhook(@Path("organizationId") String organizationId ,@Body PlatformModels.UpdateApiHook payload); 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | @GET ("/service/integration/staff/organization/{organizationId}/api-hook") 293 | Call getWebhook(@Path("organizationId") String organizationId ); 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | @GET ("/service/integration/staff/organization/{organizationId}/webhook-category-events") 314 | Call getAllWebhookCategoriesAndEvents(@Path("organizationId") String organizationId , @Query("size") Double size , @Query("page") Double page , @Query("name") String name , @Query("slug") List slug ); 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | @GET ("/service/integration/staff/organization/{organizationId}/ip") 323 | Call getWhitelistedIp(@Path("organizationId") String organizationId ); 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | @PUT ("/service/integration/staff/organization/{organizationId}/ip") 332 | Call whitelistIp(@Path("organizationId") String organizationId ,@Body PlatformModels.AddOrganizationIpDetails payload); 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | @DELETE ("/service/integration/staff/organization/{organizationId}/ip") 341 | Call removeWhitelistedIp(@Path("organizationId") String organizationId ,@Body PlatformModels.DeleteOrganizationIpDetails payload); 342 | 343 | } 344 | 345 | interface PaymentsApiList { 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | @GET ("/service/integration/payments/repayment/{mobile}/{organizationId}/outstanding") 360 | Call getUserCreditSummary(@Path("mobile") String mobile , @Path("organizationId") String organizationId , @Query("lenderSlugs") List lenderSlugs ); 361 | 362 | } 363 | -------------------------------------------------------------------------------- /src/main/java/com/sdk/common/RequestSigner.java: -------------------------------------------------------------------------------- 1 | package com.sdk.common; 2 | 3 | import okhttp3.HttpUrl; 4 | import okhttp3.Request; 5 | import okhttp3.Request.Builder; 6 | import okio.Buffer; 7 | import org.apache.commons.codec.binary.Hex; 8 | import org.springframework.http.HttpStatus; 9 | import org.springframework.util.ObjectUtils; 10 | import org.springframework.web.client.HttpClientErrorException; 11 | import org.springframework.web.client.HttpServerErrorException; 12 | import java.io.UnsupportedEncodingException; 13 | import javax.crypto.Mac; 14 | import javax.crypto.spec.SecretKeySpec; 15 | import java.io.IOException; 16 | import java.math.BigInteger; 17 | import java.net.URLDecoder; 18 | import java.net.URLEncoder; 19 | import java.nio.charset.StandardCharsets; 20 | import java.security.MessageDigest; 21 | import java.text.SimpleDateFormat; 22 | import java.util.*; 23 | import java.util.concurrent.atomic.AtomicReference; 24 | import java.util.regex.Matcher; 25 | import java.util.regex.Pattern; 26 | import lombok.extern.slf4j.Slf4j; 27 | 28 | @Slf4j 29 | public class RequestSigner { 30 | 31 | private Request request; 32 | private Request updatedReq; 33 | private String nowDateTime; 34 | private boolean signQuery; 35 | 36 | static final List HEADERS_TO_IGNORE = Arrays.asList("authorization", "connection", "x-amzn-trace-id", 37 | "user-agent", "expect", "presigned-expires", "range"); 38 | 39 | static final List HEADERS_TO_INCLUDE = Arrays.asList("x-ptl-.*", "host"); 40 | 41 | public RequestSigner(Request request) { 42 | this.request = request; 43 | } 44 | 45 | public Request sign(boolean signQuery) { 46 | this.signQuery = signQuery; 47 | updatedReq = prepareRequest(); 48 | String topSecret = request.header("x-merchant-secret"); 49 | System.out.println("Signing request:" + topSecret); 50 | String sign = signature(topSecret); 51 | try { 52 | if (this.signQuery) { 53 | HttpUrl httpUrl = updatedReq.url().newBuilder().addQueryParameter("x-ptl-signature", sign) 54 | .build(); 55 | updatedReq = updatedReq.newBuilder().url(httpUrl).build(); 56 | } else { 57 | updatedReq = updatedReq.newBuilder().header("x-ptl-signature", sign).build(); 58 | } 59 | // Remove the "x-merchant-secret" header 60 | this.updatedReq = this.updatedReq.newBuilder().removeHeader("x-merchant-secret").build(); 61 | 62 | } catch (Exception e) { 63 | e.getStackTrace(); 64 | } 65 | return updatedReq; 66 | } 67 | 68 | private Request prepareRequest() { 69 | Builder newReqBuilder = request.newBuilder(); 70 | if (signQuery) { 71 | HttpUrl httpUrl = 72 | request.url().newBuilder().addQueryParameter("x-ptl-date", getDateTime()).build(); 73 | newReqBuilder.url(httpUrl); 74 | }else { 75 | newReqBuilder.header("x-ptl-date", getDateTime()); 76 | } 77 | newReqBuilder.header("host", request.url().host()); 78 | return newReqBuilder.build(); 79 | } 80 | 81 | private String getDateTime() { 82 | if (nowDateTime == null) { 83 | TimeZone tz = TimeZone.getTimeZone("UTC"); 84 | // Quoted "Z" to indicate UTC, no timezone offset 85 | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); 86 | df.setTimeZone(tz); 87 | String nowAsISO = df.format(new Date()); 88 | nowDateTime = nowAsISO.replace("-", Fields.EMPTY_STRING).replace(Fields.COLON, Fields.EMPTY_STRING) 89 | .replace("'", Fields.EMPTY_STRING); 90 | } 91 | return nowDateTime; 92 | } 93 | 94 | private String signature(String topSecret) { 95 | String kCredentials = topSecret; 96 | String strToSign = stringToSign(); 97 | return "v1:" + hMac(kCredentials, strToSign); 98 | } 99 | 100 | private String stringToSign() { 101 | return getDateTime() + "\n" + hash(canonicalString()); 102 | } 103 | 104 | private String hMac(String key, String strToSign) { 105 | try { 106 | Mac sha256Hmac = Mac.getInstance("HmacSHA256"); 107 | sha256Hmac.init(new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "HmacSHA256")); 108 | return Hex.encodeHexString(sha256Hmac.doFinal(strToSign.getBytes(StandardCharsets.UTF_8))); 109 | } catch (Exception e) { 110 | e.getStackTrace(); 111 | throw new HttpServerErrorException(HttpStatus.EXPECTATION_FAILED, "Could not using Hmac SHA to convert"); 112 | } 113 | } 114 | 115 | private String hash(String stringToDigest) { 116 | try { 117 | MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); 118 | messageDigest.update(stringToDigest.getBytes(StandardCharsets.UTF_8)); 119 | byte[] digest = messageDigest.digest(); 120 | return String.format("%064x", new BigInteger(1, digest)); 121 | } catch (Exception e) { 122 | e.printStackTrace(); 123 | throw new HttpServerErrorException(HttpStatus.EXPECTATION_FAILED, "Could not using SHA to convert"); 124 | } 125 | } 126 | 127 | private String canonicalString() { 128 | StringBuilder canonicalRequest = new StringBuilder(); 129 | String canonicalQueryString = canonicalQueryString(); 130 | canonicalRequest.append(updatedReq.method()).append("\n"); 131 | canonicalRequest.append(canonicalPath()).append("\n"); 132 | if (!ObjectUtils.isEmpty(canonicalQueryString)) { 133 | canonicalRequest.append(canonicalQueryString); 134 | } 135 | canonicalRequest.append("\n"); 136 | canonicalRequest.append(canonicalHeaders()).append("\n").append("\n"); 137 | canonicalRequest.append(signedHeaders()).append("\n"); 138 | 139 | try (Buffer bodyBuffer = new Buffer()) { 140 | if (Objects.nonNull(updatedReq.body())) { 141 | updatedReq.body().writeTo(bodyBuffer); 142 | String body = bodyBuffer.readUtf8(); 143 | canonicalRequest.append(hash(body)); 144 | } else { 145 | canonicalRequest.append(hash(Fields.EMPTY_STRING)); 146 | } 147 | } catch (IOException e) { 148 | throw new HttpClientErrorException(HttpStatus.INTERNAL_SERVER_ERROR, "Could not append BODY"); 149 | } 150 | return canonicalRequest.toString(); 151 | } 152 | 153 | // Logic to create Query String 154 | private String canonicalQueryString() { 155 | String canonicalQueryString = Fields.EMPTY_STRING; 156 | if (updatedReq.url().querySize() > 0) { 157 | StringBuilder encodedQueryPieces = new StringBuilder(Fields.EMPTY_STRING); 158 | updatedReq.url().queryParameterNames().stream().filter(Objects::nonNull) 159 | // .map(this::encode) 160 | .sorted().forEach(params -> addQueryParam(params, encodedQueryPieces)); 161 | return encodedQueryPieces.toString(); 162 | } 163 | return canonicalQueryString; 164 | } 165 | 166 | // Logic to create Path String 167 | private String canonicalPath() { 168 | StringBuilder encodedPathPieces = new StringBuilder(); 169 | updatedReq.url().encodedPathSegments().stream().map(this::encode) 170 | .forEach(path -> encodedPathPieces.append("/").append(path)); 171 | return encodedPathPieces.toString(); 172 | } 173 | 174 | private void addQueryParam(String encodedQueryName, StringBuilder encodedQueryPieces) { 175 | try { 176 | updatedReq.url().queryParameterValues(URLDecoder.decode(encodedQueryName, StandardCharsets.UTF_8.name())).stream() 177 | .sorted().forEach(queryValue -> includeQueryValue(queryValue, encodedQueryName, encodedQueryPieces)); 178 | } catch (UnsupportedEncodingException e) { 179 | log.error("Exception in adding query param", e); 180 | } 181 | } 182 | 183 | private void includeQueryValue(String queryValue, String encodedQueryName, StringBuilder encodedQueryPieces) { 184 | String query = encodedQueryName + "=" + queryValue; 185 | if (ObjectUtils.isEmpty(encodedQueryPieces)) { 186 | encodedQueryPieces.append(query); 187 | } else { 188 | encodedQueryPieces.append("&").append(query); 189 | } 190 | } 191 | 192 | private String encode(String parameter) { 193 | try { 194 | return URLEncoder.encode(parameter, StandardCharsets.UTF_8.name()); 195 | } catch (UnsupportedEncodingException e) { 196 | // Log the exception if needed 197 | log.error("Error in encoding", e); 198 | return ""; // Return an empty string in case of an exception 199 | } 200 | } 201 | 202 | private void addHeaderValues(String headerName, StringBuilder canonicalHeader) { 203 | updatedReq.headers().values(headerName).forEach(headerValue -> { 204 | if (!ObjectUtils.isEmpty(canonicalHeader)) { 205 | canonicalHeader.append("\n"); 206 | } 207 | canonicalHeader.append(headerName).append(Fields.COLON).append(headerValue.trim()); 208 | }); 209 | } 210 | 211 | private boolean filterHeaders(String headerName) { 212 | boolean notInIgnoreHeader = !HEADERS_TO_IGNORE.contains(headerName.toLowerCase()); 213 | if (notInIgnoreHeader) { 214 | AtomicReference foundMatch = new AtomicReference<>(false); 215 | HEADERS_TO_INCLUDE.forEach(regExp -> { 216 | Pattern pattern = Pattern.compile(regExp, Pattern.CASE_INSENSITIVE); 217 | Matcher matcher = pattern.matcher(headerName); 218 | boolean result = (foundMatch.get() || matcher.matches()); 219 | foundMatch.set(result); 220 | }); 221 | return foundMatch.get(); 222 | } else { 223 | return false; 224 | } 225 | } 226 | 227 | private String canonicalHeaders() { 228 | StringBuilder canonicalHeader = new StringBuilder(); 229 | updatedReq.headers().names().stream().filter(this::filterHeaders) 230 | .forEach(header -> addHeaderValues(header, canonicalHeader)); 231 | return canonicalHeader.toString(); 232 | } 233 | 234 | private String signedHeaders() { 235 | StringBuilder headerNames = new StringBuilder(); 236 | updatedReq.headers().names().stream().filter(this::filterHeaders).sorted().forEach(headerName -> { 237 | if (!ObjectUtils.isEmpty(headerNames)) { 238 | headerNames.append(Fields.SEMI_COLON); 239 | } 240 | headerNames.append(headerName.trim()); 241 | }); 242 | return headerNames.toString(); 243 | } 244 | 245 | private interface Fields { 246 | String SEMI_COLON = ";"; 247 | String COLON = ":"; 248 | String EMPTY_STRING = ""; 249 | } 250 | } 251 | -------------------------------------------------------------------------------- /src/main/java/com/sdk/platform/PlatformOauthClient.java: -------------------------------------------------------------------------------- 1 | package com.sdk.platform; 2 | 3 | import com.sdk.common.*; 4 | import com.sdk.common.AccessResponse; 5 | import com.sdk.common.AccessTokenDto; 6 | import com.sdk.common.FDKError; 7 | import com.sdk.common.FDKTokenIssueError; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | import lombok.extern.slf4j.Slf4j; 11 | import okhttp3.Interceptor; 12 | import okhttp3.Request; 13 | import org.apache.commons.lang3.RandomStringUtils; 14 | import org.apache.commons.lang3.StringUtils; 15 | import org.springframework.util.ObjectUtils; 16 | import retrofit2.Call; 17 | import retrofit2.Response; 18 | import retrofit2.http.FieldMap; 19 | import retrofit2.http.FormUrlEncoded; 20 | import retrofit2.http.POST; 21 | import retrofit2.http.Url; 22 | 23 | import java.io.IOException; 24 | import java.util.*; 25 | import java.util.concurrent.TimeUnit; 26 | 27 | interface TokenApiList { 28 | @FormUrlEncoded 29 | @POST 30 | Call getAccessToken(@Url String slug, @FieldMap HashMap map); 31 | } 32 | 33 | @Getter 34 | @Setter 35 | @Slf4j 36 | public class PlatformOauthClient { 37 | 38 | private static final String URI = "/service/integration/staff/authentication/oauth/"; 39 | 40 | PlatformConfig config; 41 | 42 | RetrofitServiceFactory retrofitServiceFactory; 43 | 44 | String token; 45 | 46 | String refreshToken; 47 | 48 | AccessTokenDto rawToken; 49 | 50 | long tokenExpiresIn; 51 | 52 | long tokenExpiresAt; 53 | 54 | Boolean useAutoRenewTimer; 55 | 56 | PlatformOauthClient(PlatformConfig config) { 57 | this.config = config; 58 | this.refreshToken = ""; 59 | this.retrofitServiceFactory = new RetrofitServiceFactory(); 60 | this.tokenExpiresAt = 0; 61 | this.useAutoRenewTimer = Objects.nonNull( 62 | config.getUseAutoRenewTimer()) ? config.getUseAutoRenewTimer() : Boolean.TRUE; 63 | } 64 | 65 | private void getAccessToken() { 66 | if (this.useAutoRenewTimer.equals(Boolean.FALSE) && StringUtils.isNotEmpty(this.refreshToken) 67 | && isTokenExpired(120)) { 68 | try { 69 | // Check if token is about to expire in less than 2 mins. 70 | // Renew if to be expired and auto renew timer is not enabled. 71 | renewAccesstoken(); 72 | } catch (Exception e) { 73 | log.error("Exception in renewing Access Token", e); 74 | } 75 | } 76 | } 77 | 78 | // default TTL checked 0 seconds 79 | public boolean isTokenExpired(int ttl) { 80 | long currentTimestamp = (new Date()).getTime(); 81 | // Check if token is about to expire in less than 2 mins 82 | return ((tokenExpiresAt - currentTimestamp) / 1000) < ttl; 83 | } 84 | 85 | public void setToken(AccessTokenDto accessTokenDto) { 86 | this.rawToken = accessTokenDto; 87 | this.tokenExpiresIn = accessTokenDto.getExpiresIn(); 88 | this.token = accessTokenDto.getAccessToken(); 89 | this.refreshToken = ObjectUtils.isEmpty( 90 | accessTokenDto.getRefreshToken()) ? "" : accessTokenDto.getRefreshToken(); 91 | if (!ObjectUtils.isEmpty(this.refreshToken) && this.useAutoRenewTimer.equals(Boolean.TRUE)) { 92 | this.retryOAuthTokenTimer(accessTokenDto.getExpiresIn()); 93 | } 94 | } 95 | 96 | private void retryOAuthTokenTimer(long expiresIn) { 97 | try { 98 | if (expiresIn > 60) { 99 | this.renewAccesstoken(); 100 | } 101 | } catch (Exception e) { 102 | throw new FDKError(e.getMessage()); 103 | } 104 | } 105 | 106 | public String getAuthorizationURL(List scope, String redirectUri, String state, boolean isOnline) { 107 | String apiKey = config.getApiKey(); 108 | if (ObjectUtils.isEmpty(apiKey)) { 109 | throw new FDKError("API Key missing in config"); 110 | } 111 | state = StringUtils.isNotEmpty(state) ? state : getRandomState(); 112 | String accessMode = isOnline ? "online" : "offline"; 113 | String query = "client_id=" + apiKey + "&scope=" + String.join(",", scope) 114 | + "&redirect_uri=" + redirectUri + "&state=" + state + "&access_mode=" + accessMode 115 | + "&response_type=code"; 116 | 117 | String queryString = config.getDomain() + URI + config.getApiKey() + "/authorize?" + query; 118 | Request request = new Request.Builder().url(queryString) 119 | .get() 120 | .build(); 121 | request = new RequestSigner(request).sign(true); 122 | return request.url() 123 | .toString(); 124 | } 125 | 126 | private String getRandomState() { 127 | return RandomStringUtils.randomAlphanumeric(15) 128 | .toUpperCase(); 129 | } 130 | 131 | public AccessTokenDto renewAccesstoken() throws IOException { 132 | 133 | HashMap body = new HashMap<>(); 134 | body.put(Fields.GRANT_TYPE, GrantType.REFRESH_TOKEN.toString() 135 | .toLowerCase()); 136 | body.put(Fields.REFRESH_CODE, this.refreshToken); 137 | 138 | String url = config.getDomain() + URI + config.getApiKey() + "/token"; 139 | AccessTokenDto newToken = getToken(body, url); 140 | setToken(newToken); 141 | if (Objects.nonNull(newToken.getExpiresAt())) { 142 | Long tokenExpires = newToken.getExpiresAt(); 143 | newToken.setExpiresAt(tokenExpires); 144 | this.tokenExpiresAt = tokenExpires; 145 | } else { 146 | newToken.setExpiresAt((new Date()).getTime() + (this.tokenExpiresIn * 1000L)); 147 | this.tokenExpiresAt = (new Date()).getTime() + (this.tokenExpiresIn * 1000L); 148 | } 149 | 150 | return newToken; 151 | } 152 | 153 | public void verifyCallback(String authorizationCode) throws IOException { 154 | HashMap body = new HashMap<>(); 155 | body.put(Fields.GRANT_TYPE, GrantType.AUTHORIZATION_CODE.toString() 156 | .toLowerCase()); 157 | body.put(Fields.CODE, authorizationCode); 158 | String url = config.getDomain() + URI + config.getApiKey() + "/token"; 159 | AccessTokenDto newToken = getToken(body, url); 160 | setToken(newToken); 161 | if (Objects.nonNull(newToken.getExpiresAt())) { 162 | Long tokenExpires = newToken.getExpiresAt(); 163 | newToken.setExpiresAt(tokenExpires); 164 | this.tokenExpiresAt = tokenExpires; 165 | } else { 166 | newToken.setExpiresAt((new Date()).getTime() + (this.tokenExpiresIn * 1000L)); 167 | this.tokenExpiresAt = (new Date()).getTime() + (this.tokenExpiresIn * 1000L); 168 | } 169 | 170 | } 171 | 172 | public boolean isAccessTokenValid() { 173 | return !ObjectUtils.isEmpty(this.token) && this.rawToken.getExpiresIn() > 0; 174 | } 175 | 176 | public AccessTokenDto getOfflineAccessToken(String scopes, String code) { 177 | try { 178 | HashMap body = new HashMap<>(); 179 | body.put(Fields.GRANT_TYPE, GrantType.AUTHORIZATION_CODE.toString() 180 | .toLowerCase()); 181 | body.put(Fields.CODE, code); 182 | body.put(Fields.CLIENT_ID, config.getApiKey()); 183 | body.put(Fields.CLIENT_SECRET, config.getApiSecret()); 184 | body.put(Fields.SCOPE, scopes); 185 | String url = config.getDomain() + URI + config.getApiKey() + "/offline-token"; 186 | AccessTokenDto offlineToken = getOfflineToken(body, url); 187 | setToken(offlineToken); 188 | if (Objects.nonNull(offlineToken.getExpiresAt())) { 189 | Long tokenExpires = offlineToken.getExpiresAt(); 190 | offlineToken.setExpiresAt(tokenExpires); 191 | this.tokenExpiresAt = tokenExpires; 192 | } else { 193 | offlineToken.setExpiresAt((new Date()).getTime() + (this.tokenExpiresIn * 1000L)); 194 | this.tokenExpiresAt = (new Date()).getTime() + (this.tokenExpiresIn * 1000L); 195 | } 196 | 197 | return offlineToken; 198 | } catch (Exception e) { 199 | log.error("Exception in getting Offline Token", e); 200 | throw new FDKTokenIssueError(e.getMessage()); 201 | } 202 | } 203 | 204 | private AccessTokenDto getOfflineToken(HashMap body, String url) throws IOException { 205 | TokenApiList tokenApiList = generateOfflineTokenApiList(); 206 | Response response = tokenApiList.getAccessToken(url, body) 207 | .execute(); 208 | if (response.isSuccessful() && !ObjectUtils.isEmpty(response.body())) { 209 | return convertToDto(response.body()); 210 | } 211 | return new AccessTokenDto(); 212 | } 213 | 214 | private AccessTokenDto convertToDto(AccessResponse accessResponse) { 215 | AccessTokenDto accessTokenDto = new AccessTokenDto(); 216 | accessTokenDto.setAccessToken(accessResponse.getAccessToken()); 217 | accessTokenDto.setExpiresIn(accessResponse.getExpiresIn()); 218 | accessTokenDto.setCurrentUser(accessResponse.getCurrentUser()); 219 | accessTokenDto.setRefreshToken(accessResponse.getRefreshToken()); 220 | return accessTokenDto; 221 | } 222 | 223 | private AccessTokenDto getToken(HashMap body, String url) throws IOException { 224 | TokenApiList tokenApiList = generateTokenApiList(); 225 | Response response = tokenApiList.getAccessToken(url, body) 226 | .execute(); 227 | if (response.isSuccessful() && !ObjectUtils.isEmpty(response.body())) { 228 | return convertToDto(response.body()); 229 | } 230 | return new AccessTokenDto(); 231 | } 232 | 233 | private TokenApiList generateOfflineTokenApiList() { 234 | List interceptorList = new ArrayList<>(); 235 | interceptorList.add(new PlatformHeaderInterceptor(config)); 236 | interceptorList.add(new RequestSignerInterceptor()); 237 | // interceptorList.add(new ExtensionLibInterceptor(config)); 238 | return retrofitServiceFactory.createService(config.getDomain(), TokenApiList.class, interceptorList); 239 | } 240 | 241 | private TokenApiList generateTokenApiList() { 242 | List interceptorList = new ArrayList<>(); 243 | interceptorList.add(new PlatformHeaderInterceptor(config)); 244 | interceptorList.add(new RequestSignerInterceptor()); 245 | 246 | return retrofitServiceFactory.createService(config.getDomain(), TokenApiList.class, interceptorList); 247 | } 248 | 249 | public AccessTokenDto getAccessTokenObj(String grant_type, String refresh_token, String code) throws IOException{ 250 | HashMap body = new HashMap<>(); 251 | body.put(Fields.GRANT_TYPE, grant_type); 252 | if (grant_type.equalsIgnoreCase(GrantType.REFRESH_TOKEN.getMessage())) { 253 | body.put(Fields.REFRESH_CODE, refresh_token); 254 | } else if (grant_type.equalsIgnoreCase(GrantType.AUTHORIZATION_CODE.getMessage())) { 255 | // body.put(Fields.CODE, code); 256 | } 257 | return getAccessTokenDto(body); 258 | } 259 | 260 | public AccessTokenDto getAccessTokenObj(String grant_type) throws IOException{ 261 | return getAccessTokenObj(grant_type, null,null); 262 | } 263 | 264 | public void setTokenNew(AccessTokenDto accessTokenDto) { 265 | this.rawToken = accessTokenDto; 266 | this.tokenExpiresIn = accessTokenDto.getExpiresIn(); 267 | this.token = accessTokenDto.getAccessToken(); 268 | this.refreshToken = ObjectUtils.isEmpty( 269 | accessTokenDto.getRefreshToken()) ? "" : accessTokenDto.getRefreshToken(); 270 | } 271 | 272 | private AccessTokenDto getAccessTokenDto(HashMap body) throws IOException { 273 | String url = config.getDomain() + URI + config.getApiKey() + "/authorize"; 274 | AccessTokenDto newToken = getToken(body, url); 275 | if (Objects.nonNull(newToken.getExpiresAt())) { 276 | Long tokenExpires = newToken.getExpiresAt(); 277 | newToken.setExpiresAt(tokenExpires); 278 | this.tokenExpiresAt = tokenExpires; 279 | } else { 280 | newToken.setExpiresAt((new Date()).getTime() + (this.tokenExpiresIn * 1000L)); 281 | this.tokenExpiresAt = (new Date()).getTime() + (this.tokenExpiresIn * 1000L); 282 | } 283 | setTokenNew(newToken); 284 | return newToken; 285 | } 286 | 287 | @Getter 288 | enum GrantType { 289 | AUTHORIZATION_CODE("authorization_code"), 290 | REFRESH_TOKEN("refresh_token"); 291 | 292 | private String message; 293 | 294 | GrantType(String message) { 295 | this.message = message; 296 | } 297 | 298 | } 299 | 300 | interface Fields { 301 | String GRANT_TYPE = "grant_type"; 302 | String CODE = "code"; 303 | String REFRESH_CODE = "refresh_token"; 304 | String CLIENT_ID = "client_id"; 305 | String CLIENT_SECRET = "client_secret"; 306 | String SCOPE = "scope"; 307 | } 308 | } -------------------------------------------------------------------------------- /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 | 22 | ```java 23 | payments.getUserCreditSummary( mobile, lenderSlugs) { 24 | //use response 25 | } 26 | ``` 27 | 28 | 29 | 30 | | Argument | Type | Required | Description | 31 | | --------- | ----- | -------- | ----------- | 32 | | mobile | String | yes | mobile number of the user | 33 | | organizationId | String | yes | organization id of the merchant. | 34 | | lenderSlugs | List? | no | This is list of lender slugs. eg. ['cashe','liquiloans'] | 35 | 36 | 37 | 38 | This api is for getting outstanding details for the user with all the lenders. 39 | 40 | *Returned Response:* 41 | 42 | 43 | 44 | 45 | [OutstandingDetailsResponse](#OutstandingDetailsResponse) 46 | 47 | Success. Returns a JSON object as shown below. Refer `PaymentLinkResponse` for more details. 48 | 49 | 50 | 51 | 52 |
53 |   Examples: 54 | 55 | 56 |
57 |   OutstandingDetailsResponse 58 | 59 | ```json 60 | { 61 | "value": { 62 | "message": "The request has been processed successfully.", 63 | "data": { 64 | "outstandingDetails": [ 65 | { 66 | "lender": { 67 | "id": "315f60f4-1238-462c-8108-cfff9fbc400f", 68 | "name": "Bhanix Finance and Investment Limited", 69 | "slug": "cashe", 70 | "theme": { 71 | "iconUrl": "https://cdn.pixelbin.io/v2/potlee/original/public/lenders/lenderLogo/v2/512h-logo/cashe-icon.png", 72 | "logoUrl": "https://cdn.pixelbin.io/v2/potlee/original/public/lenders/lenderLogo/v2/512h-logo/cashe-logo.png" 73 | } 74 | }, 75 | "availableLimit": 40000, 76 | "creditLimit": 40000, 77 | "dueAmount": 0, 78 | "outstandingAmount": 0, 79 | "dueDate": null 80 | } 81 | ] 82 | }, 83 | "meta": { 84 | "timestamp": "2024-07-26T08:01:02.592Z", 85 | "version": "v1.0", 86 | "product": "Settle Checkout", 87 | "requestId": "048dcf5c1d4ab39a9f39e1d07c584983" 88 | } 89 | } 90 | } 91 | ``` 92 |
93 | 94 |
95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | --- 105 | 106 | 107 | 108 | ### Schemas 109 | 110 | 111 | 112 | #### [IntegrationResponseMeta](#IntegrationResponseMeta) 113 | 114 | | Properties | Type | Nullable | Description | 115 | | ---------- | ---- | -------- | ----------- | 116 | | timestamp | String | no | The timestamp when the response was generated. | 117 | | version | String | no | The version of the API. | 118 | | product | String | no | The name of the product or service. | 119 | | requestId | String? | yes | An optional request identifier. | 120 | 121 | --- 122 | 123 | 124 | 125 | 126 | #### [IntegrationResponseError](#IntegrationResponseError) 127 | 128 | | Properties | Type | Nullable | Description | 129 | | ---------- | ---- | -------- | ----------- | 130 | | code | String | no | Error code representing the type of error. | 131 | | message | String | no | A human-readable message providing more details about the error. | 132 | | exception | String | no | The exception name or type. | 133 | | field | String? | yes | The field associated with the error, if applicable. | 134 | | location | String? | yes | The location of the field, such as 'query', 'param' or 'body'. | 135 | 136 | --- 137 | 138 | 139 | 140 | 141 | #### [IntegrationSuccessResponse](#IntegrationSuccessResponse) 142 | 143 | | Properties | Type | Nullable | Description | 144 | | ---------- | ---- | -------- | ----------- | 145 | | message | String | no | A message indicating the success of the operation. | 146 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | no | | 147 | | data | HashMap | no | The data payload of the response. The structure of this object will vary depending on the specific API endpoint. | 148 | 149 | --- 150 | 151 | 152 | 153 | 154 | #### [IntegrationErrorResponse](#IntegrationErrorResponse) 155 | 156 | | Properties | Type | Nullable | Description | 157 | | ---------- | ---- | -------- | ----------- | 158 | | message | String | no | A message indicating the failure of the operation. | 159 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | no | | 160 | | errors | ArrayList<[IntegrationResponseError](#IntegrationResponseError)>? | yes | | 161 | 162 | --- 163 | 164 | 165 | 166 | 167 | #### [ErrorResponse](#ErrorResponse) 168 | 169 | | Properties | Type | Nullable | Description | 170 | | ---------- | ---- | -------- | ----------- | 171 | | message | String? | yes | | 172 | | info | String? | yes | | 173 | | code | String? | yes | | 174 | | requestId | String? | yes | | 175 | | meta | HashMap? | yes | | 176 | 177 | --- 178 | 179 | 180 | 181 | 182 | #### [RepaymentUsingNetbanking](#RepaymentUsingNetbanking) 183 | 184 | | Properties | Type | Nullable | Description | 185 | | ---------- | ---- | -------- | ----------- | 186 | | amount | Double | no | | 187 | | bankId | String | no | | 188 | | bankName | String | no | | 189 | | chargeToken | String? | yes | | 190 | | transactionId | String? | yes | | 191 | | entityMapId | String? | yes | | 192 | 193 | --- 194 | 195 | 196 | 197 | 198 | #### [RepaymentUsingNetbankingResponse](#RepaymentUsingNetbankingResponse) 199 | 200 | | Properties | Type | Nullable | Description | 201 | | ---------- | ---- | -------- | ----------- | 202 | | form | String? | yes | | 203 | | isDifferent | Boolean? | yes | | 204 | | outstanding | String? | yes | | 205 | 206 | --- 207 | 208 | 209 | 210 | 211 | #### [RepaymentUsingUPI](#RepaymentUsingUPI) 212 | 213 | | Properties | Type | Nullable | Description | 214 | | ---------- | ---- | -------- | ----------- | 215 | | amount | Double | no | | 216 | | vpa | String | no | | 217 | | chargeToken | String? | yes | | 218 | | transactionId | String? | yes | | 219 | | entityMapId | String? | yes | | 220 | 221 | --- 222 | 223 | 224 | 225 | 226 | #### [RepaymentUsingUPIResponse](#RepaymentUsingUPIResponse) 227 | 228 | | Properties | Type | Nullable | Description | 229 | | ---------- | ---- | -------- | ----------- | 230 | | isDifferent | Boolean? | yes | | 231 | | outstanding | String? | yes | | 232 | | status | String? | yes | | 233 | | intentId | String? | yes | | 234 | | transactionId | String? | yes | | 235 | | expiry | Double? | yes | | 236 | | interval | Double? | yes | | 237 | 238 | --- 239 | 240 | 241 | 242 | 243 | #### [RegisterUPIMandateRequest](#RegisterUPIMandateRequest) 244 | 245 | | Properties | Type | Nullable | Description | 246 | | ---------- | ---- | -------- | ----------- | 247 | | vpa | String? | yes | | 248 | 249 | --- 250 | 251 | 252 | 253 | 254 | #### [RegisterUPIMandateResponse](#RegisterUPIMandateResponse) 255 | 256 | | Properties | Type | Nullable | Description | 257 | | ---------- | ---- | -------- | ----------- | 258 | | transactionId | String? | yes | | 259 | | expiry | Double? | yes | | 260 | | interval | Double? | yes | | 261 | 262 | --- 263 | 264 | 265 | 266 | 267 | #### [RegisterUPIMandateStatusCheckRequest](#RegisterUPIMandateStatusCheckRequest) 268 | 269 | | Properties | Type | Nullable | Description | 270 | | ---------- | ---- | -------- | ----------- | 271 | | transactionId | String? | yes | | 272 | 273 | --- 274 | 275 | 276 | 277 | 278 | #### [RegisterMandateStatusCheckResponse](#RegisterMandateStatusCheckResponse) 279 | 280 | | Properties | Type | Nullable | Description | 281 | | ---------- | ---- | -------- | ----------- | 282 | | status | String? | yes | | 283 | 284 | --- 285 | 286 | 287 | 288 | 289 | #### [TransactionStatusRequest](#TransactionStatusRequest) 290 | 291 | | Properties | Type | Nullable | Description | 292 | | ---------- | ---- | -------- | ----------- | 293 | | intentId | String | no | | 294 | | transactionId | String | no | | 295 | 296 | --- 297 | 298 | 299 | 300 | 301 | #### [TransactionStatusResponse](#TransactionStatusResponse) 302 | 303 | | Properties | Type | Nullable | Description | 304 | | ---------- | ---- | -------- | ----------- | 305 | | success | Boolean | no | | 306 | | methodType | String? | yes | | 307 | | methodSubType | String? | yes | | 308 | | status | String? | yes | | 309 | 310 | --- 311 | 312 | 313 | 314 | 315 | #### [BankList](#BankList) 316 | 317 | | Properties | Type | Nullable | Description | 318 | | ---------- | ---- | -------- | ----------- | 319 | | bankId | String? | yes | | 320 | | bankName | String? | yes | | 321 | | rank | Double? | yes | | 322 | | popular | Boolean? | yes | | 323 | | imageUrl | String? | yes | | 324 | 325 | --- 326 | 327 | 328 | 329 | 330 | #### [PaymentOptions](#PaymentOptions) 331 | 332 | | Properties | Type | Nullable | Description | 333 | | ---------- | ---- | -------- | ----------- | 334 | | title | String? | yes | | 335 | | shortTitle | String? | yes | | 336 | | uid | String? | yes | | 337 | | imageUrl | String? | yes | | 338 | 339 | --- 340 | 341 | 342 | 343 | 344 | #### [PaymentsObject](#PaymentsObject) 345 | 346 | | Properties | Type | Nullable | Description | 347 | | ---------- | ---- | -------- | ----------- | 348 | | title | String? | yes | | 349 | | kind | String? | yes | | 350 | | options | ArrayList<[PaymentOptions](#PaymentOptions)>? | yes | | 351 | 352 | --- 353 | 354 | 355 | 356 | 357 | #### [LenderTheme](#LenderTheme) 358 | 359 | | Properties | Type | Nullable | Description | 360 | | ---------- | ---- | -------- | ----------- | 361 | | iconUrl | String | no | | 362 | | logoUrl | String | no | | 363 | 364 | --- 365 | 366 | 367 | 368 | 369 | #### [LenderDetails](#LenderDetails) 370 | 371 | | Properties | Type | Nullable | Description | 372 | | ---------- | ---- | -------- | ----------- | 373 | | slug | String | no | | 374 | | name | String | no | | 375 | | id | String | no | | 376 | | theme | [LenderTheme](#LenderTheme) | no | | 377 | 378 | --- 379 | 380 | 381 | 382 | 383 | #### [OutstandingDetail](#OutstandingDetail) 384 | 385 | | Properties | Type | Nullable | Description | 386 | | ---------- | ---- | -------- | ----------- | 387 | | status | String? | yes | | 388 | | action | Boolean? | yes | | 389 | | message | [OutstandingMessage](#OutstandingMessage)? | yes | | 390 | | credit | [UserCredit](#UserCredit)? | yes | | 391 | | dueSummary | [DueSummaryOutstanding](#DueSummaryOutstanding)? | yes | | 392 | | outstandingSummary | [OutstandingSummary](#OutstandingSummary)? | yes | | 393 | | entityMapId | String? | yes | | 394 | 395 | --- 396 | 397 | 398 | 399 | 400 | #### [OutstandingSummary](#OutstandingSummary) 401 | 402 | | Properties | Type | Nullable | Description | 403 | | ---------- | ---- | -------- | ----------- | 404 | | totalOutstanding | Double? | yes | | 405 | | totalOutstandingWithInterest | Double? | yes | | 406 | | totalOutstandingPenalty | Double? | yes | | 407 | | availableLimit | Double? | yes | | 408 | | isOverdue | Boolean? | yes | | 409 | | dueFromDate | String? | yes | | 410 | | repaymentSummary | ArrayList<[RepaymentSummaryOutstanding](#RepaymentSummaryOutstanding)>? | yes | | 411 | 412 | --- 413 | 414 | 415 | 416 | 417 | #### [DueSummaryOutstanding](#DueSummaryOutstanding) 418 | 419 | | Properties | Type | Nullable | Description | 420 | | ---------- | ---- | -------- | ----------- | 421 | | dueDate | String? | yes | | 422 | | totalDue | Double? | yes | | 423 | | totalDueWithInterest | Double? | yes | | 424 | | totalDuePenalty | Double? | yes | | 425 | | dueTransactions | ArrayList<[DueTransactionsOutstanding](#DueTransactionsOutstanding)>? | yes | | 426 | | minAmntDue | Double? | yes | | 427 | 428 | --- 429 | 430 | 431 | 432 | 433 | #### [OutstandingMessage](#OutstandingMessage) 434 | 435 | | Properties | Type | Nullable | Description | 436 | | ---------- | ---- | -------- | ----------- | 437 | | dueMessage | String? | yes | | 438 | | backgroundColor | String? | yes | | 439 | | textColor | String? | yes | | 440 | | isFlexiRepayEnabled | Boolean? | yes | | 441 | 442 | --- 443 | 444 | 445 | 446 | 447 | #### [UserCredit](#UserCredit) 448 | 449 | | Properties | Type | Nullable | Description | 450 | | ---------- | ---- | -------- | ----------- | 451 | | availableLimit | Double? | yes | | 452 | | approvedLimit | Double? | yes | | 453 | | isEligibleToDrawdown | Boolean? | yes | | 454 | 455 | --- 456 | 457 | 458 | 459 | 460 | #### [DueTransactionsOutstanding](#DueTransactionsOutstanding) 461 | 462 | | Properties | Type | Nullable | Description | 463 | | ---------- | ---- | -------- | ----------- | 464 | | loanRequestNo | String? | yes | | 465 | | merchantCategory | String? | yes | | 466 | | installmentAmountWithInterest | Double? | yes | | 467 | | installmentAmount | Double? | yes | | 468 | | dueAmount | Double? | yes | | 469 | | loanType | String? | yes | | 470 | | installmentNo | String? | yes | | 471 | | installmentDueDate | String? | yes | | 472 | | isPastDue | Boolean? | yes | | 473 | | isPenaltyCharged | Boolean? | yes | | 474 | | penaltyAmount | Double? | yes | | 475 | | noOfDaysPenaltyCharged | Integer? | yes | | 476 | | daysDifference | Integer? | yes | | 477 | | lenderTransactionId | String? | yes | | 478 | 479 | --- 480 | 481 | 482 | 483 | 484 | #### [RepaymentSummaryOutstanding](#RepaymentSummaryOutstanding) 485 | 486 | | Properties | Type | Nullable | Description | 487 | | ---------- | ---- | -------- | ----------- | 488 | | loanRequestNo | String? | yes | | 489 | | loanType | String? | yes | | 490 | | merchantCategory | String? | yes | | 491 | | isBbillingTransaction | Boolean? | yes | | 492 | | totalInstallmentAmount | Integer? | yes | | 493 | | totalInstallmentAmountWithInterest | Integer? | yes | | 494 | | outstandingDetails | ArrayList<[OutstandingDetailsRepayment](#OutstandingDetailsRepayment)>? | yes | | 495 | 496 | --- 497 | 498 | 499 | 500 | 501 | #### [OutstandingDetailsRepayment](#OutstandingDetailsRepayment) 502 | 503 | | Properties | Type | Nullable | Description | 504 | | ---------- | ---- | -------- | ----------- | 505 | | installmentAmountWithInterest | Double? | yes | | 506 | | installmentAmount | Double? | yes | | 507 | | dueAmount | Double? | yes | | 508 | | installmentNo | String? | yes | | 509 | | installmentDueDate | String? | yes | | 510 | | isPastDue | Boolean? | yes | | 511 | | loanType | String? | yes | | 512 | | isPenaltyCharged | Boolean? | yes | | 513 | | penaltyAmount | Integer? | yes | | 514 | | noOfDaysPenaltyCharged | Integer? | yes | | 515 | | lenderTransactionId | String? | yes | | 516 | 517 | --- 518 | 519 | 520 | 521 | 522 | #### [PaymentOptionsResponse](#PaymentOptionsResponse) 523 | 524 | | Properties | Type | Nullable | Description | 525 | | ---------- | ---- | -------- | ----------- | 526 | | paymentOptions | ArrayList<[PaymentsObject](#PaymentsObject)>? | yes | | 527 | 528 | --- 529 | 530 | 531 | 532 | 533 | #### [CheckEMandateStatusRequest](#CheckEMandateStatusRequest) 534 | 535 | | Properties | Type | Nullable | Description | 536 | | ---------- | ---- | -------- | ----------- | 537 | | orderId | String? | yes | | 538 | | paymentId | String? | yes | | 539 | | scheduledEnd | String? | yes | | 540 | | ruleAmountValue | String? | yes | | 541 | 542 | --- 543 | 544 | 545 | 546 | 547 | #### [AutoPayStatusResponse](#AutoPayStatusResponse) 548 | 549 | | Properties | Type | Nullable | Description | 550 | | ---------- | ---- | -------- | ----------- | 551 | | status | String? | yes | | 552 | 553 | --- 554 | 555 | 556 | 557 | 558 | #### [OutstandingData](#OutstandingData) 559 | 560 | | Properties | Type | Nullable | Description | 561 | | ---------- | ---- | -------- | ----------- | 562 | | lenderDetails | [LenderDetails](#LenderDetails)? | yes | | 563 | | availableLimit | Double | no | | 564 | | creditLimit | Double | no | | 565 | | dueAmount | Double? | yes | | 566 | | outstandingAmount | Double? | yes | | 567 | | dueDate | String? | yes | | 568 | 569 | --- 570 | 571 | 572 | 573 | 574 | #### [OutstandingDetailsData](#OutstandingDetailsData) 575 | 576 | | Properties | Type | Nullable | Description | 577 | | ---------- | ---- | -------- | ----------- | 578 | | outstandingDetails | ArrayList<[OutstandingData](#OutstandingData)> | no | | 579 | 580 | --- 581 | 582 | 583 | 584 | 585 | #### [OutstandingDetailsResponse](#OutstandingDetailsResponse) 586 | 587 | | Properties | Type | Nullable | Description | 588 | | ---------- | ---- | -------- | ----------- | 589 | | message | String | no | | 590 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | no | | 591 | | data | [OutstandingDetailsData](#OutstandingDetailsData) | no | | 592 | 593 | --- 594 | 595 | 596 | 597 | 598 | #### [VerifyUPIRequest](#VerifyUPIRequest) 599 | 600 | | Properties | Type | Nullable | Description | 601 | | ---------- | ---- | -------- | ----------- | 602 | | vpa | String | no | The Virtual Payment Address (VPA) for UPI. | 603 | | lenderSlug | String? | yes | The lender slug associated with the request. Optional parameter. | 604 | 605 | --- 606 | 607 | 608 | 609 | 610 | #### [UPIValidationSuccessResponse](#UPIValidationSuccessResponse) 611 | 612 | | Properties | Type | Nullable | Description | 613 | | ---------- | ---- | -------- | ----------- | 614 | | status | String? | yes | | 615 | | name | String? | yes | | 616 | 617 | --- 618 | 619 | 620 | 621 | -------------------------------------------------------------------------------- /src/main/java/com/sdk/platform/PlatformService.java: -------------------------------------------------------------------------------- 1 | package com.sdk.platform; 2 | 3 | import com.sdk.common.*; 4 | import okhttp3.Interceptor; 5 | import retrofit2.Response; 6 | 7 | import java.io.IOException; 8 | import java.net.CookieStore; 9 | import java.util.*; 10 | 11 | public class PlatformService { 12 | 13 | 14 | 15 | 16 | public static class CustomerService { 17 | private PlatformConfig platformConfig; 18 | 19 | private RetrofitServiceFactory retrofitServiceFactory; 20 | 21 | private String organizationId; 22 | 23 | private CustomerApiList customerApiList; 24 | 25 | public CustomerService(PlatformConfig platformConfig) { 26 | this.platformConfig = platformConfig; 27 | this.retrofitServiceFactory = new RetrofitServiceFactory(); 28 | this.organizationId = this.platformConfig.getOrganizationId(); 29 | this.customerApiList = generateCustomerApiList(this.platformConfig.getPersistentCookieStore()); 30 | } 31 | 32 | private CustomerApiList generateCustomerApiList(CookieStore cookieStore) { 33 | List interceptorList = new ArrayList<>(); 34 | interceptorList.add(new AccessTokenInterceptor(platformConfig)); 35 | interceptorList.add(new RequestSignerInterceptor()); 36 | return retrofitServiceFactory.createService(platformConfig.getDomain(),CustomerApiList.class, interceptorList, cookieStore); 37 | } 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | public PlatformModels.ValidateCustomerSuccess validate(String organizationId ,PlatformModels.ValidateCustomer body) throws IOException { 51 | Response response = customerApiList.validate(organizationId , body).execute(); 52 | if (!response.isSuccessful()) { 53 | throw new IOException(response.errorBody() != null 54 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 55 | } 56 | return response.body(); 57 | } 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | public PlatformModels.CreateTransactionSuccess createTransaction(String session , String organizationId ,PlatformModels.CreateTransaction body) throws IOException { 76 | Response response = customerApiList.createTransaction(organizationId , body).execute(); 77 | if (!response.isSuccessful()) { 78 | throw new IOException(response.errorBody() != null 79 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 80 | } 81 | return response.body(); 82 | } 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | public PlatformModels.LinkAccountSuccess link(String organizationId ,PlatformModels.LinkAccount body) throws IOException { 97 | Response response = customerApiList.link(organizationId , body).execute(); 98 | if (!response.isSuccessful()) { 99 | throw new IOException(response.errorBody() != null 100 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 101 | } 102 | return response.body(); 103 | } 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | public PlatformModels.UnlinkAccountSuccess unlink(String organizationId ,PlatformModels.UnlinkAccount body) throws IOException { 118 | Response response = customerApiList.unlink(organizationId , body).execute(); 119 | if (!response.isSuccessful()) { 120 | throw new IOException(response.errorBody() != null 121 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 122 | } 123 | return response.body(); 124 | } 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | public PlatformModels.RefundResponse refund(String organizationId ,PlatformModels.Refund body) throws IOException { 139 | Response response = customerApiList.refund(organizationId , body).execute(); 140 | if (!response.isSuccessful()) { 141 | throw new IOException(response.errorBody() != null 142 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 143 | } 144 | return response.body(); 145 | } 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | public PlatformModels.RefundStatus refundStatus(String organizationId , String refundId , String orderId ) throws IOException { 168 | Response response = customerApiList.refundStatus(organizationId ,refundId , orderId ).execute(); 169 | if (!response.isSuccessful()) { 170 | throw new IOException(response.errorBody() != null 171 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 172 | } 173 | return response.body(); 174 | } 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | public PlatformModels.GetSchemesSuccess getSchemes(String organizationId ,PlatformModels.GetSchemesRequest body) throws IOException { 189 | Response response = customerApiList.getSchemes(organizationId , body).execute(); 190 | if (!response.isSuccessful()) { 191 | throw new IOException(response.errorBody() != null 192 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 193 | } 194 | return response.body(); 195 | } 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | public PlatformModels.EligibilitySuccess checkEligibility(String organizationId ,PlatformModels.CheckEligibilityRequest body) throws IOException { 210 | Response response = customerApiList.checkEligibility(organizationId , body).execute(); 211 | if (!response.isSuccessful()) { 212 | throw new IOException(response.errorBody() != null 213 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 214 | } 215 | return response.body(); 216 | } 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | public PlatformModels.RepaymentResponse getRepaymentLink(String organizationId ,PlatformModels.RepaymentRequest body) throws IOException { 231 | Response response = customerApiList.getRepaymentLink(organizationId , body).execute(); 232 | if (!response.isSuccessful()) { 233 | throw new IOException(response.errorBody() != null 234 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 235 | } 236 | return response.body(); 237 | } 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | public PlatformModels.UserResponse getAllCustomers(String organizationId , Integer page , Integer limit , String name , String mobile ) throws IOException { 268 | Response response = customerApiList.getAllCustomers(organizationId ,page , limit , name , mobile ).execute(); 269 | if (!response.isSuccessful()) { 270 | throw new IOException(response.errorBody() != null 271 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 272 | } 273 | return response.body(); 274 | } 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | public PlatformModels.AddVintageResponse addVintageData(String organizationId ,PlatformModels.VintageData body) throws IOException { 289 | Response response = customerApiList.addVintageData(organizationId , body).execute(); 290 | if (!response.isSuccessful()) { 291 | throw new IOException(response.errorBody() != null 292 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 293 | } 294 | return response.body(); 295 | } 296 | 297 | 298 | 299 | 300 | 301 | public class ApplicationClient { 302 | private PlatformConfig platformConfig; 303 | 304 | private String applicationId; 305 | 306 | private String organizationId; 307 | 308 | ApplicationClient(PlatformConfig platformConfig, String applicationId) { 309 | this.platformConfig = platformConfig; 310 | this.applicationId = applicationId; 311 | this.organizationId = this.platformConfig.getOrganizationId(); 312 | } 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | } 339 | 340 | } 341 | 342 | public static class CreditService { 343 | private PlatformConfig platformConfig; 344 | 345 | private RetrofitServiceFactory retrofitServiceFactory; 346 | 347 | private String organizationId; 348 | 349 | private CreditApiList creditApiList; 350 | 351 | public CreditService(PlatformConfig platformConfig) { 352 | this.platformConfig = platformConfig; 353 | this.retrofitServiceFactory = new RetrofitServiceFactory(); 354 | this.organizationId = this.platformConfig.getOrganizationId(); 355 | this.creditApiList = generateCreditApiList(this.platformConfig.getPersistentCookieStore()); 356 | } 357 | 358 | private CreditApiList generateCreditApiList(CookieStore cookieStore) { 359 | List interceptorList = new ArrayList<>(); 360 | interceptorList.add(new AccessTokenInterceptor(platformConfig)); 361 | interceptorList.add(new RequestSignerInterceptor()); 362 | return retrofitServiceFactory.createService(platformConfig.getDomain(),CreditApiList.class, interceptorList, cookieStore); 363 | } 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | public PlatformModels.OrderStatus getOrderStatus(String organizationId , String orderId ) throws IOException { 381 | Response response = creditApiList.getOrderStatus(organizationId , orderId ).execute(); 382 | if (!response.isSuccessful()) { 383 | throw new IOException(response.errorBody() != null 384 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 385 | } 386 | return response.body(); 387 | } 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | public PlatformModels.EligiblePlansResponse getEligiblePlans(String organizationId , String lenderSlug ,PlatformModels.EligiblePlansRequest body) throws IOException { 406 | Response response = creditApiList.getEligiblePlans(organizationId , lenderSlug , body).execute(); 407 | if (!response.isSuccessful()) { 408 | throw new IOException(response.errorBody() != null 409 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 410 | } 411 | return response.body(); 412 | } 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | public PlatformModels.OrderDeliveryUpdatesResponse updateOrderDeliveryStatus(String organizationId ,PlatformModels.OrderDeliveryUpdatesBody body) throws IOException { 427 | Response response = creditApiList.updateOrderDeliveryStatus(organizationId , body).execute(); 428 | if (!response.isSuccessful()) { 429 | throw new IOException(response.errorBody() != null 430 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 431 | } 432 | return response.body(); 433 | } 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | public PlatformModels.GetTransactionsResponse getTransactions(String organizationId , String mobile , String countryCode , Integer page , Integer limit , String orderId , String transactionId , Object type , Object status , Boolean onlySelf , String granularity ) throws IOException { 488 | Response response = creditApiList.getTransactions(organizationId ,mobile , countryCode , page , limit , orderId , transactionId , type , status , onlySelf , granularity ).execute(); 489 | if (!response.isSuccessful()) { 490 | throw new IOException(response.errorBody() != null 491 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 492 | } 493 | return response.body(); 494 | } 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | public PlatformModels.GetSettlementTransactionsResponse getSettledTransactions(String organizationId , Integer page , Integer limit , String orderId , String transactionId , String startDate , String endDate ) throws IOException { 533 | Response response = creditApiList.getSettledTransactions(organizationId ,page , limit , orderId , transactionId , startDate , endDate ).execute(); 534 | if (!response.isSuccessful()) { 535 | throw new IOException(response.errorBody() != null 536 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 537 | } 538 | return response.body(); 539 | } 540 | 541 | 542 | 543 | 544 | 545 | public class ApplicationClient { 546 | private PlatformConfig platformConfig; 547 | 548 | private String applicationId; 549 | 550 | private String organizationId; 551 | 552 | ApplicationClient(PlatformConfig platformConfig, String applicationId) { 553 | this.platformConfig = platformConfig; 554 | this.applicationId = applicationId; 555 | this.organizationId = this.platformConfig.getOrganizationId(); 556 | } 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | } 571 | 572 | } 573 | 574 | public static class MultiKycService { 575 | private PlatformConfig platformConfig; 576 | 577 | private RetrofitServiceFactory retrofitServiceFactory; 578 | 579 | private String organizationId; 580 | 581 | private MultiKycApiList multikycApiList; 582 | 583 | public MultiKycService(PlatformConfig platformConfig) { 584 | this.platformConfig = platformConfig; 585 | this.retrofitServiceFactory = new RetrofitServiceFactory(); 586 | this.organizationId = this.platformConfig.getOrganizationId(); 587 | this.multikycApiList = generateMultikycApiList(this.platformConfig.getPersistentCookieStore()); 588 | } 589 | 590 | private MultiKycApiList generateMultikycApiList(CookieStore cookieStore) { 591 | List interceptorList = new ArrayList<>(); 592 | interceptorList.add(new AccessTokenInterceptor(platformConfig)); 593 | interceptorList.add(new RequestSignerInterceptor()); 594 | return retrofitServiceFactory.createService(platformConfig.getDomain(),MultiKycApiList.class, interceptorList, cookieStore); 595 | } 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | public PlatformModels.ApprovedLendersTransaction approvedLenders(Object organizationId ) throws IOException { 609 | Response response = multikycApiList.approvedLenders(organizationId ).execute(); 610 | if (!response.isSuccessful()) { 611 | throw new IOException(response.errorBody() != null 612 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 613 | } 614 | return response.body(); 615 | } 616 | 617 | 618 | 619 | 620 | 621 | public class ApplicationClient { 622 | private PlatformConfig platformConfig; 623 | 624 | private String applicationId; 625 | 626 | private String organizationId; 627 | 628 | ApplicationClient(PlatformConfig platformConfig, String applicationId) { 629 | this.platformConfig = platformConfig; 630 | this.applicationId = applicationId; 631 | this.organizationId = this.platformConfig.getOrganizationId(); 632 | } 633 | 634 | 635 | 636 | 637 | 638 | } 639 | 640 | } 641 | 642 | public static class MerchantService { 643 | private PlatformConfig platformConfig; 644 | 645 | private RetrofitServiceFactory retrofitServiceFactory; 646 | 647 | private String organizationId; 648 | 649 | private MerchantApiList merchantApiList; 650 | 651 | public MerchantService(PlatformConfig platformConfig) { 652 | this.platformConfig = platformConfig; 653 | this.retrofitServiceFactory = new RetrofitServiceFactory(); 654 | this.organizationId = this.platformConfig.getOrganizationId(); 655 | this.merchantApiList = generateMerchantApiList(this.platformConfig.getPersistentCookieStore()); 656 | } 657 | 658 | private MerchantApiList generateMerchantApiList(CookieStore cookieStore) { 659 | List interceptorList = new ArrayList<>(); 660 | interceptorList.add(new AccessTokenInterceptor(platformConfig)); 661 | interceptorList.add(new RequestSignerInterceptor()); 662 | return retrofitServiceFactory.createService(platformConfig.getDomain(),MerchantApiList.class, interceptorList, cookieStore); 663 | } 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | public PlatformModels.GetAccessTokenResponse getAccessToken(String organizationId ) throws IOException { 677 | Response response = merchantApiList.getAccessToken(organizationId ).execute(); 678 | if (!response.isSuccessful()) { 679 | throw new IOException(response.errorBody() != null 680 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 681 | } 682 | return response.body(); 683 | } 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | public PlatformModels.RefreshTokenResponse renewAccessToken(String organizationId ,PlatformModels.RefreshTokenRequest body) throws IOException { 698 | Response response = merchantApiList.renewAccessToken(organizationId , body).execute(); 699 | if (!response.isSuccessful()) { 700 | throw new IOException(response.errorBody() != null 701 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 702 | } 703 | return response.body(); 704 | } 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | public PlatformModels.ValidateCredentialsResponse validateCredentials(String organizationId ) throws IOException { 719 | Response response = merchantApiList.validateCredentials(organizationId ).execute(); 720 | if (!response.isSuccessful()) { 721 | throw new IOException(response.errorBody() != null 722 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 723 | } 724 | return response.body(); 725 | } 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | public PlatformModels.UpdateApiHookResponse updateWebhook(String organizationId ,PlatformModels.UpdateApiHook body) throws IOException { 740 | Response response = merchantApiList.updateWebhook(organizationId , body).execute(); 741 | if (!response.isSuccessful()) { 742 | throw new IOException(response.errorBody() != null 743 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 744 | } 745 | return response.body(); 746 | } 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | public PlatformModels.ApiHookDetailsResponse getWebhook(String organizationId ) throws IOException { 761 | Response response = merchantApiList.getWebhook(organizationId ).execute(); 762 | if (!response.isSuccessful()) { 763 | throw new IOException(response.errorBody() != null 764 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 765 | } 766 | return response.body(); 767 | } 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | public PlatformModels.WebhookCategoriesResponse getAllWebhookCategoriesAndEvents(String organizationId , Double size , Double page , String name , List slug ) throws IOException { 798 | Response response = merchantApiList.getAllWebhookCategoriesAndEvents(organizationId ,size , page , name , slug ).execute(); 799 | if (!response.isSuccessful()) { 800 | throw new IOException(response.errorBody() != null 801 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 802 | } 803 | return response.body(); 804 | } 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | public PlatformModels.OrganizationIpDetailsResponse getWhitelistedIp(String organizationId ) throws IOException { 819 | Response response = merchantApiList.getWhitelistedIp(organizationId ).execute(); 820 | if (!response.isSuccessful()) { 821 | throw new IOException(response.errorBody() != null 822 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 823 | } 824 | return response.body(); 825 | } 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | public PlatformModels.OrganizationIpDetailsResponse whitelistIp(String organizationId ,PlatformModels.AddOrganizationIpDetails body) throws IOException { 840 | Response response = merchantApiList.whitelistIp(organizationId , body).execute(); 841 | if (!response.isSuccessful()) { 842 | throw new IOException(response.errorBody() != null 843 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 844 | } 845 | return response.body(); 846 | } 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | public PlatformModels.DeleteOrganizationIpResponse removeWhitelistedIp(String organizationId ,PlatformModels.DeleteOrganizationIpDetails body) throws IOException { 861 | Response response = merchantApiList.removeWhitelistedIp(organizationId , body).execute(); 862 | if (!response.isSuccessful()) { 863 | throw new IOException(response.errorBody() != null 864 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 865 | } 866 | return response.body(); 867 | } 868 | 869 | 870 | 871 | 872 | 873 | public class ApplicationClient { 874 | private PlatformConfig platformConfig; 875 | 876 | private String applicationId; 877 | 878 | private String organizationId; 879 | 880 | ApplicationClient(PlatformConfig platformConfig, String applicationId) { 881 | this.platformConfig = platformConfig; 882 | this.applicationId = applicationId; 883 | this.organizationId = this.platformConfig.getOrganizationId(); 884 | } 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | } 907 | 908 | } 909 | 910 | public static class PaymentsService { 911 | private PlatformConfig platformConfig; 912 | 913 | private RetrofitServiceFactory retrofitServiceFactory; 914 | 915 | private String organizationId; 916 | 917 | private PaymentsApiList paymentsApiList; 918 | 919 | public PaymentsService(PlatformConfig platformConfig) { 920 | this.platformConfig = platformConfig; 921 | this.retrofitServiceFactory = new RetrofitServiceFactory(); 922 | this.organizationId = this.platformConfig.getOrganizationId(); 923 | this.paymentsApiList = generatePaymentsApiList(this.platformConfig.getPersistentCookieStore()); 924 | } 925 | 926 | private PaymentsApiList generatePaymentsApiList(CookieStore cookieStore) { 927 | List interceptorList = new ArrayList<>(); 928 | interceptorList.add(new AccessTokenInterceptor(platformConfig)); 929 | interceptorList.add(new RequestSignerInterceptor()); 930 | return retrofitServiceFactory.createService(platformConfig.getDomain(),PaymentsApiList.class, interceptorList, cookieStore); 931 | } 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | public PlatformModels.OutstandingDetailsResponse getUserCreditSummary(String mobile , String organizationId , List lenderSlugs ) throws IOException { 953 | Response response = paymentsApiList.getUserCreditSummary(mobile , organizationId ,lenderSlugs ).execute(); 954 | if (!response.isSuccessful()) { 955 | throw new IOException(response.errorBody() != null 956 | ? response.errorBody().string() : Fields.UNKNOWN_ERROR); 957 | } 958 | return response.body(); 959 | } 960 | 961 | 962 | 963 | 964 | 965 | public class ApplicationClient { 966 | private PlatformConfig platformConfig; 967 | 968 | private String applicationId; 969 | 970 | private String organizationId; 971 | 972 | ApplicationClient(PlatformConfig platformConfig, String applicationId) { 973 | this.platformConfig = platformConfig; 974 | this.applicationId = applicationId; 975 | this.organizationId = this.platformConfig.getOrganizationId(); 976 | } 977 | 978 | 979 | 980 | 981 | 982 | } 983 | 984 | } 985 | 986 | private interface Fields { 987 | String UNKNOWN_ERROR = "Unknown error"; 988 | } 989 | } -------------------------------------------------------------------------------- /documentation/application/PAYMENT.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ##### [Back to Application docs](./README.md) 6 | 7 | ## Payment Methods 8 | KYC Service 9 | * [downpaymentOptions](#downpaymentoptions) 10 | * [downpaymentUsingNetbanking](#downpaymentusingnetbanking) 11 | * [downpaymentUsingUPI](#downpaymentusingupi) 12 | * [checkDownpaymentStatus](#checkdownpaymentstatus) 13 | * [registerUPIMandate](#registerupimandate) 14 | * [mandateStatusCheck](#mandatestatuscheck) 15 | * [autoPayStatus](#autopaystatus) 16 | * [paymentOptions](#paymentoptions) 17 | * [repaymentUsingNetbanking](#repaymentusingnetbanking) 18 | * [repaymentUsingUPI](#repaymentusingupi) 19 | * [checkPaymentStatus](#checkpaymentstatus) 20 | * [verifyUpiId](#verifyupiid) 21 | * [getOutstandingAmount](#getoutstandingamount) 22 | * [getOutstandingAmountByEntityMapId](#getoutstandingamountbyentitymapid) 23 | 24 | 25 | 26 | ## Methods with example and description 27 | 28 | 29 | ### downpaymentOptions 30 | Get List of Payment Options Available 31 | 32 | 33 | 34 | 35 | ```java 36 | payment.downpaymentOptions( merchantSlug) { 37 | //use response 38 | } 39 | ``` 40 | 41 | 42 | 43 | | Argument | Type | Required | Description | 44 | | --------- | ----- | -------- | ----------- | 45 | | merchantSlug | String | yes | This is merchant slug | 46 | 47 | 48 | 49 | Use this API to get list of payment options available 50 | 51 | *Returned Response:* 52 | 53 | 54 | 55 | 56 | [PaymentOptionsResponse](#PaymentOptionsResponse) 57 | 58 | Success. Returns a JSON object as shown below. Refer `PaymentOptionsResponse` for more details. 59 | 60 | 61 | 62 | 63 |
64 |   Example: 65 | 66 | ```json 67 | { 68 | "paymentOptions": [ 69 | { 70 | "title": "UPI", 71 | "kind": "upiID", 72 | "options": null 73 | }, 74 | { 75 | "title": "UPI Apps", 76 | "kind": "upiApps", 77 | "options": [ 78 | { 79 | "title": "Google PAY", 80 | "imageUrl": "", 81 | "uid": "GPAY" 82 | } 83 | ] 84 | }, 85 | { 86 | "title": "Netbanking", 87 | "kind": "netBanking", 88 | "options": [ 89 | { 90 | "title": "State Bank of India", 91 | "shortTitle": "SBI", 92 | "uid": "1038", 93 | "imageUrl": "https://pp-checkout.jiopay.com:8443/images/logos/StateBankofIndia.gif" 94 | } 95 | ] 96 | } 97 | ] 98 | } 99 | ``` 100 |
101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | --- 111 | 112 | 113 | ### downpaymentUsingNetbanking 114 | Downpayment 115 | 116 | 117 | 118 | 119 | ```java 120 | payment.downpaymentUsingNetbanking( merchantSlug, body body) { 121 | //use response 122 | } 123 | ``` 124 | 125 | 126 | 127 | | Argument | Type | Required | Description | 128 | | --------- | ----- | -------- | ----------- | 129 | | merchantSlug | String | yes | This is merchant Slug | 130 | | body | [RepaymentUsingNetbanking](#RepaymentUsingNetbanking) | yes | Request body | 131 | 132 | 133 | Use this API to downpayment for user. 134 | 135 | *Returned Response:* 136 | 137 | 138 | 139 | 140 | [RepaymentUsingNetbankingResponse](#RepaymentUsingNetbankingResponse) 141 | 142 | Success. Returns a html as shown below. for more details. 143 | 144 | 145 | 146 | 147 |
148 |   Example: 149 | 150 | ```json 151 | { 152 | "form": "" 153 | } 154 | ``` 155 |
156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | --- 166 | 167 | 168 | ### downpaymentUsingUPI 169 | Downpayment 170 | 171 | 172 | 173 | 174 | ```java 175 | payment.downpaymentUsingUPI( merchantSlug, body body) { 176 | //use response 177 | } 178 | ``` 179 | 180 | 181 | 182 | | Argument | Type | Required | Description | 183 | | --------- | ----- | -------- | ----------- | 184 | | merchantSlug | String | yes | This is merchant slug | 185 | | body | [RepaymentUsingUPI](#RepaymentUsingUPI) | yes | Request body | 186 | 187 | 188 | Use this API to Downpayment for user 189 | 190 | *Returned Response:* 191 | 192 | 193 | 194 | 195 | [RepaymentUsingUPIResponse](#RepaymentUsingUPIResponse) 196 | 197 | Success. Returns a success message as shown below. Refer `RepaymentUsingUPIResponse` for more details. 198 | 199 | 200 | 201 | 202 |
203 |   Example: 204 | 205 | ```json 206 | { 207 | "status": "INITIATED" 208 | } 209 | ``` 210 |
211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | --- 221 | 222 | 223 | ### checkDownpaymentStatus 224 | Check payment status 225 | 226 | 227 | 228 | 229 | ```java 230 | payment.checkDownpaymentStatus( merchantSlug, body body) { 231 | //use response 232 | } 233 | ``` 234 | 235 | 236 | 237 | | Argument | Type | Required | Description | 238 | | --------- | ----- | -------- | ----------- | 239 | | merchantSlug | String | yes | This is merchant slug | 240 | | body | [TransactionStatusRequest](#TransactionStatusRequest) | yes | Request body | 241 | 242 | 243 | Use this API to check status of the downpayment. 244 | 245 | *Returned Response:* 246 | 247 | 248 | 249 | 250 | [TransactionStatusResponse](#TransactionStatusResponse) 251 | 252 | Success. Returns a success message as shown below. Refer `TransactionStatusResponse` for more details. 253 | 254 | 255 | 256 | 257 |
258 |   Example: 259 | 260 | ```json 261 | 262 | ``` 263 |
264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | --- 274 | 275 | 276 | ### registerUPIMandate 277 | MandateRegistration 278 | 279 | 280 | 281 | 282 | ```java 283 | payment.registerUPIMandate( lenderSlug, body body) { 284 | //use response 285 | } 286 | ``` 287 | 288 | 289 | 290 | | Argument | Type | Required | Description | 291 | | --------- | ----- | -------- | ----------- | 292 | | lenderSlug | String | yes | This is lender slug | 293 | | body | [RegisterUPIMandateRequest](#RegisterUPIMandateRequest) | yes | Request body | 294 | 295 | 296 | Use this API to register upi mandate for user. 297 | 298 | *Returned Response:* 299 | 300 | 301 | 302 | 303 | [RegisterUPIMandateResponse](#RegisterUPIMandateResponse) 304 | 305 | Success. Returns a success message as shown below. Refer `RegisterUPIMandateResponse` for more details. 306 | 307 | 308 | 309 | 310 |
311 |   Example: 312 | 313 | ```json 314 | { 315 | "transactionId": "10322234354461670000", 316 | "expiry": 180, 317 | "interval": 5 318 | } 319 | ``` 320 |
321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | --- 331 | 332 | 333 | ### mandateStatusCheck 334 | Repayment 335 | 336 | 337 | 338 | 339 | ```java 340 | payment.mandateStatusCheck( lenderSlug, body body) { 341 | //use response 342 | } 343 | ``` 344 | 345 | 346 | 347 | | Argument | Type | Required | Description | 348 | | --------- | ----- | -------- | ----------- | 349 | | lenderSlug | String | yes | This is lender slug | 350 | | body | [RegisterUPIMandateStatusCheckRequest](#RegisterUPIMandateStatusCheckRequest) | yes | Request body | 351 | 352 | 353 | Use this API to repayment for user. 354 | 355 | *Returned Response:* 356 | 357 | 358 | 359 | 360 | [RegisterMandateStatusCheckResponse](#RegisterMandateStatusCheckResponse) 361 | 362 | Success. Returns a success message as shown below. Refer `RegisterMandateStatusCheckResponse` for more details. 363 | 364 | 365 | 366 | 367 |
368 |   Example: 369 | 370 | ```json 371 | { 372 | "status": "INITIATED" 373 | } 374 | ``` 375 |
376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | --- 386 | 387 | 388 | ### autoPayStatus 389 | Get status of AutoPay 390 | 391 | 392 | 393 | 394 | ```java 395 | payment.autoPayStatus() { 396 | //use response 397 | } 398 | ``` 399 | 400 | 401 | 402 | 403 | Use this API to get status of AutoPay 404 | 405 | *Returned Response:* 406 | 407 | 408 | 409 | 410 | [AutoPayStatusResponse](#AutoPayStatusResponse) 411 | 412 | Success. Returns a JSON object as shown below. Refer `AutoPayStatusResponse` for more details. 413 | 414 | 415 | 416 | 417 |
418 |   Example: 419 | 420 | ```json 421 | { 422 | "status": "PENDING" 423 | } 424 | ``` 425 |
426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | --- 436 | 437 | 438 | ### paymentOptions 439 | Get List of Payment Options Available 440 | 441 | 442 | 443 | 444 | ```java 445 | payment.paymentOptions( lenderSlug) { 446 | //use response 447 | } 448 | ``` 449 | 450 | 451 | 452 | | Argument | Type | Required | Description | 453 | | --------- | ----- | -------- | ----------- | 454 | | lenderSlug | String | yes | This is lender slug | 455 | 456 | 457 | 458 | Use this API to get list of payment options available 459 | 460 | *Returned Response:* 461 | 462 | 463 | 464 | 465 | [PaymentOptionsResponse](#PaymentOptionsResponse) 466 | 467 | Success. Returns a JSON object as shown below. Refer `PaymentOptionsResponse` for more details. 468 | 469 | 470 | 471 | 472 |
473 |   Example: 474 | 475 | ```json 476 | { 477 | "paymentOptions": [ 478 | { 479 | "title": "UPI", 480 | "kind": "upiID", 481 | "options": null 482 | }, 483 | { 484 | "title": "UPI Apps", 485 | "kind": "upiApps", 486 | "options": [ 487 | { 488 | "title": "Google PAY", 489 | "imageUrl": "", 490 | "uid": "GPAY" 491 | } 492 | ] 493 | }, 494 | { 495 | "title": "Netbanking", 496 | "kind": "netBanking", 497 | "options": [ 498 | { 499 | "title": "State Bank of India", 500 | "shortTitle": "SBI", 501 | "uid": "1038", 502 | "imageUrl": "https://pp-checkout.jiopay.com:8443/images/logos/StateBankofIndia.gif" 503 | } 504 | ] 505 | } 506 | ] 507 | } 508 | ``` 509 |
510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | --- 520 | 521 | 522 | ### repaymentUsingNetbanking 523 | Repayment 524 | 525 | 526 | 527 | 528 | ```java 529 | payment.repaymentUsingNetbanking( lenderSlug, body body) { 530 | //use response 531 | } 532 | ``` 533 | 534 | 535 | 536 | | Argument | Type | Required | Description | 537 | | --------- | ----- | -------- | ----------- | 538 | | lenderSlug | String | yes | This is lender slug | 539 | | body | [RepaymentUsingNetbanking](#RepaymentUsingNetbanking) | yes | Request body | 540 | 541 | 542 | Use this API to repayment for user. 543 | 544 | *Returned Response:* 545 | 546 | 547 | 548 | 549 | [RepaymentUsingNetbankingResponse](#RepaymentUsingNetbankingResponse) 550 | 551 | Success. Returns a html as shown below. for more details. 552 | 553 | 554 | 555 | 556 |
557 |   Example: 558 | 559 | ```json 560 | { 561 | "form": "" 562 | } 563 | ``` 564 |
565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | --- 575 | 576 | 577 | ### repaymentUsingUPI 578 | Repayment 579 | 580 | 581 | 582 | 583 | ```java 584 | payment.repaymentUsingUPI( lenderSlug, body body) { 585 | //use response 586 | } 587 | ``` 588 | 589 | 590 | 591 | | Argument | Type | Required | Description | 592 | | --------- | ----- | -------- | ----------- | 593 | | lenderSlug | String | yes | This is lender slug | 594 | | body | [RepaymentUsingUPI](#RepaymentUsingUPI) | yes | Request body | 595 | 596 | 597 | Use this API to repayment for user 598 | 599 | *Returned Response:* 600 | 601 | 602 | 603 | 604 | [RepaymentUsingUPIResponse](#RepaymentUsingUPIResponse) 605 | 606 | Success. Returns a success message as shown below. Refer `RepaymentUsingUPIResponse` for more details. 607 | 608 | 609 | 610 | 611 |
612 |   Example: 613 | 614 | ```json 615 | { 616 | "status": "INITIATED" 617 | } 618 | ``` 619 |
620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | --- 630 | 631 | 632 | ### checkPaymentStatus 633 | Check payment status 634 | 635 | 636 | 637 | 638 | ```java 639 | payment.checkPaymentStatus( lenderSlug, body body) { 640 | //use response 641 | } 642 | ``` 643 | 644 | 645 | 646 | | Argument | Type | Required | Description | 647 | | --------- | ----- | -------- | ----------- | 648 | | lenderSlug | String | yes | This is lender slug | 649 | | body | [TransactionStatusRequest](#TransactionStatusRequest) | yes | Request body | 650 | 651 | 652 | Use this API to check status of the transaction. 653 | 654 | *Returned Response:* 655 | 656 | 657 | 658 | 659 | [TransactionStatusResponse](#TransactionStatusResponse) 660 | 661 | Success. Returns a success message as shown below. Refer `TransactionStatusResponse` for more details. 662 | 663 | 664 | 665 | 666 |
667 |   Example: 668 | 669 | ```json 670 | 671 | ``` 672 |
673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | --- 683 | 684 | 685 | ### verifyUpiId 686 | Verify UPI ID 687 | 688 | 689 | 690 | 691 | ```java 692 | payment.verifyUpiId(body body) { 693 | //use response 694 | } 695 | ``` 696 | 697 | 698 | 699 | | Argument | Type | Required | Description | 700 | | --------- | ----- | -------- | ----------- | 701 | | body | [VerifyUPIRequest](#VerifyUPIRequest) | yes | Request body | 702 | 703 | 704 | This API verifies the validity of a UPI ID. 705 | 706 | *Returned Response:* 707 | 708 | 709 | 710 | 711 | [UPIValidationSuccessResponse](#UPIValidationSuccessResponse) 712 | 713 | UPI ID validation success 714 | 715 | 716 | 717 | 718 |
719 |   Example: 720 | 721 | ```json 722 | 723 | ``` 724 |
725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | --- 735 | 736 | 737 | ### getOutstandingAmount 738 | Get Outstanding amount for repayment 739 | 740 | 741 | 742 | 743 | ```java 744 | payment.getOutstandingAmount( lenderSlug, viewType, leadId) { 745 | //use response 746 | } 747 | ``` 748 | 749 | 750 | 751 | | Argument | Type | Required | Description | 752 | | --------- | ----- | -------- | ----------- | 753 | | lenderSlug | String | yes | This is lender slug | 754 | | viewType | String | yes | This is lender slug | 755 | | leadId | String? | no | This is TRXN Id, to be used for single TRXN repayment | 756 | 757 | 758 | 759 | Use this API to get Outstanding amount for repayment 760 | 761 | *Returned Response:* 762 | 763 | 764 | 765 | 766 | [OutstandingDetail](#OutstandingDetail) 767 | 768 | Success. Returns a JSON object as shown below. Refer `OutstandingDetail` for more details. 769 | 770 | 771 | 772 | 773 |
774 |   Example: 775 | 776 | ```json 777 | { 778 | "outstanding": "100" 779 | } 780 | ``` 781 |
782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | --- 792 | 793 | 794 | ### getOutstandingAmountByEntityMapId 795 | Get Outstanding amount for repayment 796 | 797 | 798 | 799 | 800 | ```java 801 | payment.getOutstandingAmountByEntityMapId( entityMapId, viewType, leadId) { 802 | //use response 803 | } 804 | ``` 805 | 806 | 807 | 808 | | Argument | Type | Required | Description | 809 | | --------- | ----- | -------- | ----------- | 810 | | entityMapId | String | yes | This is entity map id | 811 | | viewType | String | yes | This is lender slug | 812 | | leadId | String? | no | This is TRXN Id, to be used for single TRXN repayment | 813 | 814 | 815 | 816 | Use this API to get Outstanding amount for repayment 817 | 818 | *Returned Response:* 819 | 820 | 821 | 822 | 823 | [OutstandingDetail](#OutstandingDetail) 824 | 825 | Success. Returns a JSON object as shown below. Refer `OutstandingDetail` for more details. 826 | 827 | 828 | 829 | 830 |
831 |   Example: 832 | 833 | ```json 834 | { 835 | "outstanding": "100" 836 | } 837 | ``` 838 |
839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | --- 849 | 850 | 851 | 852 | ### Schemas 853 | 854 | 855 | 856 | #### [IntegrationResponseMeta](#IntegrationResponseMeta) 857 | 858 | | Properties | Type | Nullable | Description | 859 | | ---------- | ---- | -------- | ----------- | 860 | | timestamp | String | no | The timestamp when the response was generated. | 861 | | version | String | no | The version of the API. | 862 | | product | String | no | The name of the product or service. | 863 | | requestId | String? | yes | An optional request identifier. | 864 | 865 | --- 866 | 867 | 868 | 869 | 870 | #### [IntegrationResponseError](#IntegrationResponseError) 871 | 872 | | Properties | Type | Nullable | Description | 873 | | ---------- | ---- | -------- | ----------- | 874 | | code | String | no | Error code representing the type of error. | 875 | | message | String | no | A human-readable message providing more details about the error. | 876 | | exception | String | no | The exception name or type. | 877 | | field | String? | yes | The field associated with the error, if applicable. | 878 | | location | String? | yes | The location of the field, such as 'query', 'param' or 'body'. | 879 | 880 | --- 881 | 882 | 883 | 884 | 885 | #### [IntegrationSuccessResponse](#IntegrationSuccessResponse) 886 | 887 | | Properties | Type | Nullable | Description | 888 | | ---------- | ---- | -------- | ----------- | 889 | | message | String | no | A message indicating the success of the operation. | 890 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | no | | 891 | | data | HashMap | no | The data payload of the response. The structure of this object will vary depending on the specific API endpoint. | 892 | 893 | --- 894 | 895 | 896 | 897 | 898 | #### [IntegrationErrorResponse](#IntegrationErrorResponse) 899 | 900 | | Properties | Type | Nullable | Description | 901 | | ---------- | ---- | -------- | ----------- | 902 | | message | String | no | A message indicating the failure of the operation. | 903 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | no | | 904 | | errors | ArrayList<[IntegrationResponseError](#IntegrationResponseError)>? | yes | | 905 | 906 | --- 907 | 908 | 909 | 910 | 911 | #### [ErrorResponse](#ErrorResponse) 912 | 913 | | Properties | Type | Nullable | Description | 914 | | ---------- | ---- | -------- | ----------- | 915 | | message | String? | yes | | 916 | | info | String? | yes | | 917 | | code | String? | yes | | 918 | | requestId | String? | yes | | 919 | | meta | HashMap? | yes | | 920 | 921 | --- 922 | 923 | 924 | 925 | 926 | #### [RepaymentUsingNetbanking](#RepaymentUsingNetbanking) 927 | 928 | | Properties | Type | Nullable | Description | 929 | | ---------- | ---- | -------- | ----------- | 930 | | amount | Double | no | | 931 | | bankId | String | no | | 932 | | bankName | String | no | | 933 | | chargeToken | String? | yes | | 934 | | transactionId | String? | yes | | 935 | | entityMapId | String? | yes | | 936 | 937 | --- 938 | 939 | 940 | 941 | 942 | #### [RepaymentUsingNetbankingResponse](#RepaymentUsingNetbankingResponse) 943 | 944 | | Properties | Type | Nullable | Description | 945 | | ---------- | ---- | -------- | ----------- | 946 | | form | String? | yes | | 947 | | isDifferent | Boolean? | yes | | 948 | | outstanding | String? | yes | | 949 | | headers | HashMap? | yes | | 950 | 951 | --- 952 | 953 | 954 | 955 | 956 | #### [RepaymentUsingUPI](#RepaymentUsingUPI) 957 | 958 | | Properties | Type | Nullable | Description | 959 | | ---------- | ---- | -------- | ----------- | 960 | | amount | Double | no | | 961 | | vpa | String | no | | 962 | | chargeToken | String? | yes | | 963 | | transactionId | String? | yes | | 964 | | entityMapId | String? | yes | | 965 | 966 | --- 967 | 968 | 969 | 970 | 971 | #### [RepaymentUsingUPIResponse](#RepaymentUsingUPIResponse) 972 | 973 | | Properties | Type | Nullable | Description | 974 | | ---------- | ---- | -------- | ----------- | 975 | | isDifferent | Boolean? | yes | | 976 | | outstanding | String? | yes | | 977 | | status | String? | yes | | 978 | | intentId | String? | yes | | 979 | | transactionId | String? | yes | | 980 | | expiry | Double? | yes | | 981 | | interval | Double? | yes | | 982 | | headers | HashMap? | yes | | 983 | 984 | --- 985 | 986 | 987 | 988 | 989 | #### [RegisterUPIMandateRequest](#RegisterUPIMandateRequest) 990 | 991 | | Properties | Type | Nullable | Description | 992 | | ---------- | ---- | -------- | ----------- | 993 | | vpa | String? | yes | | 994 | 995 | --- 996 | 997 | 998 | 999 | 1000 | #### [RegisterUPIMandateResponse](#RegisterUPIMandateResponse) 1001 | 1002 | | Properties | Type | Nullable | Description | 1003 | | ---------- | ---- | -------- | ----------- | 1004 | | transactionId | String? | yes | | 1005 | | expiry | Double? | yes | | 1006 | | interval | Double? | yes | | 1007 | | headers | HashMap? | yes | | 1008 | 1009 | --- 1010 | 1011 | 1012 | 1013 | 1014 | #### [RegisterUPIMandateStatusCheckRequest](#RegisterUPIMandateStatusCheckRequest) 1015 | 1016 | | Properties | Type | Nullable | Description | 1017 | | ---------- | ---- | -------- | ----------- | 1018 | | transactionId | String? | yes | | 1019 | 1020 | --- 1021 | 1022 | 1023 | 1024 | 1025 | #### [RegisterMandateStatusCheckResponse](#RegisterMandateStatusCheckResponse) 1026 | 1027 | | Properties | Type | Nullable | Description | 1028 | | ---------- | ---- | -------- | ----------- | 1029 | | status | String? | yes | | 1030 | | headers | HashMap? | yes | | 1031 | 1032 | --- 1033 | 1034 | 1035 | 1036 | 1037 | #### [TransactionStatusRequest](#TransactionStatusRequest) 1038 | 1039 | | Properties | Type | Nullable | Description | 1040 | | ---------- | ---- | -------- | ----------- | 1041 | | intentId | String | no | | 1042 | | transactionId | String | no | | 1043 | 1044 | --- 1045 | 1046 | 1047 | 1048 | 1049 | #### [TransactionStatusResponse](#TransactionStatusResponse) 1050 | 1051 | | Properties | Type | Nullable | Description | 1052 | | ---------- | ---- | -------- | ----------- | 1053 | | success | Boolean | no | | 1054 | | methodType | String? | yes | | 1055 | | methodSubType | String? | yes | | 1056 | | status | String? | yes | | 1057 | | headers | HashMap? | yes | | 1058 | 1059 | --- 1060 | 1061 | 1062 | 1063 | 1064 | #### [BankList](#BankList) 1065 | 1066 | | Properties | Type | Nullable | Description | 1067 | | ---------- | ---- | -------- | ----------- | 1068 | | bankId | String? | yes | | 1069 | | bankName | String? | yes | | 1070 | | rank | Double? | yes | | 1071 | | popular | Boolean? | yes | | 1072 | | imageUrl | String? | yes | | 1073 | 1074 | --- 1075 | 1076 | 1077 | 1078 | 1079 | #### [PaymentOptions](#PaymentOptions) 1080 | 1081 | | Properties | Type | Nullable | Description | 1082 | | ---------- | ---- | -------- | ----------- | 1083 | | title | String? | yes | | 1084 | | shortTitle | String? | yes | | 1085 | | uid | String? | yes | | 1086 | | imageUrl | String? | yes | | 1087 | 1088 | --- 1089 | 1090 | 1091 | 1092 | 1093 | #### [PaymentsObject](#PaymentsObject) 1094 | 1095 | | Properties | Type | Nullable | Description | 1096 | | ---------- | ---- | -------- | ----------- | 1097 | | title | String? | yes | | 1098 | | kind | String? | yes | | 1099 | | options | ArrayList<[PaymentOptions](#PaymentOptions)>? | yes | | 1100 | 1101 | --- 1102 | 1103 | 1104 | 1105 | 1106 | #### [LenderTheme](#LenderTheme) 1107 | 1108 | | Properties | Type | Nullable | Description | 1109 | | ---------- | ---- | -------- | ----------- | 1110 | | iconUrl | String | no | | 1111 | | logoUrl | String | no | | 1112 | 1113 | --- 1114 | 1115 | 1116 | 1117 | 1118 | #### [LenderDetails](#LenderDetails) 1119 | 1120 | | Properties | Type | Nullable | Description | 1121 | | ---------- | ---- | -------- | ----------- | 1122 | | slug | String | no | | 1123 | | name | String | no | | 1124 | | id | String | no | | 1125 | | theme | [LenderTheme](#LenderTheme) | no | | 1126 | 1127 | --- 1128 | 1129 | 1130 | 1131 | 1132 | #### [OutstandingDetail](#OutstandingDetail) 1133 | 1134 | | Properties | Type | Nullable | Description | 1135 | | ---------- | ---- | -------- | ----------- | 1136 | | status | String? | yes | | 1137 | | action | Boolean? | yes | | 1138 | | message | [OutstandingMessage](#OutstandingMessage)? | yes | | 1139 | | credit | [UserCredit](#UserCredit)? | yes | | 1140 | | dueSummary | [DueSummaryOutstanding](#DueSummaryOutstanding)? | yes | | 1141 | | outstandingSummary | [OutstandingSummary](#OutstandingSummary)? | yes | | 1142 | | entityMapId | String? | yes | | 1143 | | headers | HashMap? | yes | | 1144 | 1145 | --- 1146 | 1147 | 1148 | 1149 | 1150 | #### [OutstandingSummary](#OutstandingSummary) 1151 | 1152 | | Properties | Type | Nullable | Description | 1153 | | ---------- | ---- | -------- | ----------- | 1154 | | totalOutstanding | Double? | yes | | 1155 | | totalOutstandingWithInterest | Double? | yes | | 1156 | | totalOutstandingPenalty | Double? | yes | | 1157 | | availableLimit | Double? | yes | | 1158 | | isOverdue | Boolean? | yes | | 1159 | | dueFromDate | String? | yes | | 1160 | | repaymentSummary | ArrayList<[RepaymentSummaryOutstanding](#RepaymentSummaryOutstanding)>? | yes | | 1161 | 1162 | --- 1163 | 1164 | 1165 | 1166 | 1167 | #### [DueSummaryOutstanding](#DueSummaryOutstanding) 1168 | 1169 | | Properties | Type | Nullable | Description | 1170 | | ---------- | ---- | -------- | ----------- | 1171 | | dueDate | String? | yes | | 1172 | | totalDue | Double? | yes | | 1173 | | totalDueWithInterest | Double? | yes | | 1174 | | totalDuePenalty | Double? | yes | | 1175 | | dueTransactions | ArrayList<[DueTransactionsOutstanding](#DueTransactionsOutstanding)>? | yes | | 1176 | | minAmntDue | Double? | yes | | 1177 | 1178 | --- 1179 | 1180 | 1181 | 1182 | 1183 | #### [OutstandingMessage](#OutstandingMessage) 1184 | 1185 | | Properties | Type | Nullable | Description | 1186 | | ---------- | ---- | -------- | ----------- | 1187 | | dueMessage | String? | yes | | 1188 | | backgroundColor | String? | yes | | 1189 | | textColor | String? | yes | | 1190 | | isFlexiRepayEnabled | Boolean? | yes | | 1191 | 1192 | --- 1193 | 1194 | 1195 | 1196 | 1197 | #### [UserCredit](#UserCredit) 1198 | 1199 | | Properties | Type | Nullable | Description | 1200 | | ---------- | ---- | -------- | ----------- | 1201 | | availableLimit | Double? | yes | | 1202 | | approvedLimit | Double? | yes | | 1203 | | isEligibleToDrawdown | Boolean? | yes | | 1204 | 1205 | --- 1206 | 1207 | 1208 | 1209 | 1210 | #### [DueTransactionsOutstanding](#DueTransactionsOutstanding) 1211 | 1212 | | Properties | Type | Nullable | Description | 1213 | | ---------- | ---- | -------- | ----------- | 1214 | | loanRequestNo | String? | yes | | 1215 | | merchantCategory | String? | yes | | 1216 | | installmentAmountWithInterest | Double? | yes | | 1217 | | installmentAmount | Double? | yes | | 1218 | | dueAmount | Double? | yes | | 1219 | | loanType | String? | yes | | 1220 | | installmentNo | String? | yes | | 1221 | | installmentDueDate | String? | yes | | 1222 | | isPastDue | Boolean? | yes | | 1223 | | isPenaltyCharged | Boolean? | yes | | 1224 | | penaltyAmount | Double? | yes | | 1225 | | noOfDaysPenaltyCharged | Integer? | yes | | 1226 | | daysDifference | Integer? | yes | | 1227 | | lenderTransactionId | String? | yes | | 1228 | 1229 | --- 1230 | 1231 | 1232 | 1233 | 1234 | #### [RepaymentSummaryOutstanding](#RepaymentSummaryOutstanding) 1235 | 1236 | | Properties | Type | Nullable | Description | 1237 | | ---------- | ---- | -------- | ----------- | 1238 | | loanRequestNo | String? | yes | | 1239 | | loanType | String? | yes | | 1240 | | merchantCategory | String? | yes | | 1241 | | isBbillingTransaction | Boolean? | yes | | 1242 | | totalInstallmentAmount | Integer? | yes | | 1243 | | totalInstallmentAmountWithInterest | Integer? | yes | | 1244 | | outstandingDetails | ArrayList<[OutstandingDetailsRepayment](#OutstandingDetailsRepayment)>? | yes | | 1245 | 1246 | --- 1247 | 1248 | 1249 | 1250 | 1251 | #### [OutstandingDetailsRepayment](#OutstandingDetailsRepayment) 1252 | 1253 | | Properties | Type | Nullable | Description | 1254 | | ---------- | ---- | -------- | ----------- | 1255 | | installmentAmountWithInterest | Double? | yes | | 1256 | | installmentAmount | Double? | yes | | 1257 | | dueAmount | Double? | yes | | 1258 | | installmentNo | String? | yes | | 1259 | | installmentDueDate | String? | yes | | 1260 | | isPastDue | Boolean? | yes | | 1261 | | loanType | String? | yes | | 1262 | | isPenaltyCharged | Boolean? | yes | | 1263 | | penaltyAmount | Integer? | yes | | 1264 | | noOfDaysPenaltyCharged | Integer? | yes | | 1265 | | lenderTransactionId | String? | yes | | 1266 | 1267 | --- 1268 | 1269 | 1270 | 1271 | 1272 | #### [PaymentOptionsResponse](#PaymentOptionsResponse) 1273 | 1274 | | Properties | Type | Nullable | Description | 1275 | | ---------- | ---- | -------- | ----------- | 1276 | | paymentOptions | ArrayList<[PaymentsObject](#PaymentsObject)>? | yes | | 1277 | | headers | HashMap? | yes | | 1278 | 1279 | --- 1280 | 1281 | 1282 | 1283 | 1284 | #### [CheckEMandateStatusRequest](#CheckEMandateStatusRequest) 1285 | 1286 | | Properties | Type | Nullable | Description | 1287 | | ---------- | ---- | -------- | ----------- | 1288 | | orderId | String? | yes | | 1289 | | paymentId | String? | yes | | 1290 | | scheduledEnd | String? | yes | | 1291 | | ruleAmountValue | String? | yes | | 1292 | 1293 | --- 1294 | 1295 | 1296 | 1297 | 1298 | #### [AutoPayStatusResponse](#AutoPayStatusResponse) 1299 | 1300 | | Properties | Type | Nullable | Description | 1301 | | ---------- | ---- | -------- | ----------- | 1302 | | status | String? | yes | | 1303 | | headers | HashMap? | yes | | 1304 | 1305 | --- 1306 | 1307 | 1308 | 1309 | 1310 | #### [OutstandingData](#OutstandingData) 1311 | 1312 | | Properties | Type | Nullable | Description | 1313 | | ---------- | ---- | -------- | ----------- | 1314 | | lenderDetails | [LenderDetails](#LenderDetails)? | yes | | 1315 | | availableLimit | Double | no | | 1316 | | creditLimit | Double | no | | 1317 | | dueAmount | Double? | yes | | 1318 | | outstandingAmount | Double? | yes | | 1319 | | dueDate | String? | yes | | 1320 | 1321 | --- 1322 | 1323 | 1324 | 1325 | 1326 | #### [OutstandingDetailsData](#OutstandingDetailsData) 1327 | 1328 | | Properties | Type | Nullable | Description | 1329 | | ---------- | ---- | -------- | ----------- | 1330 | | outstandingDetails | ArrayList<[OutstandingData](#OutstandingData)> | no | | 1331 | 1332 | --- 1333 | 1334 | 1335 | 1336 | 1337 | #### [OutstandingDetailsResponse](#OutstandingDetailsResponse) 1338 | 1339 | | Properties | Type | Nullable | Description | 1340 | | ---------- | ---- | -------- | ----------- | 1341 | | message | String | no | | 1342 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | no | | 1343 | | data | [OutstandingDetailsData](#OutstandingDetailsData) | no | | 1344 | 1345 | --- 1346 | 1347 | 1348 | 1349 | 1350 | #### [VerifyUPIRequest](#VerifyUPIRequest) 1351 | 1352 | | Properties | Type | Nullable | Description | 1353 | | ---------- | ---- | -------- | ----------- | 1354 | | vpa | String | no | The Virtual Payment Address (VPA) for UPI. | 1355 | | lenderSlug | String? | yes | The lender slug associated with the request. Optional parameter. | 1356 | 1357 | --- 1358 | 1359 | 1360 | 1361 | 1362 | #### [UPIValidationSuccessResponse](#UPIValidationSuccessResponse) 1363 | 1364 | | Properties | Type | Nullable | Description | 1365 | | ---------- | ---- | -------- | ----------- | 1366 | | status | String? | yes | | 1367 | | name | String? | yes | | 1368 | | headers | HashMap? | yes | | 1369 | 1370 | --- 1371 | 1372 | 1373 | 1374 | -------------------------------------------------------------------------------- /documentation/application/TRANSACTION.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ##### [Back to Application docs](./README.md) 6 | 7 | ## Transaction Methods 8 | Transaction Service 9 | * [disburse](#disburse) 10 | * [plans](#plans) 11 | * [kfs](#kfs) 12 | * [registerTransaction](#registertransaction) 13 | * [updateTransaction](#updatetransaction) 14 | * [split](#split) 15 | * [listOfTransactions](#listoftransactions) 16 | * [loadTransactionById](#loadtransactionbyid) 17 | 18 | 19 | 20 | ## Methods with example and description 21 | 22 | 23 | ### disburse 24 | Disburse the credit 25 | 26 | 27 | 28 | 29 | ```java 30 | transaction.disburse( lenderSlug, body body) { 31 | //use response 32 | } 33 | ``` 34 | 35 | 36 | 37 | | Argument | Type | Required | Description | 38 | | --------- | ----- | -------- | ----------- | 39 | | lenderSlug | String | yes | This is lender slug | 40 | | body | [DisbursalRequest](#DisbursalRequest) | yes | Request body | 41 | 42 | 43 | Use this API to disburse the credit. 44 | 45 | *Returned Response:* 46 | 47 | 48 | 49 | 50 | [DisbursalResponse](#DisbursalResponse) 51 | 52 | Success. Returns a JSON object as shown below. Refer `DisbursalResponse` for more details. 53 | 54 | 55 | 56 | 57 |
58 |   Examples: 59 | 60 | 61 |
62 |   success 63 | 64 | ```json 65 | true 66 | ``` 67 |
68 | 69 |
70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | --- 80 | 81 | 82 | ### plans 83 | Disburse the credit 84 | 85 | 86 | 87 | 88 | ```java 89 | transaction.plans( lenderSlug, body body) { 90 | //use response 91 | } 92 | ``` 93 | 94 | 95 | 96 | | Argument | Type | Required | Description | 97 | | --------- | ----- | -------- | ----------- | 98 | | lenderSlug | String | yes | This is lender slug | 99 | | body | [EligiblePlansRequest](#EligiblePlansRequest) | yes | Request body | 100 | 101 | 102 | Use this API to disburse the credit. 103 | 104 | *Returned Response:* 105 | 106 | 107 | 108 | 109 | [EligiblePlansResponse](#EligiblePlansResponse) 110 | 111 | Success. Returns a JSON object as shown below. Refer `EligiblePlansResponse` for more details. 112 | 113 | 114 | 115 | 116 |
117 |   Examples: 118 | 119 | 120 |
121 |   success 122 | 123 | ```json 124 | true 125 | ``` 126 |
127 | 128 |
129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | --- 139 | 140 | 141 | ### kfs 142 | Fetch KFS 143 | 144 | 145 | 146 | 147 | ```java 148 | transaction.kfs( lenderSlug, body body) { 149 | //use response 150 | } 151 | ``` 152 | 153 | 154 | 155 | | Argument | Type | Required | Description | 156 | | --------- | ----- | -------- | ----------- | 157 | | lenderSlug | String | yes | This is lender slug | 158 | | body | [KfsRequest](#KfsRequest) | yes | Request body | 159 | 160 | 161 | Use this API to get kfs. 162 | 163 | *Returned Response:* 164 | 165 | 166 | 167 | 168 | [KfsResponse](#KfsResponse) 169 | 170 | Success. Returns a JSON object as shown below. Refer `Kfs` for more details. 171 | 172 | 173 | 174 | 175 |
176 |   Examples: 177 | 178 | 179 |
180 |   success 181 | 182 | ```json 183 | true 184 | ``` 185 |
186 | 187 |
188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | --- 198 | 199 | 200 | ### registerTransaction 201 | Registers a transaction against an order. 202 | 203 | 204 | 205 | 206 | ```java 207 | transaction.registerTransaction(body body) { 208 | //use response 209 | } 210 | ``` 211 | 212 | 213 | 214 | | Argument | Type | Required | Description | 215 | | --------- | ----- | -------- | ----------- | 216 | | body | [RegisterTransaction](#RegisterTransaction) | yes | Request body | 217 | 218 | 219 | This endpoint uses ONBOARDING TOKEN responsible for creating a new transaction record in the database with states such as PENDING or CANCELLED, based on the provided details. 220 | 221 | *Returned Response:* 222 | 223 | 224 | 225 | 226 | [RegisterTransactionResponse](#RegisterTransactionResponse) 227 | 228 | Success. Returns a JSON object as shown below. Refer `RegisterTransactionResponse` for more details. 229 | 230 | 231 | 232 | 233 |
234 |   Example: 235 | 236 | ```json 237 | 238 | ``` 239 |
240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | --- 250 | 251 | 252 | ### updateTransaction 253 | Updates a transaction's status to CANCELLED in the database. 254 | 255 | 256 | 257 | 258 | ```java 259 | transaction.updateTransaction(body body) { 260 | //use response 261 | } 262 | ``` 263 | 264 | 265 | 266 | | Argument | Type | Required | Description | 267 | | --------- | ----- | -------- | ----------- | 268 | | body | [UpdateTransactionRequest](#UpdateTransactionRequest) | yes | Request body | 269 | 270 | 271 | This endpoint uses CHARGE_TOKEN to update the status of a transaction and its associated order to CANCELLED, effectively marking the transaction as void. 272 | 273 | *Returned Response:* 274 | 275 | 276 | 277 | 278 | [UpdateTransactionResponse](#UpdateTransactionResponse) 279 | 280 | Transaction updated successfully. Refer `UpdateTransactionResponse` schema for response format. 281 | 282 | 283 | 284 | 285 |
286 |   Example: 287 | 288 | ```json 289 | 290 | ``` 291 |
292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | --- 302 | 303 | 304 | ### split 305 | Split transaction. 306 | 307 | 308 | 309 | 310 | ```java 311 | transaction.split( lenderSlug, body body) { 312 | //use response 313 | } 314 | ``` 315 | 316 | 317 | 318 | | Argument | Type | Required | Description | 319 | | --------- | ----- | -------- | ----------- | 320 | | lenderSlug | String | yes | This is lender slug | 321 | | body | [SplitTransactionRequest](#SplitTransactionRequest) | yes | Request body | 322 | 323 | 324 | Use this API to perform split transaction 325 | 326 | *Returned Response:* 327 | 328 | 329 | 330 | 331 | [SplitTransactionResponse](#SplitTransactionResponse) 332 | 333 | Success. Returns a JSON object as shown below. Refer `SplitTransactionResponse` for more details. 334 | 335 | 336 | 337 | 338 |
339 |   Examples: 340 | 341 | 342 |
343 |   parentTransaction 344 | 345 | ```json 346 | { 347 | "id": "transaction.id", 348 | "amount": "transaction.amount", 349 | "status": "transaction.status", 350 | "type": "DEBIT", 351 | "subtype": "SPLIT_TRANSACTION" 352 | } 353 | ``` 354 |
355 | 356 |
357 |   loanTransaction 358 | 359 | ```json 360 | { 361 | "id": "loanTransaction.id", 362 | "amount": "loanTransaction.amount", 363 | "status": "loanTransaction.status", 364 | "type": "DEBIT", 365 | "subtype": "DEBIT" 366 | } 367 | ``` 368 |
369 | 370 |
371 |   downpaymentTransaction 372 | 373 | ```json 374 | { 375 | "id": "downpaymentTransaction.id", 376 | "amount": "downpaymentTransaction.amount", 377 | "status": "downpaymentTransaction.status", 378 | "type": "DEBIT", 379 | "subtype": "MERCHANT_DP" 380 | } 381 | ``` 382 |
383 | 384 |
385 |   lenderDownpaymentTransaction 386 | 387 | ```json 388 | { 389 | "id": "lenderDownpaymentTransaction.id", 390 | "amount": "lenderDownpaymentTransaction.amount", 391 | "status": "lenderDownpaymentTransaction.status", 392 | "type": "DEBIT", 393 | "subtype": "LENDER_DP" 394 | } 395 | ``` 396 |
397 | 398 |
399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | --- 409 | 410 | 411 | ### listOfTransactions 412 | Get List of transactions 413 | 414 | 415 | 416 | 417 | ```java 418 | transaction.listOfTransactions( page, type, lender, loanType, limit) { 419 | //use response 420 | } 421 | ``` 422 | 423 | 424 | 425 | | Argument | Type | Required | Description | 426 | | --------- | ----- | -------- | ----------- | 427 | | page | Integer | yes | This is page number | 428 | | type | List? | no | This is transaction type | 429 | | lender | String? | no | This is lenderSlug | 430 | | loanType | String? | no | This is loanType EMI/BNPL | 431 | | limit | Integer | yes | This is no of transaction | 432 | 433 | 434 | 435 | Use this API to get list of user's transaction. 436 | 437 | *Returned Response:* 438 | 439 | 440 | 441 | 442 | [TransactionResponse](#TransactionResponse) 443 | 444 | Success. Returns a JSON object as shown below. Refer `TransactionResponse` for more details. 445 | 446 | 447 | 448 | 449 |
450 |   Example: 451 | 452 | ```json 453 | [ 454 | { 455 | "id": 1, 456 | "type": "credit", 457 | "amount": "10000", 458 | "remark": "Potlee credit" 459 | } 460 | ] 461 | ``` 462 |
463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | --- 473 | 474 | 475 | ### loadTransactionById 476 | Get transaction details 477 | 478 | 479 | 480 | 481 | ```java 482 | transaction.loadTransactionById( transactionId) { 483 | //use response 484 | } 485 | ``` 486 | 487 | 488 | 489 | | Argument | Type | Required | Description | 490 | | --------- | ----- | -------- | ----------- | 491 | | transactionId | String | yes | This is transaction id | 492 | 493 | 494 | 495 | Use this API to get transaction details by transaction id. 496 | 497 | *Returned Response:* 498 | 499 | 500 | 501 | 502 | [TransactionDetails](#TransactionDetails) 503 | 504 | Success. Returns a JSON object as shown below. Refer `TransactionDetails` for more details. 505 | 506 | 507 | 508 | 509 |
510 |   Example: 511 | 512 | ```json 513 | [ 514 | { 515 | "id": 1, 516 | "userId": "123 \"type\":\"credit\"", 517 | "amount": "10000", 518 | "remark": "Potlee credit" 519 | } 520 | ] 521 | ``` 522 |
523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | --- 533 | 534 | 535 | 536 | ### Schemas 537 | 538 | 539 | 540 | #### [ErrorResponse](#ErrorResponse) 541 | 542 | | Properties | Type | Nullable | Description | 543 | | ---------- | ---- | -------- | ----------- | 544 | | message | String? | yes | | 545 | | info | String? | yes | | 546 | | code | String? | yes | | 547 | | requestId | String? | yes | | 548 | | meta | HashMap? | yes | | 549 | 550 | --- 551 | 552 | 553 | 554 | 555 | #### [IntegrationResponseMeta](#IntegrationResponseMeta) 556 | 557 | | Properties | Type | Nullable | Description | 558 | | ---------- | ---- | -------- | ----------- | 559 | | timestamp | String | no | The timestamp when the response was generated. | 560 | | version | String | no | The version of the API. | 561 | | product | String | no | The name of the product or service. | 562 | | requestId | String? | yes | An optional request identifier. | 563 | 564 | --- 565 | 566 | 567 | 568 | 569 | #### [IntegrationResponseError](#IntegrationResponseError) 570 | 571 | | Properties | Type | Nullable | Description | 572 | | ---------- | ---- | -------- | ----------- | 573 | | code | String | no | Error code representing the type of error. | 574 | | message | String | no | A human-readable message providing more details about the error. | 575 | | exception | String | no | The exception name or type. | 576 | | field | String? | yes | The field associated with the error, if applicable. | 577 | | location | String? | yes | The location of the field, such as 'query', 'param' or 'body'. | 578 | 579 | --- 580 | 581 | 582 | 583 | 584 | #### [IntegrationSuccessResponse](#IntegrationSuccessResponse) 585 | 586 | | Properties | Type | Nullable | Description | 587 | | ---------- | ---- | -------- | ----------- | 588 | | message | String | no | A message indicating the success of the operation. | 589 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | no | | 590 | | data | HashMap | no | The data payload of the response. The structure of this object will vary depending on the specific API endpoint. | 591 | 592 | --- 593 | 594 | 595 | 596 | 597 | #### [IntegrationErrorResponse](#IntegrationErrorResponse) 598 | 599 | | Properties | Type | Nullable | Description | 600 | | ---------- | ---- | -------- | ----------- | 601 | | message | String | no | A message indicating the failure of the operation. | 602 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | no | | 603 | | errors | ArrayList<[IntegrationResponseError](#IntegrationResponseError)>? | yes | | 604 | 605 | --- 606 | 607 | 608 | 609 | 610 | #### [DisbursalRequest](#DisbursalRequest) 611 | 612 | | Properties | Type | Nullable | Description | 613 | | ---------- | ---- | -------- | ----------- | 614 | | fingerprint | String? | yes | | 615 | | chargeToken | String | no | | 616 | | loanTypeId | Double? | yes | | 617 | | emiTenure | Double? | yes | | 618 | | isDownpaymentRequired | Boolean? | yes | | 619 | | downpaymentAmount | Double? | yes | | 620 | | loanAmount | Double? | yes | | 621 | | data | HashMap? | yes | | 622 | | transactionId | String? | yes | | 623 | | lenderSlug | String? | yes | | 624 | | intent | String? | yes | | 625 | 626 | --- 627 | 628 | 629 | 630 | 631 | #### [WorkflowUser](#WorkflowUser) 632 | 633 | | Properties | Type | Nullable | Description | 634 | | ---------- | ---- | -------- | ----------- | 635 | | mobile | String? | yes | | 636 | 637 | --- 638 | 639 | 640 | 641 | 642 | #### [EligiblePlansRequest](#EligiblePlansRequest) 643 | 644 | | Properties | Type | Nullable | Description | 645 | | ---------- | ---- | -------- | ----------- | 646 | | chargeToken | String? | yes | | 647 | 648 | --- 649 | 650 | 651 | 652 | 653 | #### [EligiblePlans](#EligiblePlans) 654 | 655 | | Properties | Type | Nullable | Description | 656 | | ---------- | ---- | -------- | ----------- | 657 | | name | String? | yes | | 658 | | displayName | String? | yes | | 659 | | description | String? | yes | | 660 | | brokenInterest | Double? | yes | | 661 | | noOfEmi | Double? | yes | | 662 | | emiAmount | Double? | yes | | 663 | | processingFee | Double? | yes | | 664 | | installmentInterestRate | Double? | yes | | 665 | 666 | --- 667 | 668 | 669 | 670 | 671 | #### [EligiblePlansResponse](#EligiblePlansResponse) 672 | 673 | | Properties | Type | Nullable | Description | 674 | | ---------- | ---- | -------- | ----------- | 675 | | eligiblePlans | ArrayList<[EligiblePlans](#EligiblePlans)>? | yes | | 676 | | headers | HashMap? | yes | | 677 | 678 | --- 679 | 680 | 681 | 682 | 683 | #### [DisbursalResponse](#DisbursalResponse) 684 | 685 | | Properties | Type | Nullable | Description | 686 | | ---------- | ---- | -------- | ----------- | 687 | | transactionId | String? | yes | | 688 | | status | String? | yes | | 689 | | message | String? | yes | | 690 | | headers | HashMap? | yes | | 691 | 692 | --- 693 | 694 | 695 | 696 | 697 | #### [OrderStatus](#OrderStatus) 698 | 699 | | Properties | Type | Nullable | Description | 700 | | ---------- | ---- | -------- | ----------- | 701 | | orderId | String | no | | 702 | | transactionId | String? | yes | | 703 | | status | String | no | | 704 | | message | String | no | | 705 | 706 | --- 707 | 708 | 709 | 710 | 711 | #### [DisbursalStatusRequest](#DisbursalStatusRequest) 712 | 713 | | Properties | Type | Nullable | Description | 714 | | ---------- | ---- | -------- | ----------- | 715 | | fingerprint | String? | yes | | 716 | | transactionId | String | no | | 717 | 718 | --- 719 | 720 | 721 | 722 | 723 | #### [Transactions](#Transactions) 724 | 725 | | Properties | Type | Nullable | Description | 726 | | ---------- | ---- | -------- | ----------- | 727 | | id | String | no | | 728 | | userId | String | no | | 729 | | partnerId | String? | yes | | 730 | | partner | String? | yes | | 731 | | partnerLogo | String? | yes | | 732 | | status | String | no | | 733 | | type | String? | yes | | 734 | | remark | String? | yes | | 735 | | amount | Double | no | | 736 | | loanAccountNumber | String? | yes | | 737 | | kfs | String? | yes | | 738 | | utr | String? | yes | | 739 | | sanctionLetter | String? | yes | | 740 | | orderId | String? | yes | | 741 | | refundId | String? | yes | | 742 | | createdAt | String | no | | 743 | | lenderId | String? | yes | | 744 | | lenderName | String? | yes | | 745 | | lenderLogo | String? | yes | | 746 | | loanType | String? | yes | | 747 | | nextDueDate | String? | yes | | 748 | | paidPercent | Double? | yes | | 749 | | lenderDetail | [LenderDetail](#LenderDetail)? | yes | | 750 | | emis | ArrayList<[Emi](#Emi)>? | yes | | 751 | 752 | --- 753 | 754 | 755 | 756 | 757 | #### [GroupedEmiLoanAccount](#GroupedEmiLoanAccount) 758 | 759 | | Properties | Type | Nullable | Description | 760 | | ---------- | ---- | -------- | ----------- | 761 | | loanAccountNumber | String | no | | 762 | | kfs | String? | yes | | 763 | | sanctionLetter | String? | yes | | 764 | | remark | String? | yes | | 765 | | createdAt | String | no | | 766 | | updatedAt | String | no | | 767 | | amount | Double | no | | 768 | | repaidAmount | Double | no | | 769 | | paid | Boolean | no | | 770 | | overdue | Boolean | no | | 771 | | repaymentDate | String? | yes | | 772 | | paidPercent | Double | no | | 773 | | lenderDetail | [LenderDetail](#LenderDetail) | no | | 774 | 775 | --- 776 | 777 | 778 | 779 | 780 | #### [GroupedEmi](#GroupedEmi) 781 | 782 | | Properties | Type | Nullable | Description | 783 | | ---------- | ---- | -------- | ----------- | 784 | | id | String? | yes | | 785 | | installmentno | Double? | yes | | 786 | | amount | Double? | yes | | 787 | | dueDate | String? | yes | | 788 | | referenceTransactionId | String? | yes | | 789 | | createdAt | String? | yes | | 790 | | updatedAt | String? | yes | | 791 | | paid | Boolean? | yes | | 792 | | overdue | Boolean? | yes | | 793 | | repaymentDate | String? | yes | | 794 | | paidPercent | Double? | yes | | 795 | | repaidAmount | Double? | yes | | 796 | | loanAccounts | ArrayList<[GroupedEmiLoanAccount](#GroupedEmiLoanAccount)>? | yes | | 797 | 798 | --- 799 | 800 | 801 | 802 | 803 | #### [TransactionDetails](#TransactionDetails) 804 | 805 | | Properties | Type | Nullable | Description | 806 | | ---------- | ---- | -------- | ----------- | 807 | | id | String | no | | 808 | | userId | String | no | | 809 | | partnerId | String | no | | 810 | | partner | String | no | | 811 | | partnerLogo | String | no | | 812 | | status | String | no | | 813 | | type | String? | yes | | 814 | | remark | String? | yes | | 815 | | amount | Double | no | | 816 | | loanAccountNumber | String? | yes | | 817 | | kfs | String? | yes | | 818 | | utr | String? | yes | | 819 | | sanctionLetter | String? | yes | | 820 | | orderId | String? | yes | | 821 | | refundId | String? | yes | | 822 | | createdAt | String | no | | 823 | | lenderId | String? | yes | | 824 | | lenderName | String? | yes | | 825 | | lenderLogo | String? | yes | | 826 | | loanType | String? | yes | | 827 | | nextDueDate | String? | yes | | 828 | | paidPercent | Double? | yes | | 829 | | lenderDetail | [LenderDetail](#LenderDetail)? | yes | | 830 | | emis | ArrayList<[GroupedEmi](#GroupedEmi)>? | yes | | 831 | | summary | [TransactionSummary](#TransactionSummary)? | yes | | 832 | | headers | HashMap? | yes | | 833 | 834 | --- 835 | 836 | 837 | 838 | 839 | #### [TransactionSummary](#TransactionSummary) 840 | 841 | | Properties | Type | Nullable | Description | 842 | | ---------- | ---- | -------- | ----------- | 843 | | capturedAmount | Double | no | The total captured amount. This is the sum of the amounts of all captured shipments. | 844 | | uncapturedAmount | Double | no | The total uncaptured amount. This is calculated as totalAmount - capturedAmount. | 845 | | capturedAmountForDisbursal | Double | no | The total amount captured for disbursal. This represents the sum of amounts from all shipments marked for disbursal. | 846 | | capturedAmountForCancellation | Double | no | The total amount captured for cancellation. This aggregates the amounts from all shipments identified for cancellation. | 847 | | data | ArrayList<[TransactionSummaryData](#TransactionSummaryData)> | no | | 848 | 849 | --- 850 | 851 | 852 | 853 | 854 | #### [TransactionSummaryData](#TransactionSummaryData) 855 | 856 | | Properties | Type | Nullable | Description | 857 | | ---------- | ---- | -------- | ----------- | 858 | | display | [TransactionSummaryDataDisplay](#TransactionSummaryDataDisplay)? | yes | | 859 | 860 | --- 861 | 862 | 863 | 864 | 865 | #### [TransactionSummaryDataDisplay](#TransactionSummaryDataDisplay) 866 | 867 | | Properties | Type | Nullable | Description | 868 | | ---------- | ---- | -------- | ----------- | 869 | | primary | [TransactionSummaryDataDisplayType](#TransactionSummaryDataDisplayType)? | yes | | 870 | | secondary | [TransactionSummaryDataDisplayType](#TransactionSummaryDataDisplayType)? | yes | | 871 | 872 | --- 873 | 874 | 875 | 876 | 877 | #### [TransactionSummaryDataDisplayType](#TransactionSummaryDataDisplayType) 878 | 879 | | Properties | Type | Nullable | Description | 880 | | ---------- | ---- | -------- | ----------- | 881 | | text | String? | yes | | 882 | 883 | --- 884 | 885 | 886 | 887 | 888 | #### [LenderDetail](#LenderDetail) 889 | 890 | | Properties | Type | Nullable | Description | 891 | | ---------- | ---- | -------- | ----------- | 892 | | id | String? | yes | | 893 | | name | String? | yes | | 894 | | imageUrl | String? | yes | | 895 | | slug | String? | yes | | 896 | | active | Boolean? | yes | | 897 | | b2B | Boolean? | yes | | 898 | | b2C | Boolean? | yes | | 899 | | theme | [Theme](#Theme)? | yes | | 900 | | createdAt | String? | yes | | 901 | | updatedAt | String? | yes | | 902 | | deletedAt | String? | yes | | 903 | 904 | --- 905 | 906 | 907 | 908 | 909 | #### [FilterKeys](#FilterKeys) 910 | 911 | | Properties | Type | Nullable | Description | 912 | | ---------- | ---- | -------- | ----------- | 913 | | display | String? | yes | | 914 | | name | String? | yes | | 915 | | kind | String? | yes | | 916 | 917 | --- 918 | 919 | 920 | 921 | 922 | #### [FilterValues](#FilterValues) 923 | 924 | | Properties | Type | Nullable | Description | 925 | | ---------- | ---- | -------- | ----------- | 926 | | display | String? | yes | | 927 | | isSelected | Boolean? | yes | | 928 | | value | String? | yes | | 929 | 930 | --- 931 | 932 | 933 | 934 | 935 | #### [Filters](#Filters) 936 | 937 | | Properties | Type | Nullable | Description | 938 | | ---------- | ---- | -------- | ----------- | 939 | | key | [FilterKeys](#FilterKeys)? | yes | | 940 | | values | ArrayList<[FilterValues](#FilterValues)>? | yes | | 941 | 942 | --- 943 | 944 | 945 | 946 | 947 | #### [PageResponse](#PageResponse) 948 | 949 | | Properties | Type | Nullable | Description | 950 | | ---------- | ---- | -------- | ----------- | 951 | | type | String | no | | 952 | | current | Integer | no | | 953 | | hasPrevious | Boolean | no | | 954 | | hasNext | Boolean | no | | 955 | | size | Integer | no | | 956 | | itemTotal | Integer | no | | 957 | 958 | --- 959 | 960 | 961 | 962 | 963 | #### [FilterByDate](#FilterByDate) 964 | 965 | | Properties | Type | Nullable | Description | 966 | | ---------- | ---- | -------- | ----------- | 967 | | startDate | String? | yes | | 968 | | endDate | String? | yes | | 969 | 970 | --- 971 | 972 | 973 | 974 | 975 | #### [TransactionResponse](#TransactionResponse) 976 | 977 | | Properties | Type | Nullable | Description | 978 | | ---------- | ---- | -------- | ----------- | 979 | | filters | ArrayList<[Filters](#Filters)> | no | | 980 | | page | [PageResponse](#PageResponse) | no | | 981 | | transactions | ArrayList<[Transactions](#Transactions)> | no | | 982 | | headers | HashMap? | yes | | 983 | 984 | --- 985 | 986 | 987 | 988 | 989 | #### [GetReconciliationFileResponse](#GetReconciliationFileResponse) 990 | 991 | | Properties | Type | Nullable | Description | 992 | | ---------- | ---- | -------- | ----------- | 993 | | files | ArrayList<[ReconFile](#ReconFile)> | no | | 994 | 995 | --- 996 | 997 | 998 | 999 | 1000 | #### [ReconFile](#ReconFile) 1001 | 1002 | | Properties | Type | Nullable | Description | 1003 | | ---------- | ---- | -------- | ----------- | 1004 | | base64 | String | no | | 1005 | | name | String | no | | 1006 | 1007 | --- 1008 | 1009 | 1010 | 1011 | 1012 | #### [UploadReconciliationFileRequest](#UploadReconciliationFileRequest) 1013 | 1014 | | Properties | Type | Nullable | Description | 1015 | | ---------- | ---- | -------- | ----------- | 1016 | | base64File | String | no | | 1017 | | format | String? | yes | | 1018 | | lenderId | String? | yes | | 1019 | 1020 | --- 1021 | 1022 | 1023 | 1024 | 1025 | #### [UploadReconciliationFileResponse](#UploadReconciliationFileResponse) 1026 | 1027 | | Properties | Type | Nullable | Description | 1028 | | ---------- | ---- | -------- | ----------- | 1029 | | success | Boolean? | yes | | 1030 | 1031 | --- 1032 | 1033 | 1034 | 1035 | 1036 | #### [TransactionCount](#TransactionCount) 1037 | 1038 | | Properties | Type | Nullable | Description | 1039 | | ---------- | ---- | -------- | ----------- | 1040 | | totalTransactions | String? | yes | | 1041 | 1042 | --- 1043 | 1044 | 1045 | 1046 | 1047 | #### [RefundCount](#RefundCount) 1048 | 1049 | | Properties | Type | Nullable | Description | 1050 | | ---------- | ---- | -------- | ----------- | 1051 | | refundTransactions | String? | yes | | 1052 | 1053 | --- 1054 | 1055 | 1056 | 1057 | 1058 | #### [OrganizationTransactionsCount](#OrganizationTransactionsCount) 1059 | 1060 | | Properties | Type | Nullable | Description | 1061 | | ---------- | ---- | -------- | ----------- | 1062 | | count | Double? | yes | | 1063 | 1064 | --- 1065 | 1066 | 1067 | 1068 | 1069 | #### [OrganizationTransactionsSum](#OrganizationTransactionsSum) 1070 | 1071 | | Properties | Type | Nullable | Description | 1072 | | ---------- | ---- | -------- | ----------- | 1073 | | sum | Double? | yes | | 1074 | 1075 | --- 1076 | 1077 | 1078 | 1079 | 1080 | #### [UniqueCustomersInOrg](#UniqueCustomersInOrg) 1081 | 1082 | | Properties | Type | Nullable | Description | 1083 | | ---------- | ---- | -------- | ----------- | 1084 | | count | Double? | yes | | 1085 | 1086 | --- 1087 | 1088 | 1089 | 1090 | 1091 | #### [TransactionAmount](#TransactionAmount) 1092 | 1093 | | Properties | Type | Nullable | Description | 1094 | | ---------- | ---- | -------- | ----------- | 1095 | | totalTransactionAmount | String? | yes | | 1096 | 1097 | --- 1098 | 1099 | 1100 | 1101 | 1102 | #### [SchemaForOneDayTotal](#SchemaForOneDayTotal) 1103 | 1104 | | Properties | Type | Nullable | Description | 1105 | | ---------- | ---- | -------- | ----------- | 1106 | | orgId | String? | yes | | 1107 | | createdAt | String? | yes | | 1108 | | count | Double? | yes | | 1109 | | sum | String? | yes | | 1110 | | refund | String? | yes | | 1111 | | difference | String? | yes | | 1112 | 1113 | --- 1114 | 1115 | 1116 | 1117 | 1118 | #### [SumofOneDayTransactions](#SumofOneDayTransactions) 1119 | 1120 | | Properties | Type | Nullable | Description | 1121 | | ---------- | ---- | -------- | ----------- | 1122 | | dayTotal | ArrayList<[SchemaForOneDayTotal](#SchemaForOneDayTotal)>? | yes | | 1123 | 1124 | --- 1125 | 1126 | 1127 | 1128 | 1129 | #### [AverageTransaction](#AverageTransaction) 1130 | 1131 | | Properties | Type | Nullable | Description | 1132 | | ---------- | ---- | -------- | ----------- | 1133 | | average | Double? | yes | | 1134 | 1135 | --- 1136 | 1137 | 1138 | 1139 | 1140 | #### [AllTransactionsResponse](#AllTransactionsResponse) 1141 | 1142 | | Properties | Type | Nullable | Description | 1143 | | ---------- | ---- | -------- | ----------- | 1144 | | id | String? | yes | | 1145 | | userId | String? | yes | | 1146 | | partnerId | String? | yes | | 1147 | | status | String? | yes | | 1148 | | type | String? | yes | | 1149 | | remark | String? | yes | | 1150 | | amount | Double? | yes | | 1151 | | loanAccountNumber | String? | yes | | 1152 | | createdAt | String? | yes | | 1153 | 1154 | --- 1155 | 1156 | 1157 | 1158 | 1159 | #### [TotalRefund](#TotalRefund) 1160 | 1161 | | Properties | Type | Nullable | Description | 1162 | | ---------- | ---- | -------- | ----------- | 1163 | | totalRefund | String? | yes | | 1164 | 1165 | --- 1166 | 1167 | 1168 | 1169 | 1170 | #### [TotalRepayment](#TotalRepayment) 1171 | 1172 | | Properties | Type | Nullable | Description | 1173 | | ---------- | ---- | -------- | ----------- | 1174 | | totalRepayment | String? | yes | | 1175 | 1176 | --- 1177 | 1178 | 1179 | 1180 | 1181 | #### [TotalOverDue](#TotalOverDue) 1182 | 1183 | | Properties | Type | Nullable | Description | 1184 | | ---------- | ---- | -------- | ----------- | 1185 | | totalDue | String? | yes | | 1186 | 1187 | --- 1188 | 1189 | 1190 | 1191 | 1192 | #### [TotalLoansDisbursed](#TotalLoansDisbursed) 1193 | 1194 | | Properties | Type | Nullable | Description | 1195 | | ---------- | ---- | -------- | ----------- | 1196 | | totalLoansDisbursed | String? | yes | | 1197 | 1198 | --- 1199 | 1200 | 1201 | 1202 | 1203 | #### [OrganizationTransactionResponse](#OrganizationTransactionResponse) 1204 | 1205 | | Properties | Type | Nullable | Description | 1206 | | ---------- | ---- | -------- | ----------- | 1207 | | filters | ArrayList<[TrFilters](#TrFilters)> | no | | 1208 | | page | [TrPageResponse](#TrPageResponse) | no | | 1209 | | transactions | ArrayList<[OrgTransactions](#OrgTransactions)> | no | | 1210 | 1211 | --- 1212 | 1213 | 1214 | 1215 | 1216 | #### [TrFilters](#TrFilters) 1217 | 1218 | | Properties | Type | Nullable | Description | 1219 | | ---------- | ---- | -------- | ----------- | 1220 | | key | [TrFilterKeys](#TrFilterKeys)? | yes | | 1221 | | values | ArrayList<[TrFilterValues](#TrFilterValues)>? | yes | | 1222 | 1223 | --- 1224 | 1225 | 1226 | 1227 | 1228 | #### [TrPageResponse](#TrPageResponse) 1229 | 1230 | | Properties | Type | Nullable | Description | 1231 | | ---------- | ---- | -------- | ----------- | 1232 | | type | String | no | | 1233 | | current | Double | no | | 1234 | | hasPrevious | Boolean | no | | 1235 | | hasNext | Boolean | no | | 1236 | | size | Double | no | | 1237 | | itemTotal | Double | no | | 1238 | 1239 | --- 1240 | 1241 | 1242 | 1243 | 1244 | #### [OrgTransactions](#OrgTransactions) 1245 | 1246 | | Properties | Type | Nullable | Description | 1247 | | ---------- | ---- | -------- | ----------- | 1248 | | id | String | no | | 1249 | | userId | String | no | | 1250 | | userName | String? | yes | | 1251 | | partnerId | String? | yes | | 1252 | | partner | String? | yes | | 1253 | | partnerLogo | String? | yes | | 1254 | | status | String | no | | 1255 | | type | String? | yes | | 1256 | | remark | String? | yes | | 1257 | | amount | Double | no | | 1258 | | orderId | String? | yes | | 1259 | | loanAccountNumber | String? | yes | | 1260 | | kfs | String? | yes | | 1261 | | sanctionLetter | String? | yes | | 1262 | | createdAt | String | no | | 1263 | 1264 | --- 1265 | 1266 | 1267 | 1268 | 1269 | #### [TrFilterKeys](#TrFilterKeys) 1270 | 1271 | | Properties | Type | Nullable | Description | 1272 | | ---------- | ---- | -------- | ----------- | 1273 | | display | String? | yes | | 1274 | | name | String? | yes | | 1275 | | kind | String? | yes | | 1276 | 1277 | --- 1278 | 1279 | 1280 | 1281 | 1282 | #### [TrFilterValues](#TrFilterValues) 1283 | 1284 | | Properties | Type | Nullable | Description | 1285 | | ---------- | ---- | -------- | ----------- | 1286 | | display | String? | yes | | 1287 | | isSelected | Boolean? | yes | | 1288 | | value | String? | yes | | 1289 | 1290 | --- 1291 | 1292 | 1293 | 1294 | 1295 | #### [KfsRequest](#KfsRequest) 1296 | 1297 | | Properties | Type | Nullable | Description | 1298 | | ---------- | ---- | -------- | ----------- | 1299 | | loanTypeId | Double? | yes | | 1300 | | chargeToken | String? | yes | | 1301 | 1302 | --- 1303 | 1304 | 1305 | 1306 | 1307 | #### [KfsResponse](#KfsResponse) 1308 | 1309 | | Properties | Type | Nullable | Description | 1310 | | ---------- | ---- | -------- | ----------- | 1311 | | kfsTable | String? | yes | | 1312 | | headers | HashMap? | yes | | 1313 | 1314 | --- 1315 | 1316 | 1317 | 1318 | 1319 | #### [LenderTransactionState](#LenderTransactionState) 1320 | 1321 | | Properties | Type | Nullable | Description | 1322 | | ---------- | ---- | -------- | ----------- | 1323 | | id | String? | yes | | 1324 | | stepIndex | Double? | yes | | 1325 | | lenderId | String? | yes | | 1326 | | workflowId | String? | yes | | 1327 | | workflowName | String? | yes | | 1328 | | parentStateId | String? | yes | | 1329 | | workflowUrl | String? | yes | | 1330 | | isInternal | Boolean? | yes | | 1331 | | active | Boolean? | yes | | 1332 | | ttl | Double? | yes | | 1333 | | name | String? | yes | | 1334 | | type | String? | yes | | 1335 | | inputData | HashMap? | yes | | 1336 | | createdAt | String? | yes | | 1337 | | updatedAt | String? | yes | | 1338 | | deletedAt | String? | yes | | 1339 | 1340 | --- 1341 | 1342 | 1343 | 1344 | 1345 | #### [TransactionStateResponse](#TransactionStateResponse) 1346 | 1347 | | Properties | Type | Nullable | Description | 1348 | | ---------- | ---- | -------- | ----------- | 1349 | | transactionState | ArrayList<[LenderTransactionState](#LenderTransactionState)>? | yes | | 1350 | 1351 | --- 1352 | 1353 | 1354 | 1355 | 1356 | #### [Theme](#Theme) 1357 | 1358 | | Properties | Type | Nullable | Description | 1359 | | ---------- | ---- | -------- | ----------- | 1360 | | logoUrl | String? | yes | | 1361 | | iconUrl | String? | yes | | 1362 | | landscapeBgUrl | String? | yes | | 1363 | | portraitBgUrl | String? | yes | | 1364 | | shortName | String? | yes | | 1365 | 1366 | --- 1367 | 1368 | 1369 | 1370 | 1371 | #### [Emi](#Emi) 1372 | 1373 | | Properties | Type | Nullable | Description | 1374 | | ---------- | ---- | -------- | ----------- | 1375 | | id | String? | yes | | 1376 | | userId | String? | yes | | 1377 | | installmentno | Double? | yes | | 1378 | | loanAccountNumber | String? | yes | | 1379 | | amount | Double? | yes | | 1380 | | dueDate | String? | yes | | 1381 | | referenceTransactionId | String? | yes | | 1382 | | remark | String? | yes | | 1383 | | createdAt | String? | yes | | 1384 | | updatedAt | String? | yes | | 1385 | | entityId | String? | yes | | 1386 | | paid | Boolean? | yes | | 1387 | | overdue | Boolean? | yes | | 1388 | | repaymentDate | String? | yes | | 1389 | 1390 | --- 1391 | 1392 | 1393 | 1394 | 1395 | #### [MetricPivots](#MetricPivots) 1396 | 1397 | | Properties | Type | Nullable | Description | 1398 | | ---------- | ---- | -------- | ----------- | 1399 | | date | String? | yes | | 1400 | | sum | Double? | yes | | 1401 | 1402 | --- 1403 | 1404 | 1405 | 1406 | 1407 | #### [TransactionMetricSubResponse](#TransactionMetricSubResponse) 1408 | 1409 | | Properties | Type | Nullable | Description | 1410 | | ---------- | ---- | -------- | ----------- | 1411 | | total | String? | yes | | 1412 | | pivots | ArrayList<[MetricPivots](#MetricPivots)>? | yes | | 1413 | | title | String? | yes | | 1414 | | description | String? | yes | | 1415 | | valueFormat | String? | yes | | 1416 | | logo | String? | yes | | 1417 | 1418 | --- 1419 | 1420 | 1421 | 1422 | 1423 | #### [TransactionMetrics](#TransactionMetrics) 1424 | 1425 | | Properties | Type | Nullable | Description | 1426 | | ---------- | ---- | -------- | ----------- | 1427 | | totalDisbursement | [TransactionMetricSubResponse](#TransactionMetricSubResponse)? | yes | | 1428 | | totalOverdue | [TransactionMetricSubResponse](#TransactionMetricSubResponse)? | yes | | 1429 | | totalRepayment | [TransactionMetricSubResponse](#TransactionMetricSubResponse)? | yes | | 1430 | 1431 | --- 1432 | 1433 | 1434 | 1435 | 1436 | #### [LenderCustomerTransactionMetricsFilters](#LenderCustomerTransactionMetricsFilters) 1437 | 1438 | | Properties | Type | Nullable | Description | 1439 | | ---------- | ---- | -------- | ----------- | 1440 | | type | String | no | | 1441 | | display | String | no | | 1442 | | value | ArrayList | no | | 1443 | | isSelected | Boolean? | yes | | 1444 | | isActive | Boolean | no | | 1445 | 1446 | --- 1447 | 1448 | 1449 | 1450 | 1451 | #### [LenderCustomerTransactionMetrics](#LenderCustomerTransactionMetrics) 1452 | 1453 | | Properties | Type | Nullable | Description | 1454 | | ---------- | ---- | -------- | ----------- | 1455 | | metrics | [TransactionMetrics](#TransactionMetrics)? | yes | | 1456 | | filters | ArrayList<[LenderCustomerTransactionMetricsFilters](#LenderCustomerTransactionMetricsFilters)>? | yes | | 1457 | | sort | ArrayList<[LenderCustomerTransactionMetricsFilters](#LenderCustomerTransactionMetricsFilters)>? | yes | | 1458 | 1459 | --- 1460 | 1461 | 1462 | 1463 | 1464 | #### [LenderCustomerTransactionMetricsResponse](#LenderCustomerTransactionMetricsResponse) 1465 | 1466 | | Properties | Type | Nullable | Description | 1467 | | ---------- | ---- | -------- | ----------- | 1468 | | data | HashMap? | yes | | 1469 | 1470 | --- 1471 | 1472 | 1473 | 1474 | 1475 | #### [LenderCustomerTransactionMetricsRequest](#LenderCustomerTransactionMetricsRequest) 1476 | 1477 | | Properties | Type | Nullable | Description | 1478 | | ---------- | ---- | -------- | ----------- | 1479 | | filters | ArrayList<[LenderCustomerTransactionMetricsFilters](#LenderCustomerTransactionMetricsFilters)>? | yes | | 1480 | | sort | ArrayList<[LenderCustomerTransactionMetricsFilters](#LenderCustomerTransactionMetricsFilters)>? | yes | | 1481 | | startDate | String? | yes | | 1482 | | endDate | String? | yes | | 1483 | | merchantId | String? | yes | | 1484 | | lenderId | String? | yes | | 1485 | | pivotPoints | Double? | yes | | 1486 | 1487 | --- 1488 | 1489 | 1490 | 1491 | 1492 | #### [OrderShipmentAddressGeoLocation](#OrderShipmentAddressGeoLocation) 1493 | 1494 | | Properties | Type | Nullable | Description | 1495 | | ---------- | ---- | -------- | ----------- | 1496 | | latitude | Double | no | The latitude of the location. | 1497 | | longitude | Double | no | The longitude of the location. | 1498 | 1499 | --- 1500 | 1501 | 1502 | 1503 | 1504 | #### [OrderShipmentAddress](#OrderShipmentAddress) 1505 | 1506 | | Properties | Type | Nullable | Description | 1507 | | ---------- | ---- | -------- | ----------- | 1508 | | line1 | String? | yes | The first line of the address. | 1509 | | line2 | String? | yes | The second line of the address. | 1510 | | city | String? | yes | The city of the address. | 1511 | | state | String? | yes | The state of the address. | 1512 | | country | String? | yes | The country of the address. | 1513 | | pincode | String? | yes | The postal code of the address. | 1514 | | type | String? | yes | The type of address (e.g., residential, business). | 1515 | | geoLocation | [OrderShipmentAddressGeoLocation](#OrderShipmentAddressGeoLocation)? | yes | The geographical location of the address. | 1516 | 1517 | --- 1518 | 1519 | 1520 | 1521 | 1522 | #### [OrderShipmentItem](#OrderShipmentItem) 1523 | 1524 | | Properties | Type | Nullable | Description | 1525 | | ---------- | ---- | -------- | ----------- | 1526 | | category | String? | yes | The category of the item. | 1527 | | sku | String? | yes | The stock keeping unit for the item. | 1528 | | rate | Double? | yes | The price of a single item. | 1529 | | quantity | Double? | yes | The quantity of the item. | 1530 | 1531 | --- 1532 | 1533 | 1534 | 1535 | 1536 | #### [OrderShipment](#OrderShipment) 1537 | 1538 | | Properties | Type | Nullable | Description | 1539 | | ---------- | ---- | -------- | ----------- | 1540 | | id | String | no | The identifier for the shipment. | 1541 | | urn | String? | yes | 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. | 1542 | | amount | Double | no | The amount corresponding to the shipment that is subject to the status update. | 1543 | | timestamp | String | no | The timestamp when the status of the shipment was updated. | 1544 | | status | String | no | The current status of the shipment. | 1545 | | remark | String? | yes | Any remarks regarding the shipment. | 1546 | | items | ArrayList<[OrderShipmentItem](#OrderShipmentItem)>? | yes | The list of items in the shipment. | 1547 | | shippingAddress | [OrderShipmentAddress](#OrderShipmentAddress)? | yes | The shipping address for the shipment. | 1548 | | billingAddress | [OrderShipmentAddress](#OrderShipmentAddress)? | yes | The billing address for the shipment. | 1549 | 1550 | --- 1551 | 1552 | 1553 | 1554 | 1555 | #### [OrderDeliveryUpdatesBody](#OrderDeliveryUpdatesBody) 1556 | 1557 | | Properties | Type | Nullable | Description | 1558 | | ---------- | ---- | -------- | ----------- | 1559 | | orderId | String? | yes | The unique identifier for the order. Required if transactionId is not provided. | 1560 | | transactionId | String? | yes | The unique identifier for the transaction. Required if orderId is not provided. | 1561 | | includeSummary | Boolean? | yes | A flag to include a summary object in the response, containing data like processed amount and unprocessed amount. | 1562 | | shipments | ArrayList<[OrderShipment](#OrderShipment)> | no | The list of shipments for which the status needs to be updated. Only include shipments requiring a status change. | 1563 | 1564 | --- 1565 | 1566 | 1567 | 1568 | 1569 | #### [OrderShipmentSummary](#OrderShipmentSummary) 1570 | 1571 | | Properties | Type | Nullable | Description | 1572 | | ---------- | ---- | -------- | ----------- | 1573 | | orderAmount | Double | no | The total order amount. | 1574 | | capturedAmount | Double | no | The total captured amount. This is the sum of the amounts of all captured shipments. | 1575 | | uncapturedAmount | Double | no | The total uncaptured amount. This is calculated as totalAmount - capturedAmount. | 1576 | | capturedAmountForDisbursal | Double | no | The total amount captured for disbursal. This represents the sum of amounts from all shipments marked for disbursal. | 1577 | | capturedAmountForCancellation | Double | no | The total amount captured for cancellation. This aggregates the amounts from all shipments identified for cancellation. | 1578 | 1579 | --- 1580 | 1581 | 1582 | 1583 | 1584 | #### [OrderShipmentResponse](#OrderShipmentResponse) 1585 | 1586 | | Properties | Type | Nullable | Description | 1587 | | ---------- | ---- | -------- | ----------- | 1588 | | id | String | no | The unique identifier of the shipment. | 1589 | | urn | String | no | A unique resource identifier for the shipment. | 1590 | | shipmentStatus | String | no | The status of the shipment. | 1591 | | shipmentAmount | Double | no | The total amount associated with the shipment. | 1592 | | processingStatus | String | no | The processing status of the order shipment. | 1593 | 1594 | --- 1595 | 1596 | 1597 | 1598 | 1599 | #### [OrderDeliveryUpdatesData](#OrderDeliveryUpdatesData) 1600 | 1601 | | Properties | Type | Nullable | Description | 1602 | | ---------- | ---- | -------- | ----------- | 1603 | | orderId | String | no | The unique identifier for the order. | 1604 | | transactionId | String | no | The unique identifier for the order. | 1605 | | shipments | ArrayList<[OrderShipmentResponse](#OrderShipmentResponse)> | no | The list of shipments for which the status was updated. | 1606 | | summary | [OrderShipmentSummary](#OrderShipmentSummary)? | yes | A summary object containing various amounts related to the order. | 1607 | 1608 | --- 1609 | 1610 | 1611 | 1612 | 1613 | #### [OrderDeliveryUpdatesResponse](#OrderDeliveryUpdatesResponse) 1614 | 1615 | | Properties | Type | Nullable | Description | 1616 | | ---------- | ---- | -------- | ----------- | 1617 | | message | String | no | Response message indicating the result of the operation. | 1618 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | no | | 1619 | | data | [OrderDeliveryUpdatesData](#OrderDeliveryUpdatesData) | no | | 1620 | 1621 | --- 1622 | 1623 | 1624 | 1625 | 1626 | #### [OrderDeliveryUpdatesPartialResponse](#OrderDeliveryUpdatesPartialResponse) 1627 | 1628 | | Properties | Type | Nullable | Description | 1629 | | ---------- | ---- | -------- | ----------- | 1630 | | message | String | no | Response message indicating the result of the operation. | 1631 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | no | | 1632 | | data | [OrderDeliveryUpdatesData](#OrderDeliveryUpdatesData) | no | | 1633 | | errors | ArrayList<[OrderDeliveryUpdatesError](#OrderDeliveryUpdatesError)>? | yes | | 1634 | 1635 | --- 1636 | 1637 | 1638 | 1639 | 1640 | #### [OrderDeliveryUpdatesError](#OrderDeliveryUpdatesError) 1641 | 1642 | | Properties | Type | Nullable | Description | 1643 | | ---------- | ---- | -------- | ----------- | 1644 | | code | String | no | Error code representing the type of error. | 1645 | | message | String | no | A human-readable message providing more details about the error. | 1646 | | exception | String | no | The exception name or type. | 1647 | 1648 | --- 1649 | 1650 | 1651 | 1652 | 1653 | #### [TransactionOrderSummary](#TransactionOrderSummary) 1654 | 1655 | | Properties | Type | Nullable | Description | 1656 | | ---------- | ---- | -------- | ----------- | 1657 | | capturedAmount | Double | no | The total captured amount. This is the sum of the amounts of all captured shipments. | 1658 | | uncapturedAmount | Double | no | The total uncaptured amount. This is calculated as totalAmount - capturedAmount. | 1659 | | capturedAmountForDisbursal | Double | no | The total amount captured for disbursal. This represents the sum of amounts from all shipments marked for disbursal. | 1660 | | capturedAmountForCancellation | Double | no | The total amount captured for cancellation. This aggregates the amounts from all shipments identified for cancellation. | 1661 | 1662 | --- 1663 | 1664 | 1665 | 1666 | 1667 | #### [TransactionOrder](#TransactionOrder) 1668 | 1669 | | Properties | Type | Nullable | Description | 1670 | | ---------- | ---- | -------- | ----------- | 1671 | | id | String | no | Unique identifier of the order. | 1672 | | amount | Double | no | Total amount of the order. | 1673 | | summary | [TransactionOrderSummary](#TransactionOrderSummary)? | yes | | 1674 | 1675 | --- 1676 | 1677 | 1678 | 1679 | 1680 | #### [TransactionMerchant](#TransactionMerchant) 1681 | 1682 | | Properties | Type | Nullable | Description | 1683 | | ---------- | ---- | -------- | ----------- | 1684 | | name | String | no | Name of the merchant. | 1685 | | logo | String | no | URL to the merchant's logo. | 1686 | 1687 | --- 1688 | 1689 | 1690 | 1691 | 1692 | #### [TransactionLoan](#TransactionLoan) 1693 | 1694 | | Properties | Type | Nullable | Description | 1695 | | ---------- | ---- | -------- | ----------- | 1696 | | number | String | no | Loan account number. | 1697 | | amount | Double | no | Loan amount. | 1698 | | type | String | no | Type of loan. | 1699 | | dueDate | String | no | Due date in ISO format for the loan repayment. | 1700 | | repaidAmount | Double | no | Amount that has been repaid. | 1701 | | isSettled | Boolean | no | Indicates if the loan is fully settled. | 1702 | | emis | ArrayList<[TransactionLoanEmi](#TransactionLoanEmi)>? | yes | 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. | 1703 | 1704 | --- 1705 | 1706 | 1707 | 1708 | 1709 | #### [TransactionLoanEmi](#TransactionLoanEmi) 1710 | 1711 | | Properties | Type | Nullable | Description | 1712 | | ---------- | ---- | -------- | ----------- | 1713 | | amount | Double | no | EMI amount. | 1714 | | dueDate | String | no | Due date in ISO format for the EMI payment. | 1715 | | installmentNo | Integer | no | Installment number for the EMI. | 1716 | | repaidAmount | Double | no | Amount that has been repaid towards the EMI. | 1717 | | isSettled | Boolean | no | Indicates if the EMI is fully settled. | 1718 | 1719 | --- 1720 | 1721 | 1722 | 1723 | 1724 | #### [TransactionLender](#TransactionLender) 1725 | 1726 | | Properties | Type | Nullable | Description | 1727 | | ---------- | ---- | -------- | ----------- | 1728 | | name | String | no | Name of the lender. | 1729 | | slug | String | no | A slug representing the lender. | 1730 | | logo | String | no | URL to the lender's logo. | 1731 | | shortName | String | no | Short name of the lender. | 1732 | 1733 | --- 1734 | 1735 | 1736 | 1737 | 1738 | #### [UserTransaction](#UserTransaction) 1739 | 1740 | | Properties | Type | Nullable | Description | 1741 | | ---------- | ---- | -------- | ----------- | 1742 | | id | String | no | Unique identifier of the transaction. | 1743 | | amount | Double | no | Amount of the transaction. | 1744 | | type | String | no | Type of the transaction. | 1745 | | status | String | no | Status of the transaction. | 1746 | | settlementUtr | String? | yes | Settlement UTR for the transaction. | 1747 | | refundId | String? | yes | Refund ID if the transaction is a refund. | 1748 | | createdAt | String | no | Timestamp in ISO format when the transaction was created. | 1749 | | isMasked | Boolean | no | Indicates if the transaction details are masked. This field is true of the transaction if done on some other merchant | 1750 | | order | [TransactionOrder](#TransactionOrder)? | yes | | 1751 | | merchant | [TransactionMerchant](#TransactionMerchant) | no | | 1752 | | loans | ArrayList<[TransactionLoan](#TransactionLoan)>? | yes | | 1753 | | lender | [TransactionLender](#TransactionLender)? | yes | | 1754 | 1755 | --- 1756 | 1757 | 1758 | 1759 | 1760 | #### [Pagination](#Pagination) 1761 | 1762 | | Properties | Type | Nullable | Description | 1763 | | ---------- | ---- | -------- | ----------- | 1764 | | type | String? | yes | The type of pagination. | 1765 | | current | Integer | no | The current page number. | 1766 | | hasPrevious | Boolean | no | Indicates if there is a previous page. | 1767 | | hasNext | Boolean | no | Indicates if there is a next page. | 1768 | | size | Integer | no | The number of items per page. | 1769 | | itemTotal | Integer | no | The total number of items across all pages. | 1770 | 1771 | --- 1772 | 1773 | 1774 | 1775 | 1776 | #### [GetTransactionsData](#GetTransactionsData) 1777 | 1778 | | Properties | Type | Nullable | Description | 1779 | | ---------- | ---- | -------- | ----------- | 1780 | | transactions | ArrayList<[UserTransaction](#UserTransaction)> | no | | 1781 | | page | [Pagination](#Pagination) | no | | 1782 | 1783 | --- 1784 | 1785 | 1786 | 1787 | 1788 | #### [GetTransactionsResponse](#GetTransactionsResponse) 1789 | 1790 | | Properties | Type | Nullable | Description | 1791 | | ---------- | ---- | -------- | ----------- | 1792 | | message | String | no | Response message indicating the result of the operation. | 1793 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | no | | 1794 | | data | [GetTransactionsData](#GetTransactionsData) | no | | 1795 | 1796 | --- 1797 | 1798 | 1799 | 1800 | 1801 | #### [SettlementTransactions](#SettlementTransactions) 1802 | 1803 | | Properties | Type | Nullable | Description | 1804 | | ---------- | ---- | -------- | ----------- | 1805 | | id | String? | yes | Unique identifier for the transaction. | 1806 | | utr | String? | yes | Unique transaction reference number. | 1807 | | amount | Double? | yes | The amount involved in the transaction. | 1808 | | settlementStatus | String? | yes | Status of the transaction. | 1809 | | orderId | String? | yes | Identifier for the associated order. | 1810 | | createdAt | String? | yes | The time the transaction occurred | 1811 | | settlementTime | String? | yes | The time the transaction settles and transaction status updated | 1812 | 1813 | --- 1814 | 1815 | 1816 | 1817 | 1818 | #### [GetSettlementTransactionsData](#GetSettlementTransactionsData) 1819 | 1820 | | Properties | Type | Nullable | Description | 1821 | | ---------- | ---- | -------- | ----------- | 1822 | | transactions | ArrayList<[SettlementTransactions](#SettlementTransactions)> | no | | 1823 | | page | [Pagination](#Pagination) | no | | 1824 | 1825 | --- 1826 | 1827 | 1828 | 1829 | 1830 | #### [GetSettlementTransactionsResponse](#GetSettlementTransactionsResponse) 1831 | 1832 | | Properties | Type | Nullable | Description | 1833 | | ---------- | ---- | -------- | ----------- | 1834 | | message | String | no | Response message indicating the result of the operation. | 1835 | | meta | [IntegrationResponseMeta](#IntegrationResponseMeta) | no | | 1836 | | data | [GetSettlementTransactionsData](#GetSettlementTransactionsData) | no | | 1837 | 1838 | --- 1839 | 1840 | 1841 | 1842 | 1843 | #### [SummaryRequest](#SummaryRequest) 1844 | 1845 | | Properties | Type | Nullable | Description | 1846 | | ---------- | ---- | -------- | ----------- | 1847 | | startDate | String? | yes | | 1848 | | endDate | String? | yes | | 1849 | | merchantId | String? | yes | | 1850 | | type | String? | yes | | 1851 | 1852 | --- 1853 | 1854 | 1855 | 1856 | 1857 | #### [RegisterTransaction](#RegisterTransaction) 1858 | 1859 | | Properties | Type | Nullable | Description | 1860 | | ---------- | ---- | -------- | ----------- | 1861 | | intent | String? | yes | | 1862 | | token | String | no | | 1863 | 1864 | --- 1865 | 1866 | 1867 | 1868 | 1869 | #### [RegisterTransactionResponseData](#RegisterTransactionResponseData) 1870 | 1871 | | Properties | Type | Nullable | Description | 1872 | | ---------- | ---- | -------- | ----------- | 1873 | | isExistingOrder | Boolean? | yes | Indicates whether the order already exists. | 1874 | | transaction | Object? | yes | The transaction details, which is unkown. | 1875 | | action | Boolean? | yes | | 1876 | | status | String? | yes | The status of the transaction. | 1877 | | message | String? | yes | A message related to the transaction status. | 1878 | 1879 | --- 1880 | 1881 | 1882 | 1883 | 1884 | #### [RegisterTransactionResponseResult](#RegisterTransactionResponseResult) 1885 | 1886 | | Properties | Type | Nullable | Description | 1887 | | ---------- | ---- | -------- | ----------- | 1888 | | redirectUrl | String? | yes | URL to redirect the user to, if applicable. | 1889 | 1890 | --- 1891 | 1892 | 1893 | 1894 | 1895 | #### [RegisterTransactionResponse](#RegisterTransactionResponse) 1896 | 1897 | | Properties | Type | Nullable | Description | 1898 | | ---------- | ---- | -------- | ----------- | 1899 | | result | [RegisterTransactionResponseResult](#RegisterTransactionResponseResult)? | yes | | 1900 | | action | HashMap? | yes | An object for future use, currently empty. | 1901 | | data | [RegisterTransactionResponseData](#RegisterTransactionResponseData)? | yes | | 1902 | | transactionId | String? | yes | The unique identifier of the transaction. | 1903 | | status | String? | yes | The status of the user related to the payment process. | 1904 | | message | String? | yes | A message related to the user status. | 1905 | | headers | HashMap? | yes | | 1906 | 1907 | --- 1908 | 1909 | 1910 | 1911 | 1912 | #### [UpdateTransactionRequest](#UpdateTransactionRequest) 1913 | 1914 | | Properties | Type | Nullable | Description | 1915 | | ---------- | ---- | -------- | ----------- | 1916 | | intent | String | no | | 1917 | | token | String | no | | 1918 | 1919 | --- 1920 | 1921 | 1922 | 1923 | 1924 | #### [UpdateTransactionResponse](#UpdateTransactionResponse) 1925 | 1926 | | Properties | Type | Nullable | Description | 1927 | | ---------- | ---- | -------- | ----------- | 1928 | | result | [RegisterTransactionResponseResult](#RegisterTransactionResponseResult)? | yes | | 1929 | | action | HashMap? | yes | An object for future use, currently empty. | 1930 | | data | [RegisterTransactionResponseData](#RegisterTransactionResponseData)? | yes | | 1931 | | transactionId | String? | yes | The unique identifier of the transaction. | 1932 | | status | String? | yes | The status of the user related to the payment process. | 1933 | | message | String? | yes | A message related to the user status. | 1934 | | headers | HashMap? | yes | | 1935 | 1936 | --- 1937 | 1938 | 1939 | 1940 | 1941 | #### [SplitTransactionRequest](#SplitTransactionRequest) 1942 | 1943 | | Properties | Type | Nullable | Description | 1944 | | ---------- | ---- | -------- | ----------- | 1945 | | token | String | no | It contains all the mercahant and order details. | 1946 | | emiTenure | Double | no | This will contain the EMI tenure | 1947 | 1948 | --- 1949 | 1950 | 1951 | 1952 | 1953 | #### [TransactionInSplitTransactionResponse](#TransactionInSplitTransactionResponse) 1954 | 1955 | | Properties | Type | Nullable | Description | 1956 | | ---------- | ---- | -------- | ----------- | 1957 | | id | String? | yes | | 1958 | | amount | Double? | yes | | 1959 | | status | String? | yes | | 1960 | | type | String? | yes | | 1961 | | subtype | String? | yes | | 1962 | 1963 | --- 1964 | 1965 | 1966 | 1967 | 1968 | #### [SplitTransactionResponse](#SplitTransactionResponse) 1969 | 1970 | | Properties | Type | Nullable | Description | 1971 | | ---------- | ---- | -------- | ----------- | 1972 | | parentTransaction | [TransactionInSplitTransactionResponse](#TransactionInSplitTransactionResponse)? | yes | | 1973 | | loanTransaction | [TransactionInSplitTransactionResponse](#TransactionInSplitTransactionResponse)? | yes | | 1974 | | downpaymentTransaction | [TransactionInSplitTransactionResponse](#TransactionInSplitTransactionResponse)? | yes | | 1975 | | lenderDownpaymentTransaction | [TransactionInSplitTransactionResponse](#TransactionInSplitTransactionResponse)? | yes | | 1976 | | headers | HashMap? | yes | | 1977 | 1978 | --- 1979 | 1980 | 1981 | 1982 | --------------------------------------------------------------------------------