{"info":{"_postman_id":"bef90825-3227-428f-81eb-5d651ecfd10e","name":"Apollo Finvest: Repayment API V2","description":"<html><head></head><body><h1 id=\"repayment-api-version-2\">Repayment API Version 2</h1>\n<h2 id=\"introduction\">Introduction</h2>\n<p>This API enables partners and collection agents to share the repayments made by the borrowers. This helps to reduce manual interventions and make repayment-related updates instantaneously.</p>\n<h2 id=\"overview\">Overview</h2>\n<p>This is a <strong>POST</strong>-API to share the repayment-related information with Apollo Finvest. This API can push the repayment details such as the amount, charges, etc along with relevant loan information.</p>\n<ul>\n<li><p>If the <strong><code>repayment_status</code></strong> in response is <strong><code>pending</code></strong>, the partners have to use <strong><code>Repayment Webhook/Callback URL</code></strong> to fetch the final status.</p>\n</li>\n<li><p>The final status communicated via Webhook will be recorded into Apollo's system.</p>\n</li>\n<li><p>We highly recommended partners to use Webhook to fetch final repayment status to be in sync with Apollo's system.</p>\n</li>\n<li><p>If the <strong><code>repayment_status</code></strong> in API and Webhook response is <strong><code>rejected</code></strong>, the partners have to Retry the Repayment Request with correct details.</p>\n</li>\n<li><p>Rejected records will not be added into Apollo's system.</p>\n</li>\n</ul>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>repayment_status</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>pending</td>\n<td>When a repayment status is pending, this means basic validations are as expected.  <br>Payment ids and Amount verification is still in progress.  <br>Partners have to listen via webhook for the final status.</td>\n</tr>\n<tr>\n<td>rejected</td>\n<td>If repayment status is rejected through API - This means basic validations for the request have failed. Partner has added incorrect value/parameter and it is mandatory for partners to retry with correct data.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"authenticationauthorisation\">Authentication/Authorisation</h3>\n<hr>\n<p><code>x-API-key</code> and access tokens should be sent in request headers for authenticating the request. Apollo will provide <code>x-API-key</code>. Access tokens should be generated by the partners. Therefore please generate a new access token using the below code piece. The token will expire in 5 minutes.</p>\n<p>Please refer to API collection to understand more...</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">import requests\nimport base64\nurl = \"will be shared by apollo\"\napp_client_id = \"will be shared by apollo\"\napp_secret = \"will be shared by apollo\"\nbasic = base64.b64encode((app_client_id+':'+app_secret).encode())\npayload = 'grant_type=client_credentials&amp;scope='\nheaders = {\n    'Authorization': 'Basic '+basic.decode(),\n    'Content-Type': 'application/x-www-form-urlencoded',\n}\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\nprint(response.json())\n\n</code></pre>\n<h3 id=\"required-fields-in-request-body\">Required Fields in Request Body</h3>\n<hr>\n<p>There are fields necessarily required to operate this API. Please follow the instructions to integrate and operate this API efficiently.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Request</strong></th>\n<th><strong>Values</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>partner_tag</td>\n<td>Unique Partner Tag provided by Apollo. Eg: ABC</td>\n<td><strong><code>Required</code></strong> This helps to identify the partner while loan creation. This is created by Apollo. <strong><code>String</code></strong></td>\n</tr>\n<tr>\n<td>loan_type</td>\n<td>PL/ML/CL/LOC</td>\n<td><strong><code>Required</code></strong> Use the right input product to which repayment is made. PL- Personal Loan, ML- Micro Loan, CL- Consumer Loan. <strong><code>String</code></strong></td>\n</tr>\n<tr>\n<td>partner_loan_id</td>\n<td>Unique Loan Id created and maintained by the partner. Eg: 123abc  <br>In case of \"LOC\" input partner loan id as the loc_ID that was sent while creating a loc and in case the repayment is drawdown specific, input the drawdown id under partner loan id</td>\n<td><strong><code>Required</code></strong> This loan_id will be used to create the loan in LMS and works as an identifier between Apollo and Partner. It should not be more than 10 digits. It is created by the partner. <strong><code>String</code></strong></td>\n</tr>\n<tr>\n<td>payment_id</td>\n<td>Unique Payment Id only for SUCCESSFUL transaction. Eg. pay_DG4ZdRK8ZnXC3k</td>\n<td><strong><code>Required</code></strong> This is a unique id to capture and fetch payment. <strong><code>String</code></strong></td>\n</tr>\n<tr>\n<td>order_id</td>\n<td>Unique Order Id only for SUCCESSFUL transaction. Eg. order_GjCr5oKh4AVC51</td>\n<td><strong><code>Required</code></strong> Order id creation is important as it helps you associate every payment with an order, thus preventing multiple payments. <strong><code>String</code></strong></td>\n</tr>\n<tr>\n<td>collection_agent</td>\n<td>Unique id given by Apollo for collections  <br>Eg: \"test123\"</td>\n<td><strong><code>Required</code></strong> <strong><code>String</code></strong> This works as an identifier between Apollo and collection agent.</td>\n</tr>\n<tr>\n<td>customer_payback_date</td>\n<td>This is the date column to indicate the repayment date. Eg: DD/MM/YYYY</td>\n<td><strong><code>Required</code></strong> <strong><code>Date String</code></strong> Its the date when the customer made the repayment</td>\n</tr>\n<tr>\n<td>amount_received_exclusive_of_charges</td>\n<td>This should be only a number. Eg: 10</td>\n<td><strong><code>Required</code></strong> <strong><code>Integer</code></strong> This amount indicates the repayment amount or EMI actually received. <strong>This cannot be zero</strong></td>\n</tr>\n<tr>\n<td>penal_interest</td>\n<td>This should be only a number. Eg: 10</td>\n<td><strong><code>Required</code></strong> <strong><code>Integer</code></strong> Penal interest is the charge on delayed repayments. This can be zero if there are no relevant charges</td>\n</tr>\n<tr>\n<td>pre-payment_charges</td>\n<td>This should be only a number</td>\n<td>This will be any pre-payment charges that will be charged to the borrower</td>\n</tr>\n<tr>\n<td>other_charges</td>\n<td>This should be only a number. Eg: 10</td>\n<td><strong><code>Required</code></strong> <strong><code>Integer</code></strong> This is an amount charged if there are any other charges on the. This can be zero if there are no relevant charges</td>\n</tr>\n<tr>\n<td>gst_on_other_charges</td>\n<td>This should be only a number. Eg: 10</td>\n<td><strong><code>Required</code></strong> <strong><code>Integer</code></strong> This amount is the GST charged on other charges. This cannot be zero if other charges exist</td>\n</tr>\n<tr>\n<td>is_prepayment</td>\n<td>To indicate the repayment type. Eg: true or false</td>\n<td><strong><code>Optional</code></strong> <strong><code>Boolean</code></strong> This is applicable only if the repayment is done for future EMIs or to foreclose the loan. In any other case, it will be <strong>false.</strong></td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"sample-request-body\">Sample Request Body</h3>\n<hr>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"partner_tag\": \"Test\",\n    \"loan_type\": \"PL\",\n    \"partner_loan_id\": \"t3\",\n    \"order_id\":\"order_GjCr5oK4AVC51\",\n    \"payment_id\": \"pay_uTjCrafb4AVC51\",\n    \"collection_agent\":\"test\",\n    \"customer_payback_date\": \"1/7/2022\",\n    \"amount_received_exclusive_of_charges\": 500,\n    \"penal_interest\": 0,\n    \"pre-payment_charges\":0,\n    \"other_charges\": 0,\n    \"gst_on_other_charges\": 0,\n    \"is_prepayment\": true\n}\n\n</code></pre>\n<h3 id=\"sample-response\">Sample response</h3>\n<hr>\n<p>When a repayment is pushed and few basic validations are as expected:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n\"message\": \"repayment created successfully, pending confirmation\",\n\"repayment_status\": \"pending\",\n\"created_at\" : 1678392365,\n\"afil_repayment_id\": \"rpy_9131f8ab9f\"\n}\n\n</code></pre>\n<p>When a repayment is rejected due to some reason:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n\"message\": \"missing parameter partner_tag\",\n\"repayment_status\": \"rejected\",\n\"created_at\" : 1678392365,\n\"afil_repayment_id\": \"rpy_9131f8ab9f\"\n}\n\n</code></pre>\n<h1 id=\"status-codes\">Status Codes</h1>\n<hr>\n<p>These are the common error codes pushed by the API in case of any errors</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Status code</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>200</strong></td>\n<td>Successful Request</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Invalid Request</td>\n</tr>\n<tr>\n<td><strong>401</strong></td>\n<td>Unauthorized (The incoming token has expired)</td>\n</tr>\n<tr>\n<td><strong>403</strong></td>\n<td>Forbidden (x-API-key is wrong or partner is not allowed to use this API)</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Internal Server Error (Rare)</td>\n</tr>\n<tr>\n<td><strong>504 bad gateway</strong></td>\n<td>The server is down. Please inform immediately to tech POC. You can retry within a few seconds</td>\n</tr>\n</tbody>\n</table>\n</div><h1 id=\"rate-limit\">Rate Limit</h1>\n<ul>\n<li><p><strong>Throttling</strong><br>  :10000 requests per second.</p>\n</li>\n<li><p><strong>Quota</strong><br>  :Unlimited total number of API calls</p>\n</li>\n</ul>\n<h1 id=\"sla-breakdown\">SLA breakdown</h1>\n<ul>\n<li><p><strong>Standard Support</strong><br>  : Apollo will provide standard technical support twenty-four (24) hours per day, five (5) days per week, excluding weekends and national Indian holidays. Standard Support will be offered via email.</p>\n</li>\n<li><p><strong>Uptime commitment</strong><br>  : Uptime is the percentage of total possible minutes API was available during a fiscal year. Our commitment is to maintain at least 99.99% uptime:</p>\n</li>\n<li><p><strong>Scheduled downtime</strong><br>  : Sometimes we need to perform maintenance to keep API working smoothly. If scheduled downtime is necessary, we’ll give you at least 48 hours advance notice. In a year, scheduled downtime won’t exceed 12 hours.</p>\n</li>\n<li><p><strong>Updates</strong><br>  : As our business evolves, we may change our service level agreement. Customers can review the most current version of the service level agreement at any time by visiting this page.</p>\n</li>\n</ul>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Repayment API Version 2","slug":"repayment-api-version-2"},{"content":"Status Codes","slug":"status-codes"},{"content":"Rate Limit","slug":"rate-limit"},{"content":"SLA breakdown","slug":"sla-breakdown"}],"owner":"16291369","collectionId":"bef90825-3227-428f-81eb-5d651ecfd10e","publishedId":"2s93z58jDV","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2023-06-22T05:21:48.000Z"},"item":[{"name":"Repayment API","id":"577b2e8c-ea83-4fae-8422-2825d3a1ed40","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"****************************","type":"text"},{"key":"x-api-key","value":"****************","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"partner_tag\": \"Test\",\n    \"loan_type\": \"PL\",\n    \"partner_loan_id\": \"t3\",\n    \"order_id\":\"order_GjCr5oKh4AVC51\",\n    \"payment_id\": \"pay_uTjCrafhb4AVC51\",\n    \"collection_agent\":\"test\",\n    \"customer_payback_date\": \"1/7/2022\",\n    \"amount_received_exclusive_of_charges\": 500,\n    \"penal_interest\": 0,\n    \"other_charges\": 0,\n    \"gst_on_other_charges\": 0,\n    \"is_prepayment\": false\n}","options":{"raw":{"language":"json"}}},"url":"https://{servername.com}/{env}/{version}/{action}","urlObject":{"protocol":"https","path":["{env}","{version}","{action}"],"host":["{servername","com}"],"query":[],"variable":[]}},"response":[],"_postman_id":"577b2e8c-ea83-4fae-8422-2825d3a1ed40"},{"name":"Access Token Generator","id":"5bc719b4-3bf3-47cc-8a06-602a21ff5f76","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"clientId","value":"<client-id>"},{"key":"clientSecret","value":"<client-secret>"},{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"client_authentication","value":"<client_authentication>"},{"key":"authUrl","value":"<auth-url>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://{name-api-app.auth.ap-server-name-2.{servercognito}.com/{auth2}/token","urlObject":{"protocol":"https","path":["{auth2}","token"],"host":["{name-api-app","auth","ap-server-name-2","{servercognito}","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"5bc719b4-3bf3-47cc-8a06-602a21ff5f76"}]}