{"info":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","description":"<html><head></head><body><p>There are three main ways to use Creditbook's lending processes: the <strong>White Label Component Library</strong>, <strong>Embedded Finance (EF) APIs</strong>, and <strong>PartnerBook</strong>. The following documentation will focus on the EF APIs.</p>\n<p>The following APIs constitute our lending infrastructure, offering developers and partners a secure environment to seamlessly test and integrate applications. These APIs are divided into two main sections: the <strong>Sandbox APIs</strong> and the <strong>Integration APIs</strong>.</p>\n<p>The Sandbox APIs include special \"Process\" endpoints, such as <strong>Process KYB</strong> and <strong>Process Loan</strong>, which abstract backend functions typically performed asynchronously by Creditbook. These endpoints allow partners to mimic critical steps quickly in a testing environment, enabling faster testing without waiting for actual asynchronous responses.</p>\n<p>Our Integration APIs provide the functionality to assist partners in integrating the lending flow in their applications. For instance, essential getter/setter functions, document uploads, etc.</p>\n<p>To understand our main processes better, following are sequence diagrams that represent generic (but not necessarily hard wired) flows for how integration and lending work.</p>\n<p><strong>Process 1:</strong> Partner Login</p>\n<img src=\"https://content.pstmn.io/73d98f72-040d-481a-8b32-2b5f8dc23d66/bWVybWFpZC1kaWFncmFtLTIwMjQtMTEtMjQtMjMyNjE3LnBuZw==\">\n\n<p>Endpoints:</p>\n<ul>\n<li>Partner Login: <a href=\"https://docs.creditbook.pk/#896b17ad-227c-485f-b34e-d2e49e18b8e3\">https://docs.creditbook.pk/#896b17ad-227c-485f-b34e-d2e49e18b8e3</a></li>\n</ul>\n<p><strong>Process 2:</strong> Customer Onboarding</p>\n<img src=\"https://content.pstmn.io/726562e1-b6fb-4be3-97f0-25268c984af7/U2NyZWVuc2hvdCAyMDI0LTExLTI2IGF0IDEuMDMuNTfigK9QTS5wbmc=\">\n\n<p>In the above diagram, the container 'alt' describes the difference between our 2 environments: sandbox (dev) and production. Processing a KYB for approval involves 3 steps in the live production flow: compliance approval, risk approval, and contract generation. These are handled by CB's team as soon as possible when a new KYB is submitted. In the sandbox environment, these 3 steps are abstracted away into the 'Process KYB' endpoint so that partners can continue testing the EF APIs without needing to wait for KYB approval from CB.</p>\n<p>Endpoints:</p>\n<ul>\n<li><p>Create Lending User: <a href=\"https://docs.creditbook.pk/#478180ef-39b5-4ad9-9b2f-66e724eb9155\">https://docs.creditbook.pk/#478180ef-39b5-4ad9-9b2f-66e724eb9155</a></p>\n</li>\n<li><p>Process KYB: <a href=\"https://docs.creditbook.pk/#7c82a1b2-8c58-45ae-8d00-cb82b1cf86ef\">https://docs.creditbook.pk/#7c82a1b2-8c58-45ae-8d00-cb82b1cf86ef</a></p>\n</li>\n</ul>\n<p><strong>Process 3:</strong> Financing Request</p>\n<img src=\"https://content.pstmn.io/67c61f90-735e-45ed-86c6-68042355e915/U2NyZWVuc2hvdCAyMDI0LTExLTI2IGF0IDEuMDUuMjnigK9QTS5wbmc=\">\n\n<p>Similarly here, the financing flow involves 2 main steps: loan application and loan disbursal. In production environment, the user/partner will submit an application and then it will be processed for approval on CB's end, after which it will be disbursed through one of our payment channels. Once disbursed, daily SMS/email reminders will be sent to the customer about their due amount. The customer/partner will initiate a repayment by creating a repayment transaction with image proof of transaction attached to it. Once the transaction is approved on CB's side, the financing flow completes one disbursement-repayment cycle. Partner webhooks are also called at each step of the process. The difference between the sandbox and production environments in blue and green respectively is the same as described in the Customer Onboarding process.</p>\n<p>Endpoints:</p>\n<ul>\n<li><p>Create Loan: <a href=\"https://docs.creditbook.pk/#0dbff5be-67c8-4359-b0a1-e99543daeb61\">https://docs.creditbook.pk/#0dbff5be-67c8-4359-b0a1-e99543daeb61</a></p>\n</li>\n<li><p>Process Loan: <a href=\"https://docs.creditbook.pk/#1ac9d5b1-8a34-4188-a049-66d9aac62aab\">https://docs.creditbook.pk/#1ac9d5b1-8a34-4188-a049-66d9aac62aab</a></p>\n</li>\n<li><p>Create Transaction: <a href=\"https://docs.creditbook.pk/#473b6f38-a048-45b5-a45a-79d79fc62e09\">https://docs.creditbook.pk/#473b6f38-a048-45b5-a45a-79d79fc62e09</a></p>\n</li>\n<li><p>Process Transaction: <a href=\"https://docs.creditbook.pk/#028b6ca3-51ec-4bbb-a195-c9aceb7816b2\">https://docs.creditbook.pk/#028b6ca3-51ec-4bbb-a195-c9aceb7816b2</a></p>\n</li>\n</ul>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"33837024","collectionId":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","publishedId":"2sAXxS6qMq","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-10-11T07:04:48.000Z"},"item":[{"name":"White Label UI Support","item":[],"id":"965a9a68-d545-4a86-95d9-73669f5483de","description":"<p>For effortless integration of white label UI components into React applications, consider using <strong>@creditbook/wlc-react-sdk</strong> NPM library, available <a href=\"https://www.npmjs.com/package/@creditbook/wlc-react-sdk\">here</a>. This library offers seamless integration and incorporates all the necessary functionalities of our lending infrastructure, empowering developers to swiftly build and customize user interfaces tailored to their specific needs.</p>\n<p><strong>Note</strong> - This SDK is strictly React and not supported on native platforms</p>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"6aeff182-45f3-4e8e-98d6-f2233a608bdf","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"cd2cb9aa-595e-4b7a-8aae-6457be2a87fa","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"965a9a68-d545-4a86-95d9-73669f5483de"},{"name":"Sandbox APIs","item":[{"name":"Partner Login","id":"896b17ad-227c-485f-b34e-d2e49e18b8e3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"partnerId\": \"6401e7d0a799b6dcc9e013ef\",\n    \"apiKey\": \"********************\"\n}","options":{"raw":{"language":"json"}}},"url":"https://stage.creditbookapi.com/api/v1/auth/partners/login","description":"<p>The Login endpoint allows external partners to authenticate and obtain access to the CreditBook Lending Service. Partners are required to provide valid credentials to access the system's resources and perform authorized actions. Send the credentials through the API body as shown below and obtain the access token as shown in the response example.</p>\n<p><strong>Note:</strong> <em>This API should only be invoked from the</em> <em><strong>backend</strong>__. We'll have your IP whitelisted at our server which will verify that the request only originates from your backend</em></p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"protocol":"https","path":["api","v1","auth","partners","login"],"host":["stage","creditbookapi","com"],"query":[],"variable":[]}},"response":[{"id":"432ebed8-91be-4051-b248-484d866dfc0f","name":"success response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"partnerId\": \"65a6696c888d21a7b4b50e64\",\n    \"apiKey\": \"1234\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/api/v1/auth/partners/login"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 07:19:05 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"362"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"X-XSS-Protection","value":"0"},{"key":"X-RateLimit-Limit","value":"100"},{"key":"X-RateLimit-Remaining","value":"99"},{"key":"X-RateLimit-Reset","value":"60"},{"key":"ETag","value":"W/\"16a-yJtD7i36f0ZLut4xCxN2HrMUsXM\""},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Access-Control-Allow-Methods","value":"GET, PUT, POST, DELETE, PATCH, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization"},{"key":"Access-Control-Max-Age","value":"1728000"}],"cookie":[],"responseTime":null,"body":"{\n    \"accessToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNjVhNjY5NmM4ODhkMjFhN2I0YjUwZTY0Iiwicm9sZSI6InBhcnRuZXIiLCJpc3MiOiJjYi1tYWluLWJhY2tlbmQuY2Jmcy1hdXRoIiwicGF5bG9hZF92ZXJzaW9uIjozLCJwbGF0Zm9ybSI6InBhcnRuZXIiLCJzdWIiOiI2NWE2Njk2Yzg4OGQyMWE3YjRiNTBlNjQiLCJpYXQiOjE3MDc0NjMxNDUsImV4cCI6MTcwNzQ2Njc0NX0.7jv2BJ6DUyPpkoe6fXKbpq074tE3eVmSg6BcNjLfqco\"\n}"},{"id":"a349436c-89eb-4bfe-865b-4bab2282fef3","name":"error response - invalid API key","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"partnerId\": \"enter-partner-id-here\",\n    \"apiKey\": \"enter-api-key-here\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/api/v1/auth/partners/login"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"statusCode\": 401,\n    \"message\": \"Invalid API Key\"\n}"},{"id":"e6b87f71-b254-440f-9d3b-8e25435b0eeb","name":"error response - unwhitelisted IP","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"partnerId\": \"enter-partner-id-here\",\n    \"apiKey\": \"enter-api-key-here\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/api/v1/auth/partners/login"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Partner=${companyId} has tried to access from an unauthorized IP address=${ipAddress}\" // this only applies in the case of IP whitelisting\n}"}],"_postman_id":"896b17ad-227c-485f-b34e-d2e49e18b8e3"},{"name":"Create Lending User","id":"478180ef-39b5-4ad9-9b2f-66e724eb9155","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"DanteSparta18@gmail.com\",\n    \"fullName\": \"MadDante\",\n    \"contactNumber\": \"+923361234567\",\n    \"businessName\": \"Riot Games\",\n    \"businessType\": \"company\",\n    \"ntn\": \"111111111\",\n    \"businessAddress\": \"123/4 - 11 - Korangi, Karachi\",\n    \"directorsResolution\": [\n        {\n            \"name\": \"picture_1\",\n            \"size\": 2048,\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        },\n        {\n            \"name\": \"picture 2\",\n            \"size\": 1024,\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"memorandumArticlesAssociation\": [\n        {    \n            \"name\": \"picture_3\",\n            \"size\": 4096,\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pocCnic\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"boardMemberCnic\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"beneficialOwnerCnic\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pastPurchaseOrders\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pastInvoices\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"otherFiles\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/users","description":"<p>This API creates a lending user and therefore, requires all KYB/KYC information to be entered via the API body. Some of the information is mandatory to enter at all times however, some information can be omitted depending on the <code>business_type</code>.</p>\n<h2 id=\"request-body-parameters\">Request Body Parameters</h2>\n<h3 id=\"applicable-for-all-business-types\">Applicable for All Business Types</h3>\n<ul>\n<li><p><code>external_user_id</code>: <code>string</code> (optional) - field if partner would like to link their user identifier. It is recommended to send this all the time. If exists, <strong><code>must be unique</code></strong></p>\n</li>\n<li><p><code>email</code>: <code>string</code> (optional) - if exists, email address of the user that <strong><code>must be unique</code></strong></p>\n</li>\n<li><p><code>businessType</code>: <code>individual</code> | <code>branchOffice</code> | <code>partnership</code> | <code>company</code> | <code>soleProprietorship</code></p>\n</li>\n<li><p><code>ntn</code>: <code>string</code> - <strong>Note</strong>: send cnic number in this field if <code>businessType</code> is <code>soleProprietorship</code> or <code>individual</code> and <strong><code>must be unique</code></strong></p>\n</li>\n<li><p><code>fullName</code>: <code>string</code></p>\n</li>\n<li><p><code>contactNumber</code>: <code>string</code> - in format <code>+92xxxxxxxxxx</code> and <strong><code>must be unique</code></strong></p>\n</li>\n<li><p><code>businessName</code>: <code>string</code></p>\n</li>\n<li><p><code>businessAddress</code>: <code>string</code></p>\n</li>\n<li><p><code>pastPurchaseOrders</code>: <code>Array{FileDto}</code> - (optional)</p>\n</li>\n<li><p><code>pastInvoices</code>: <code>Array{FileDto}</code> - (optional)</p>\n</li>\n<li><p><code>financialStatement</code>: <code>Array{FileDto}</code> - (optional)</p>\n</li>\n<li><p><code>otherFiles</code>: <code>Array</code> - (optional) - Any extra files that partner has. name must be present to demonstrate what the file is about.</p>\n</li>\n<li><p><code>bankDetails</code>: <code>bankDetailsDto</code>- (optional) - has 3 mandatory fields i.e. <code>accountTitle</code>, <code>accountNumber</code> and <code>bankCode</code> and 1 optional (but recommended) field for <code>iban.</code> Use <a href=\"https://docs.creditbook.pk/#b639d910-f86e-4bf2-ba38-a6deb763add0\">get-banks</a> api for the <code>bankCode</code>.</p>\n</li>\n<li><p><code>selfie</code> - <code>Array{FileDto}</code>- (conditional) - required if selfie is defined in partner configuration, file must be of type: <code>.jpeg,</code> <code>.jpg,</code> <code>.png</code>.</p>\n</li>\n</ul>\n<p>Now, all the fields mentioned below are required if and only if <code>businessType</code> matches as mentioned in the subheadings. Otherwise, we can assume that the fields are <code>optional</code></p>\n<h3 id=\"fields-if-businesstype-is-individual\">Fields if <em><strong>businessType</strong></em> is <em><strong>individual</strong></em></h3>\n<ul>\n<li><p><code>cnicFront</code> - <code>Array{FileDto}</code> - file must be of type: <code>.jpeg,</code> <code>.jpg,</code> <code>.png</code>.</p>\n</li>\n<li><p><code>cnicBack</code> - <code>Array{FileDto}</code>- file must be of type: <code>.jpeg,</code> <code>.jpg,</code> <code>.png</code>.</p>\n</li>\n</ul>\n<h3 id=\"fields-if-businesstype-is-soleproprietership\">Fields if <em><strong>businessType</strong></em> is <em><strong>soleProprietership</strong></em></h3>\n<ul>\n<li><p><code>cnicFront</code> - <code>Array{FileDto}</code>- file must be of type: <code>.jpeg,</code> <code>.jpg,</code> <code>.png</code>.</p>\n</li>\n<li><p><code>cnicBack</code> - <code>Array{FileDto}</code>- file must be of type: <code>.jpeg,</code> <code>.jpg,</code> <code>.png</code>.</p>\n</li>\n<li><p><code>proprietorshipDeclaration</code> - <code>Array{FileDto}</code> - Proprietorship Declaration Letter from the Bank</p>\n</li>\n<li><p><code>ntnCertificate</code> - <code>Array{FileDto}</code></p>\n</li>\n<li><p><code>bankStatement</code> - <code>Array{FileDto}</code> - (optional) - bank statement of 6 months</p>\n</li>\n</ul>\n<h3 id=\"fields-if-businesstype-is-partnership\">Fields if <em><strong>businessType</strong></em> is <em><strong>partnerShip</strong></em></h3>\n<ul>\n<li><p><code>partnerCnic</code>: <code>Array{FileDto}</code> - CNICs of all Partners (Front and Back in Single file)</p>\n</li>\n<li><p><code>partnerShipDeed</code>: <code>Array{FileDto}</code> Attested copy of Partnership Deed</p>\n</li>\n<li><p><code>authorityLetter</code>: <code>Array{FileDto}</code> - Authority letter from all partners, in original, authorizing the person(s) to operate firm’s account</p>\n</li>\n<li><p><code>incorporationCertificate</code>: <code>Array{FileDto}</code> - (optional) - Attested copy of Registration Certificate with Registrar of Firms</p>\n</li>\n</ul>\n<h2 id=\"fields-if-businesstype-is-company\">Fields if <em><strong>businessType</strong></em> is <em><strong>company</strong></em></h2>\n<ul>\n<li><p><code>directorsResolution</code>: <code>Array{FileDto}</code> - Certified Copy of Resolution of Board of Directors for opening of account</p>\n</li>\n<li><p><code>memorandumArticlesAssociation</code>: <code>Array{FileDto}</code> - Certified Copy of Memorandum and Articles of Association</p>\n</li>\n<li><p><code>boardMemberCnic</code>: <code>Array{FileDto}</code> - CNICs of all Board members (Front and Back in Single file)</p>\n</li>\n<li><p><code>pocCnic</code>: <code>Array{FileDto}</code> - CNIC of the Person authorized as Point of Contact</p>\n</li>\n<li><p><code>beneficialOwnerCnic</code>:<code>Array{FileDto}</code> - CNICs of the beneficial owners (Front and Back)</p>\n</li>\n<li><p><code>addendum</code>: <code>Array{FileDto}</code> - (optional) - Form II in case of newly incorporated company and Form A/Form C whichever is applicable; and Form 29 if already incorporated company</p>\n</li>\n<li><p><code>formAB</code>: <code>Array{FileDto}</code> - (optional) - Certified copy of Latest Form-A/Form-B</p>\n</li>\n</ul>\n<h3 id=\"fields-if-businesstype-is-branchoffice\">Fields if <em><strong>businessType</strong></em> is <em><strong>branchOffice</strong></em></h3>\n<ul>\n<li><p><code>permissionLetter</code> - <code>Array{FileDto}</code> - Permission letter from relevant authority i-e Board of Investment</p>\n</li>\n<li><p><code>signatoryPassports</code> - <code>Array{FileDto}</code> - Valid passports of all the signatories of account</p>\n</li>\n<li><p><code>formIIParticulars</code> - <code>Array{FileDto}</code> - Form II about particulars of directors, Principal Officer etc. in case of newly registered branch or liaison office of a foreign company</p>\n</li>\n<li><p><code>principalOfficeAuthorization</code> - <code>Array{FileDto}</code> - A Letter from Principal Office of the entity authorizing the person(s) to open and operate the account</p>\n</li>\n</ul>\n<h3 id=\"filedto-type\">FileDTO Type</h3>\n<p>Please make sure to send <code>FileDto</code> typed files in the following format. Convert to array of objects where applicable. The resouceURL can either be a downloadable url stored on the partner's bucket or the following CreditBook <a href=\"https://docs.creditbook.pk/#9851b8a8-df63-4bbd-9dad-cb7f00bd8983\">API</a> can also be used.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">type FileDto {\n     resourceURL: string; // This is the link to the image/document. It should be downloadable.\n     name?: string // optional description of the file\n}\n\n</code></pre>\n<h3 id=\"bankdetailsdto-type\">BankDetailsDTO Type</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">type BankDetailsDto {\n     bankCode: string; // bank code associated with the user's bank (use get-banks api) \n     accountTitle: string // bank account title\n     accountNumber: string //bank account number\n     iban?: string //IBAN of the given bank account number\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","users"],"host":["{{base_url_lms}}"],"query":[],"variable":[]}},"response":[{"id":"2398bad4-91f9-422a-84b7-11b658c34a0f","name":"success response","originalRequest":{"method":"POST","header":[{"key":"","value":"","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\n    \"email\": \"DanteSparta18@gmail.com\",\n    \"fullName\": \"MadDante\",\n    \"contactNumber\": \"+923361234567\",\n    \"businessName\": \"Riot Games\",\n    \"businessType\": \"company\",\n    \"ntn\": \"111111111\",\n    \"businessAddress\": \"123/4 - 11 - Korangi, Karachi\",\n    \"directorsResolution\": [\n        {\n            \"name\": \"picture_1\",\n            \"size\": 2048,\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        },\n        {\n            \"name\": \"picture 2\",\n            \"size\": 1024,\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"memorandumArticlesAssociation\": [\n        {    \n            \"name\": \"picture_3\",\n            \"size\": 4096,\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pocCnic\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"boardMemberCnic\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"beneficialOwnerCnic\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pastPurchaseOrders\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pastInvoices\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"otherFiles\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/users"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 26 Mar 2024 06:49:36 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"2468"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"39"},{"key":"ETag","value":"W/\"9a4-nNWreuhR+TsYM0XLhjRH4SaSdbM\""}],"cookie":[],"responseTime":null,"body":"{\n    \"kyb\": {\n        \"email\": \"DanteSparta18@gmail.com\",\n        \"contactNumber\": \"+923361234567\",\n        \"fullName\": \"MadDante\",\n        \"businessName\": \"Riot Games\",\n        \"display_id\": \"OR-K-P5UUTB\",\n        \"businessType\": \"company\",\n        \"businessAddress\": \"123/4 - 11 - Korangi, Karachi\",\n        \"ntn\": \"111111111\",\n        \"status\": \"pending\",\n        \"statuses\": [\n            {\n                \"status\": \"pending\",\n                \"timestamp\": \"2024-03-26T06:49:36.026Z\",\n                \"updated_by\": \"system\",\n                \"reason\": \"Update by User\"\n            }\n        ],\n        \"directorsResolution\": [\n            {\n                \"name\": \"picture_1\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\",\n                \"size\": 2048\n            },\n            {\n                \"name\": \"picture 2\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\",\n                \"size\": 1024\n            }\n        ],\n        \"memorandumArticlesAssociation\": [\n            {\n                \"name\": \"picture_3\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\",\n                \"size\": 4096\n            }\n        ],\n        \"boardMemberCnic\": [\n            {\n                \"name\": \"placeholder-name\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\",\n                \"size\": 0\n            }\n        ],\n        \"pocCnic\": [\n            {\n                \"name\": \"placeholder-name\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\",\n                \"size\": 0\n            }\n        ],\n        \"beneficialOwnerCnic\": [\n            {\n                \"name\": \"placeholder-name\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\",\n                \"size\": 0\n            }\n        ],\n        \"pastPurchaseOrders\": [\n            {\n                \"name\": \"placeholder-name\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\",\n                \"size\": 0\n            }\n        ],\n        \"pastInvoices\": [\n            {\n                \"name\": \"placeholder-name\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\",\n                \"size\": 0\n            }\n        ],\n        \"otherFiles\": [\n            {\n                \"name\": \"placeholder-name\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\",\n                \"size\": 0\n            }\n        ],\n        \"_id\": \"66027000caaa9d57100817a7\",\n        \"facilities\": [],\n        \"created_at\": \"2024-03-26T06:49:36.031Z\",\n        \"updated_at\": \"2024-03-26T06:49:36.031Z\",\n        \"id\": \"66027000caaa9d57100817a7\",\n        \"bankAccount\": null\n    }\n}"},{"id":"efa40cd0-fcb8-49c3-a87f-9ebc637cd8d9","name":"error response - missing field","originalRequest":{"method":"POST","header":[{"key":"","value":"","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\n    \"email\": \"DanteSparta18@gmail.com\",\n    \"fullName\": \"MadDante\",\n    \"contactNumber\": \"+923361234567\",\n    \"businessName\": \"Riot Games\",\n    \"businessType\": \"company\",\n    \"ntn\": \"111111111\",\n    \"businessAddress\": \"123/4 - 11 - Korangi, Karachi\",\n    \"directorsResolution\": [\n        {\n            \"name\": \"picture_1\",\n            \"size\": 2048,\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        },\n        {\n            \"name\": \"picture 2\",\n            \"size\": 1024,\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"memorandumArticlesAssociation\": [\n        {    \n            \"name\": \"picture_3\",\n            \"size\": 4096,\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pocCnic\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"boardMemberCnic\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"beneficialOwnerCnic\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pastPurchaseOrders\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pastInvoices\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"otherFiles\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/users"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"${key} is a required field\" // based on the company type, specific fields are required to create a new lending user as outlined in the API description\n}"},{"id":"afd92a31-ed08-4cb0-b4b7-b34eb00e36d3","name":"error response - user with given key already exists","originalRequest":{"method":"POST","header":[{"key":"","value":"","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\n    \"email\": \"DanteSparta18@gmail.com\",\n    \"fullName\": \"MadDante\",\n    \"contactNumber\": \"+923361234567\",\n    \"businessName\": \"Riot Games\",\n    \"businessType\": \"company\",\n    \"ntn\": \"111111111\",\n    \"businessAddress\": \"123/4 - 11 - Korangi, Karachi\",\n    \"directorsResolution\": [\n        {\n            \"name\": \"picture_1\",\n            \"size\": 2048,\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        },\n        {\n            \"name\": \"picture 2\",\n            \"size\": 1024,\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"memorandumArticlesAssociation\": [\n        {    \n            \"name\": \"picture_3\",\n            \"size\": 4096,\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pocCnic\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"boardMemberCnic\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"beneficialOwnerCnic\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pastPurchaseOrders\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pastInvoices\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"otherFiles\": [\n        {\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/users"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"User with {key}={value} already exists\" // the unique fields on which a user is identified are ntn, email, and contactNumber\n}"}],"_postman_id":"478180ef-39b5-4ad9-9b2f-66e724eb9155"},{"name":"Process KYB","id":"7c82a1b2-8c58-45ae-8d00-cb82b1cf86ef","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"DanteSparta18@gmail.com\",\n    \"status\": \"approved\",\n    \"contract_details\": {\n        \"amount\": 100000,\n        \"markup\": 30,\n        \"tenure\": 30\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/sandbox/users/process","description":"<p>Now, since a customer creation is successful, our operations team would like to review the KYB information to check for any malicious data. The results are shown via updating the <code>status</code> of the <code>KYB</code> document.</p>\n<p>Since this is an operation executed by CreditBook internally, below API simulates the exact operations on <code>approval/rejection</code> of the <code>KYB</code>. Upon successful verification, a contract is generated for the customer, pending signature before loans can be applied for. This serves as a crucial step in the onboarding process, ensuring compliance with regulatory requirements and establishing the eligibility of customers to access financial services.</p>\n<h2 id=\"query-parameters\">Query Parameters</h2>\n<p>Either one or any combination of these query params can be used to fetch the user's kyb. Alteast one query param needs to exist in the request.</p>\n<ul>\n<li>email: <code>string</code></li>\n<li>contactNumber: <code>string</code> - must be in format <code>+92XXXXXXXXXX</code></li>\n<li>ntn: <code>string</code></li>\n<li>external_user_id: <code>string</code></li>\n</ul>\n<p><em>For backward compatibility we still allow the</em> <code>email</code> <em>of the user, to be sent in the request body. However you are reccomended to send the user search params in the query params of the request.</em></p>\n<h2 id=\"note\">Note</h2>\n<p>This is a one time operation for a customer given that they have not updated their KYB information (in which case, they will have to get it <code>approved</code> once again). After this, the user can continue to request finance applications within their <code>credit_limit</code></p>\n<h2 id=\"request-body-parameters\">Request Body Parameters</h2>\n<ul>\n<li><strong>status</strong> (<code>KYBStatus</code>, required): The result of the KYB verification process.</li>\n<li><strong>contract_details</strong> (<code>ContractDetailsRequest</code>, <code>required if status = approved</code>): An object containing the specifics of the customer's contract include credit limit, markup and tenure.</li>\n</ul>\n<h2 id=\"note-1\">Note</h2>\n<ol>\n<li>Contract information is only included in the response if the KYB is approved.</li>\n<li>This operation will be rejected if the KYB is already approved.</li>\n<li>The detailed description of request/response data types is given below:</li>\n</ol>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">type KYBStatus = \"approved\" | \"rejected\"\ntype ContractDetailsRequest = {\n        amount?: number = 100000;\n        markup?: number = 40; // % per annum \n        tenure?: number = 1; // years\n}\ntype ContractDetailsResponse = {\n        facility_amount_digits: string = 100000;\n        facility_markup: string = 40; // % per annum \n        facility_tenure: string = 1; // years\n}\n\n</code></pre>\n<h2 id=\"response-object\">Response Object</h2>\n<ul>\n<li><strong>user_id</strong> (string): A unique identifer of the customer.</li>\n<li><strong>full_name</strong> (string): The full name of the customer.</li>\n<li><strong>status</strong> (string, [enum KYBStatus]): The status of the KYB verification of the customer.</li>\n<li><strong>contract_status</strong> (string, See Note 1): The status of the contract of the user.</li>\n<li><strong>contract_id</strong> (string, See Note 1): A unique identifer of the contract created by the current request.</li>\n<li><strong>contract_details</strong> (object, [ContractDetailsResponse], See Note 1): An object containing the specifics of the customer's contract include credit limit, markup and tenure.</li>\n</ul>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","sandbox","users","process"],"host":["{{base_url_lms}}"],"query":[],"variable":[]}},"response":[{"id":"0ef25405-1771-4ae1-816d-c8d9a34cf828","name":"success response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"DanteSparta14@gmail.com\",\n    \"status\": \"approved\",\n    \"contract_details\": {\n        \"amount\": 1000000,\n        \"markup\": 30,\n        \"tenure\": 30\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/sandbox/users/process"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 07:24:20 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"264"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"14"},{"key":"ETag","value":"W/\"108-PkMOsdFXgRx7X/AJZl8x1ysuUkg\""}],"cookie":[],"responseTime":null,"body":"{\n    \"user_id\": \"65c5d21e055f2cea81524164\",\n    \"full_name\": \"MadDanteNew\",\n    \"status\": \"approved\",\n    \"contract_status\": \"contract_pending\",\n    \"contract_id\": \"65c5d32446eac4f838561e69\",\n    \"contract_details\": {\n        \"facility_amount_digits\": \"1000000\",\n        \"facility_markup\": \"30\",\n        \"facility_tenure\": \"30\"\n    }\n}"},{"id":"1d6fdb25-7fe8-4325-9a92-8ad87361c80c","name":"error response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"DanteSparta18@gmail.com\",\n    \"status\": \"approved\",\n    \"contract_details\": {\n        \"amount\": 100000,\n        \"markup\": 30,\n        \"tenure\": 30\n    }\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/sandbox/users/process"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Invalid Status\"\n}"}],"_postman_id":"7c82a1b2-8c58-45ae-8d00-cb82b1cf86ef"},{"name":"Get Contract URL","id":"c9d448b4-a8f9-4c35-bb2c-743261759569","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/users/contract-url?email=DanteSparta18@gmail.com","description":"<p>Once the <code>KYB</code> is <code>approved</code> from CreditBook internally, we can proceed onto the next step which is signing the contract from user's side. Otherwise, if <code>KYB</code> is <code>rejected</code>, the user will have to send the correct information again using the <code>Update User</code> API until the <code>KYB</code> is <code>approved</code></p>\n<p>Gets the contract URL of the latest <code>pending</code> contract of the user whose <code>email</code> , <code>contactNumber</code>, <code>ntn</code>, and/or <code>external_user_id</code> is passed in the query parameters. If latest contract is not <code>pending</code> or is not present, returns message with not found in response.</p>\n<p>The link will redirect to our signing service where the user can view the contract documents and sign them digitally. Upon successfully signing the contract, an internal process is automatically triggered after which the user will be able to apply for financing using <a href=\"https://docs.creditbook.pk/#1fd4226a-aabf-4809-8419-4ea0c6e26d31\">CreateLoan API.</a></p>\n<p>FYI: Contract URL can also be fetched from <code>get-lending-user</code> API as it is present in the <code>facilities</code> object and is always the <code>envelope_url</code> of the latest <code>facility</code> in the array.</p>\n<h2 id=\"query-parameters\">Query Parameters</h2>\n<p>Either one or any combination of these query params can be used to fetch the user. Alteast one query param needs to exist in the request.</p>\n<ul>\n<li>email: <code>string</code></li>\n<li>contactNumber: <code>string</code> - must be in format <code>+92XXXXXXXXXX</code></li>\n<li>ntn: <code>string</code></li>\n<li>external_user_id: <code>string</code></li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>See sample response.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","users","contract-url"],"host":["{{base_url_lms}}"],"query":[{"key":"email","value":"DanteSparta18@gmail.com"}],"variable":[]}},"response":[{"id":"0800b2c6-0520-42dd-a362-6888ba651fcb","name":"success response","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{base_url_lms}}/v1/external-lending/sme/users/contract-url?email=Ekko@gmail.com","host":["{{base_url_lms}}"],"path":["v1","external-lending","sme","users","contract-url"],"query":[{"key":"email","value":"Ekko@gmail.com"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 26 Mar 2024 09:58:51 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"82"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"36"},{"key":"ETag","value":"W/\"52-VrwjZVqg7kCSaHdAMY2u5IgIDhk\""}],"cookie":[],"responseTime":null,"body":"{\n    \"contractUrl\": \"https://www.w3.org/Provider/Style/dummy.html\",\n    \"message\": \"Success\"\n}"},{"id":"562be66b-6e87-4e61-848d-72b037bc133e","name":"response","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{base_url_lms}}/v1/external-lending/sme/users/contract-url?email=DanteSparta18@gmail.com","host":["{{base_url_lms}}"],"path":["v1","external-lending","sme","users","contract-url"],"query":[{"key":"email","value":"DanteSparta18@gmail.com"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 26 Mar 2024 06:51:25 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"49"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"50"},{"key":"ETag","value":"W/\"31-73WXd/RRCgXJg70YToHuEYD7ZpM\""}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Contract URL not found for the user\"\n}"}],"_postman_id":"c9d448b4-a8f9-4c35-bb2c-743261759569"},{"name":"Sign Contract","id":"d0c6bc22-bc86-4f81-8577-3f26c442cd97","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"contract_id\": \"65c623c4c5f722d4ad492b81\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/sandbox/users/sign-contract?email=DanteSparta18@gmail.com","description":"<p><b>DEPRECATED</b> - This process can now be done by signing the contract via the link in <a href=\"https://docs.creditbook.pk/#b057f7f4-5681-42bd-88a4-720dfd61a9a7\">Get Contract URL API</a>. We recommend going through that step as that is what the actual flow would be like.</p>\n<p>The Sign Contract endpoint within the Sandbox API facilitates the process of signing a contract, which is a prerequisite for customers to apply for loans and therefore, this process automatically happens right after the user have signed the contract sent to them. However, for accessibility purposes, this endpoint allows partners to simulate digitally sign the contract by providing the contract ID and their email address.</p>\n<h2 id=\"request-body-parameters\">Request Body Parameters</h2>\n<ul>\n<li><strong>contract_id</strong> (string, required): A unique identifier of the contract being signed. This will be taken from the response of <code>Process KYB</code> response object or can be taken by re-getting the user through <code>Get: /user</code> API</li>\n</ul>\n<h2 id=\"query-parameters\">Query Parameters</h2>\n<p>Either one or any combination of these query params can be used to specify the user whose contract needs signing. Alteast one query param needs to exist in the request.</p>\n<ul>\n<li>email: <code>string</code></li>\n<li>contactNumber: <code>string</code> - must be in format <code>+92XXXXXXXXXX</code></li>\n<li>ntn: <code>string</code></li>\n<li>external_user_id: <code>string</code></li>\n</ul>\n<h2 id=\"response-object\">Response Object</h2>\n<ul>\n<li><strong>user_id</strong> (string): A unique identifer of the customer.</li>\n<li><strong>full_name</strong> (string): The full name of the customer.</li>\n<li><strong>contract_status</strong> (string): The status of the contract of the user.</li>\n<li><strong>contract_id</strong> (string): A unique identifer of the contract created by the current request.</li>\n<li><strong>contract_details</strong> (object, [ContractDetailsResponse]): An object containing the specifics of the customer's contract include credit limit, markup and tenure.</li>\n</ul>\n<h2 id=\"note\">Note</h2>\n<ol>\n<li>An expired contract can be forcefully signed through the API. This behaviour is left for convenience but leaves the credit limit and markup with value 0.</li>\n<li>The detailed description of request/response data types is given below:</li>\n</ol>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">type ContractDetailsResponse = {\n        facility_amount_digits: string = 100000;\n        facility_markup: string = 40; // % per annum \n        facility_tenure: string = 1; // years\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","sandbox","users","sign-contract"],"host":["{{base_url_lms}}"],"query":[{"key":"email","value":"DanteSparta18@gmail.com"}],"variable":[]}},"response":[{"id":"46a0db28-5ae6-4717-9813-a64442048488","name":"response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"DanteSparta14@gmail.com\",\n    \"contract_id\": \"65c5d32446eac4f838561e69\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/sandbox/users/sign-contract"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 07:52:21 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"241"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"298"},{"key":"RateLimit-Reset","value":"13"},{"key":"ETag","value":"W/\"f1-OPgJsuzEnu3TGZDFyv+DPuex6H8\""}],"cookie":[],"responseTime":null,"body":"{\n    \"user_id\": \"65c5d21e055f2cea81524164\",\n    \"full_name\": \"MadDanteNew\",\n    \"contract_status\": \"contract_valid\",\n    \"contract_id\": \"65c5d32446eac4f838561e69\",\n    \"contract_details\": {\n        \"facility_amount_digits\": \"100000\",\n        \"facility_markup\": \"30\",\n        \"facility_tenure\": \"30\"\n    }\n}"}],"_postman_id":"d0c6bc22-bc86-4f81-8577-3f26c442cd97"},{"name":"Create Loan","id":"0dbff5be-67c8-4359-b0a1-e99543daeb61","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"invoice_data\": [\n        {\n            \"name\": \"Invoice_Doc_1\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        },\n        {\n            \"name\": \"Invoice_Doc_2\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        },\n        {\n            \"name\": \"Invoice_Doc_3\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"required_financing\": 20000\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/loans?email=DanteSparta18@gmail.com","description":"<p>Now, the customer has been assigned with a <code>credit_limit</code> and is eligible for creating applications. Thus, the <code>Create Loan</code> endpoint allows users to submit a request for loan application. Users provide information about the loan, including invoice data, required financing amount, currency, and financing type.</p>\n<h2 id=\"query-parameters\">Query Parameters</h2>\n<p>Either one or any combination of these query params can be used to specify the user whose contract needs signing. Alteast one query param needs to exist in the request.</p>\n<ul>\n<li><p>email: <code>string</code></p>\n</li>\n<li><p>contactNumber: <code>string</code> - must be in format <code>+92XXXXXXXXXX</code></p>\n</li>\n<li><p>ntn: <code>string</code></p>\n</li>\n<li><p>external_user_id: <code>string</code></p>\n</li>\n</ul>\n<h2 id=\"request-body-parameters\">Request Body Parameters</h2>\n<ul>\n<li><p><strong>invoice_data</strong> (<code>Array{FileDto}</code>, required): Invoice data that needs to be financed for the customer or any proof of financing need</p>\n</li>\n<li><p><strong>required_financing</strong> (number, required): User's required financing amount</p>\n</li>\n<li><p><strong>trade_financing_type</strong> (<code>TRADE_FINANCING_TYPE</code>, optional): type of financing (default to <code>invoice_financing</code>)</p>\n</li>\n<li><p><strong>currency</strong> (<code>CURRENCY</code>, optional): currency in which financing is required (default to <code>pkr</code>)</p>\n</li>\n<li><p><strong>tenure</strong> (number, optional): tenure of the loan in number of days</p>\n</li>\n<li><p><strong>disbursement_account_details</strong> (<code>CreateBankDetailsDto</code> , optional): details of bank account where the financing amount needs to be disbursed. In case of no bank details provided here, finance will choose one of the customers bank or contact in case of no bank present for the customer</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">enum TRADE_FINANCING_TYPE {\n  PO_FINANCING = 'po_financing',\n  INVOICE_FINANCING = 'invoice_financing',\n  OTHER = 'other',\n}\nenum CURRENCY {\n  USD = 'usd',\n  AED = 'aed',\n  PKR = 'pkr',\n}\nconst CreateBankDetailsDto = {\n  bankCode: string,\n  accountTitle: string,\n  accountNumber: string,\n  iban?: string,\n};\n\n</code></pre>\n<h2 id=\"response-body\">Response Body</h2>\n<p>See sample response.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","loans"],"host":["{{base_url_lms}}"],"query":[{"key":"email","value":"DanteSparta18@gmail.com"}],"variable":[]}},"response":[{"id":"b1cb50fa-829d-4a6a-9f06-efae0405d56a","name":"response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"DanteSparta14@gmail.com\",\n    \"invoice_data\": [\n        {\n            \"name\": \"Invoice_Doc_1\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        },\n        {\n            \"name\": \"Invoice_Doc_2\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        },\n        {\n            \"name\": \"Invoice_Doc_3\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"required_financing\": 20000\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/loans"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 07:53:10 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"979"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"24"},{"key":"ETag","value":"W/\"3d3-wrtgljZYy6vdchDDGB7rfUePEmg\""}],"cookie":[],"responseTime":null,"body":"{\n    \"loan\": {\n        \"invoice_data\": [\n            {\n                \"name\": \"Invoice_Doc_1\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n            },\n            {\n                \"name\": \"Invoice_Doc_2\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n            },\n            {\n                \"name\": \"Invoice_Doc_3\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n            }\n        ],\n        \"required_financing\": 20000,\n        \"_id\": \"65c5d9e646eac4f838561e8a\",\n        \"user_id\": \"65c5d21e055f2cea81524164\",\n        \"customer_name\": \"Riot Games New\",\n        \"principal_amount\": 20000,\n        \"statuses\": [\n            {\n                \"status\": \"under_review\",\n                \"timestamp\": \"2024-02-09T07:53:10.462Z\",\n                \"updated_by\": \"system\"\n            }\n        ],\n        \"status\": \"under_review\",\n        \"type\": \"daily\",\n        \"created_at\": \"2024-02-09T07:53:10.502Z\",\n        \"updated_at\": \"2024-02-09T07:53:10.502Z\",\n        \"id\": \"65c5d9e646eac4f838561e8a\"\n    }\n}"}],"_postman_id":"0dbff5be-67c8-4359-b0a1-e99543daeb61"},{"name":"Process Loan","id":"1ac9d5b1-8a34-4188-a049-66d9aac62aab","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"status\": \"disbursed\",\n    \"comment\": \"LoanStatusLooksGood\",\n    \"reason\": \"financing\",\n    \"principal_amount\": 20000,\n    \"tenure\": 30,\n    \"markup\": 40\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/sandbox/loans/65c62405c5f722d4ad492b8e/process","description":"<p>The next step is to approve the finance request application and disburse the loan. These part of the process is done again executed by CreditBook internally however, this API can be invoked <em><strong>twice</strong></em> in the following manner to simulate these two processes.</p>\n<ol>\n<li>Send <code>status</code> as <code>approved</code> with approved request details or send status as <code>rejected</code></li>\n<li>Send <code>status</code> as <code>disbursed</code></li>\n</ol>\n<h2 id=\"note\">Note</h2>\n<p>Approve, Reject, or Disburse a loan with <code>id = loan_id</code></p>\n<p>Please use the API taking these under consideration</p>\n<ul>\n<li>A loan can only be <code>approved/rejected</code> if it is in <code>under_review</code>, or in any previous state. The loan state right after creation is usually <code>under_review</code>. Otherwise, will throw an error</li>\n<li>A loan can only be only be <code>disbursed</code> if it is in <code>approved</code> state. Otherwise, will throw an error.</li>\n</ul>\n<h2 id=\"request-body-parameters\">Request Body Parameters</h2>\n<ul>\n<li><strong>status</strong> (<code>approved | rejected | disbursed</code>, required): updated status of the loan.</li>\n<li><strong>principal_amount</strong> (<code>number</code>, <code>required</code> only when <code>status = approved</code>): The approved amount for the financing.</li>\n<li><strong>tenure</strong> (number, <code>required</code> only when <code>status = approved</code>): User's required financing amount</li>\n<li><strong>reason</strong> (string, optional): reason for financing the application</li>\n<li><strong>comment</strong> (string, optional): any other comment to be added</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">class ProcessSandboxLoanBodyDto {\n  status: 'approved' | 'rejected' | 'disbursed',\n  comment?: string,\n  reason:? string,\n  principal_amount: number ==&gt; (Required when status='approved' otherwise is optional),\n  tenure: number ==&gt; (Required when status='approved' otherwise is optional),\n}\n\n</code></pre>\n<h2 id=\"response-body\">Response Body</h2>\n<p>See sample response.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","sandbox","loans","65c62405c5f722d4ad492b8e","process"],"host":["{{base_url_lms}}"],"query":[],"variable":[]}},"response":[{"id":"ac829614-675b-406b-a277-00302f1df3e3","name":"response - approving","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"status\": \"approved\",\n    \"comment\": \"LoanStatusLooksGood\",\n    \"reason\": \"financing\",\n    \"principal_amount\": 2000,\n    \"tenure\": 30,\n    \"markup\": 1000\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/sandbox/loans/65c5d9e646eac4f838561e8a/process"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 08:03:57 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1843"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"37"},{"key":"ETag","value":"W/\"733-WbA4U9MHDWv7cU+Y3gyhPEBUtKo\""}],"cookie":[],"responseTime":null,"body":"{\n    \"_id\": \"65c5d9e646eac4f838561e8a\",\n    \"invoice_data\": [\n        {\n            \"name\": \"Invoice_Doc_1.png\",\n            \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/0-9f9b1cf8-45f2-45f5-bc2f-5d60b8d9dd3e.png\"\n        },\n        {\n            \"name\": \"Invoice_Doc_2.png\",\n            \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/1-d32e60cf-3705-4fe8-9a7d-a0853a9d4dbd.png\"\n        },\n        {\n            \"name\": \"Invoice_Doc_3.png\",\n            \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/2-270d8178-8210-46a9-9825-dfe1063f6131.png\"\n        },\n        {\n            \"name\": \"invoice_doc_new.png\",\n            \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/3-bbbe4285-70e9-48da-89fa-1cd5ac8bd3ae.png\"\n        },\n        {\n            \"name\": \"invoice_doc_new.png\",\n            \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/4-577adb30-f113-4a74-91d1-7fe0b3ca218c.png\"\n        }\n    ],\n    \"required_financing\": 20000,\n    \"user_id\": \"65c5d21e055f2cea81524164\",\n    \"customer_name\": \"Riot Games New\",\n    \"principal_amount\": 2000,\n    \"statuses\": [\n        {\n            \"status\": \"under_review\",\n            \"timestamp\": \"2024-02-09T07:53:10.462Z\",\n            \"updated_by\": \"system\"\n        },\n        {\n            \"status\": \"under_review\",\n            \"timestamp\": \"2024-02-09T07:55:55.810Z\",\n            \"updated_by\": \"system\"\n        },\n        {\n            \"status\": \"under_review\",\n            \"timestamp\": \"2024-02-09T07:57:30.357Z\",\n            \"updated_by\": \"system\"\n        },\n        {\n            \"status\": \"approved\",\n            \"timestamp\": \"2024-02-09T08:03:57.109Z\",\n            \"updated_by\": \"65a6696c888d21a7b4b50e64\",\n            \"reason\": \"financing\",\n            \"comment\": \"LoanStatusLooksGood\"\n        }\n    ],\n    \"status\": \"approved\",\n    \"type\": \"daily\",\n    \"created_at\": \"2024-02-09T07:53:10.502Z\",\n    \"updated_at\": \"2024-02-09T08:03:57.109Z\",\n    \"markup\": 30,\n    \"markup_per_day\": 0.01,\n    \"payments\": {\n        \"principal_repaid\": 0,\n        \"late_fees\": 0,\n        \"markup_fee\": 0\n    },\n    \"pending\": {\n        \"principal\": 2000,\n        \"late_fees\": 0,\n        \"markup_fee\": 0\n    },\n    \"tenure\": 30,\n    \"id\": \"65c5d9e646eac4f838561e8a\"\n}"},{"id":"0a7334f9-7d00-491b-941f-faeacf632d16","name":"response - disbursed","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"status\": \"disbursed\",\n    \"comment\": \"LoanStatusLooksGood\",\n    \"reason\": \"financing\",\n    \"principal_amount\": 2000,\n    \"tenure\": 30,\n    \"markup\": 1000\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/sandbox/loans/65c5d9e646eac4f838561e8a/process"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 08:04:35 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1999"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"59"},{"key":"ETag","value":"W/\"7cf-Q+2f7M5s371fnfF1reo7ADKiyn0\""}],"cookie":[],"responseTime":null,"body":"{\n    \"_id\": \"65c5d9e646eac4f838561e8a\",\n    \"invoice_data\": [\n        {\n            \"name\": \"Invoice_Doc_1.png\",\n            \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/0-9f9b1cf8-45f2-45f5-bc2f-5d60b8d9dd3e.png\"\n        },\n        {\n            \"name\": \"Invoice_Doc_2.png\",\n            \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/1-d32e60cf-3705-4fe8-9a7d-a0853a9d4dbd.png\"\n        },\n        {\n            \"name\": \"Invoice_Doc_3.png\",\n            \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/2-270d8178-8210-46a9-9825-dfe1063f6131.png\"\n        },\n        {\n            \"name\": \"invoice_doc_new.png\",\n            \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/3-bbbe4285-70e9-48da-89fa-1cd5ac8bd3ae.png\"\n        },\n        {\n            \"name\": \"invoice_doc_new.png\",\n            \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/4-577adb30-f113-4a74-91d1-7fe0b3ca218c.png\"\n        }\n    ],\n    \"required_financing\": 20000,\n    \"user_id\": \"65c5d21e055f2cea81524164\",\n    \"customer_name\": \"Riot Games New\",\n    \"principal_amount\": 2000,\n    \"statuses\": [\n        {\n            \"status\": \"under_review\",\n            \"timestamp\": \"2024-02-09T07:53:10.462Z\",\n            \"updated_by\": \"system\"\n        },\n        {\n            \"status\": \"under_review\",\n            \"timestamp\": \"2024-02-09T07:55:55.810Z\",\n            \"updated_by\": \"system\"\n        },\n        {\n            \"status\": \"under_review\",\n            \"timestamp\": \"2024-02-09T07:57:30.357Z\",\n            \"updated_by\": \"system\"\n        },\n        {\n            \"status\": \"approved\",\n            \"timestamp\": \"2024-02-09T08:03:57.109Z\",\n            \"updated_by\": \"65a6696c888d21a7b4b50e64\",\n            \"reason\": \"financing\",\n            \"comment\": \"LoanStatusLooksGood\"\n        },\n        {\n            \"status\": \"disbursed\",\n            \"timestamp\": \"2024-02-09T08:04:35.120Z\",\n            \"updated_by\": \"65a6696c888d21a7b4b50e64\",\n            \"reason\": \"financing\",\n            \"comment\": \"LoanStatusLooksGood\"\n        }\n    ],\n    \"status\": \"disbursed\",\n    \"type\": \"daily\",\n    \"created_at\": \"2024-02-09T07:53:10.502Z\",\n    \"updated_at\": \"2024-02-09T08:04:35.120Z\",\n    \"markup\": 30,\n    \"markup_per_day\": 0.01,\n    \"payments\": {\n        \"principal_repaid\": 0,\n        \"late_fees\": 0,\n        \"markup_fee\": 0\n    },\n    \"pending\": {\n        \"principal\": 2000,\n        \"late_fees\": 0,\n        \"markup_fee\": 0\n    },\n    \"tenure\": 30,\n    \"id\": \"65c5d9e646eac4f838561e8a\"\n}"}],"_postman_id":"1ac9d5b1-8a34-4188-a049-66d9aac62aab"},{"name":"Create Repayment Details","id":"91720658-9032-4c83-90c8-6a06d4ef785e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/sandbox/loans/repayment-details?email=DanteSparta18@gmail.com","description":"<p>Now, as the finance application is <code>requested</code>, <code>approved</code>, and <code>disbursed</code>, we now expect the customer to repay the loan. However, the customer needs an address (typically a bank account details) for repayments. Therefore, this API basically helps in generating a dummy <code>virtual account</code> for the user. These details can be viewed at the customer's end using the <code>Get /repayment-details</code> API. This process is again executed by CreditBook internally, which creates a real virtual account for the user to repay but for simulation purposes, this API can be invoked to create the repayment details for the user.</p>\n<h2 id=\"query-parameters\">Query Parameters</h2>\n<p>Either one or any combination of these query params can be used to fetch the user repayment details. Alteast one query param needs to exist in the request.</p>\n<ul>\n<li>email: <code>string</code></li>\n<li>contactNumber: <code>string</code> - must be in format <code>+92XXXXXXXXXX</code></li>\n<li>ntn: <code>string</code></li>\n<li>external_user_id: <code>string</code></li>\n</ul>\n<h2 id=\"note\">Note</h2>\n<p>This endpoint will throw error with message: <code>Virtual account already exists</code> if an account already exists.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","sandbox","loans","repayment-details"],"host":["{{base_url_lms}}"],"query":[{"key":"email","value":"DanteSparta18@gmail.com"}],"variable":[]}},"response":[{"id":"10c4d0d5-f324-4957-af22-8ed87e6c08a4","name":"response","originalRequest":{"method":"POST","header":[],"url":{"raw":"{{base_url_lms}}/v1/external-lending/sme/sandbox/loans/repayment-details?email=DanteSparta14@gmail.com","host":["{{base_url_lms}}"],"path":["v1","external-lending","sme","sandbox","loans","repayment-details"],"query":[{"key":"email","value":"DanteSparta14@gmail.com"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 07:58:34 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"157"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"60"},{"key":"ETag","value":"W/\"9d-WbkvyolrrnvIylX1fudjzMjU7PU\""}],"cookie":[],"responseTime":null,"body":"{\n    \"repayment_address\": {\n        \"account_title\": \"MadDanteNew\",\n        \"account_number\": \"2761214856546174\",\n        \"bank_name\": \"Faysal Bank Limited\",\n        \"iban\": \"PK31FAYS2761214856546174\"\n    }\n}"}],"_postman_id":"91720658-9032-4c83-90c8-6a06d4ef785e"},{"name":"Create Transaction","id":"473b6f38-a048-45b5-a45a-79d79fc62e09","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"user_id\": \"65c622dc055f2cea81524265\",\n    \"amount\": \"20000\",\n    \"type\": \"repayment\",\n    \"method\": \"bank_transfer\",\n    \"payment_date\": \"2024-02-09T19:00:00.000Z\",\n    \"transaction_image\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/loans/65c62405c5f722d4ad492b8e/transaction","description":"<p>Once the repayment address is provided to the customer, we now expect user to create repayment transactions. This API helps in this operation by creating a <code>loan-transaction</code> in <code>processing</code> state. This doesn't affect the balances of the loan until the transaction is processed through <code>process-transaction</code> API.</p>\n<h2 id=\"request-parameters\">Request Parameters</h2>\n<ul>\n<li><strong>loan_id</strong> (string, required): <code>id</code> of loan for which the repayment is created. Can be retrieved from <code>get-all-loans</code> API</li>\n</ul>\n<h2 id=\"request-body-parameters\">Request Body Parameters</h2>\n<ul>\n<li><p><strong>user_id</strong> (string, required): <code>id</code> of the <code>kyb</code> document of the user</p>\n</li>\n<li><p><strong>amount</strong> (number, required): the amount repayed</p>\n</li>\n<li><p><strong>type</strong> (<code>\"repayment\"</code>, required): Always send <code>repayment</code> string in this param</p>\n</li>\n<li><p><strong>payment_date</strong> (DateString, required): date in UTC at which the repayment was made.</p>\n</li>\n<li><p><strong>method</strong> (<code>PaymentMethod</code>, required): method of repayment</p>\n</li>\n<li><p><strong>transaction_image</strong> (string, required): downloadable link to the image/document for proof of repayment</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">class CreateLoanTransaction {\n  user_id: string\n  amount: number;\n  type: TransactionType;\n  payment_date: Date;\n  method: PaymentMethod;\n  transaction_image?: string; // This is the link to the image/document. It should be downloadable.\n}\nexport enum PaymentMethod {\nBANK_TRANSFER = 'bank_transfer',\nCASH_VIA_FSO = 'cash_via_fso',\nONE_BILL = 'one_bill',\nONLINE_CASH_DEPOSIT = 'online_cash_deposit',\nCLEARING_CHEQUE_DEPOSIT = 'clearing_cheque_deposit',\n}\n\n</code></pre>\n<h2 id=\"response-body\">Response Body</h2>\n<p>See sample response.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","loans","65c62405c5f722d4ad492b8e","transaction"],"host":["{{base_url_lms}}"],"query":[],"variable":[]}},"response":[{"id":"5f250f89-378d-4e53-b323-89084cd473cf","name":"response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"user_id\": \"65c5d21e055f2cea81524164\",\n    \"amount\": \"2000\",\n    \"type\": \"repayment\",\n    \"method\": \"bank_transfer\",\n    \"payment_date\": \"2023-12-15T12:49:12.848Z\",\n    \"transaction_image\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/loans/65c5d9e646eac4f838561e8a/transaction"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 08:11:23 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"593"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"298"},{"key":"RateLimit-Reset","value":"11"},{"key":"ETag","value":"W/\"251-K2Cmdr/vanIPkEsKTWimb6PkEAo\""}],"cookie":[],"responseTime":null,"body":"{\n    \"user_id\": \"65c5d21e055f2cea81524164\",\n    \"loan_id\": \"65c5d9e646eac4f838561e8a\",\n    \"type\": \"repayment\",\n    \"statuses\": [\n        {\n            \"status\": \"processing\",\n            \"timestamp\": \"2024-02-09T08:11:23.122Z\",\n            \"updated_by\": \"65a6696c888d21a7b4b50e64\"\n        }\n    ],\n    \"payment_date\": \"2023-12-15T12:49:12.848Z\",\n    \"amount\": 2000,\n    \"method\": \"bank_transfer\",\n    \"status\": \"processing\",\n    \"transaction_image\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/transaction_images/65c5d9e646eac4f838561e8a-1707466282900.png\",\n    \"created_at\": \"2024-02-09T08:11:23.123Z\",\n    \"updated_at\": \"2024-02-09T08:11:23.123Z\",\n    \"id\": \"65c5de2b46eac4f838561f29\"\n}"}],"_postman_id":"473b6f38-a048-45b5-a45a-79d79fc62e09"},{"name":"Process Transaction","id":"028b6ca3-51ec-4bbb-a195-c9aceb7816b2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"status\": \"approved\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/sandbox/loans/65c62405c5f722d4ad492b8e/transaction/65c62569c5f722d4ad492bf0/process","description":"<p>Now, since a repayment is already created in <code>pending</code> state, our internal team verifies the payment and then either <code>approves</code> or <code>rejects</code> this transaction so that it reflects on the loan balances. with <code>id = tx_id</code> for loan with <code>id = loan_id</code>.</p>\n<h2 id=\"request-parameters\">Request Parameters</h2>\n<ul>\n<li><strong>loan_id</strong> (string, required): <code>id</code> of loan for which the repayment is created. Can be retrieved from <code>get-all-loans</code> API</li>\n<li><strong>tx_id</strong> (string, required): <code>id</code> of the transaction which is being processed. Can be retrieved from <code>get-all-transactions</code> API for the given loan</li>\n</ul>\n<h2 id=\"request-body-parameters\">Request Body Parameters</h2>\n<ul>\n<li><strong>status</strong> (<code>approved | cancelled</code>, required): after process status of the transaction.</li>\n</ul>\n<h2 id=\"note\">Note:</h2>\n<p>Please use the API taking these under consideration</p>\n<ul>\n<li>A transaction can only be <code>processed</code> once.</li>\n<li>Approving a transaction that also completes the loan would automatically mark the loan as <code>completed</code> too. This means that this ends the whole financing journey for one application.</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>See sample response.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","sandbox","loans","65c62405c5f722d4ad492b8e","transaction","65c62569c5f722d4ad492bf0","process"],"host":["{{base_url_lms}}"],"query":[],"variable":[]}},"response":[{"id":"a857306b-2864-4d77-a520-b074916b971c","name":"response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"status\": \"approved\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/sandbox/loans/65c5d9e646eac4f838561e8a/transaction/65c5df6f2e8d36e79f722e0d/process"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 08:13:01 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"692"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"33"},{"key":"ETag","value":"W/\"2b4-oPyTEFLeMx4aCI69OrV5uBtj43w\""}],"cookie":[],"responseTime":null,"body":"{\n    \"user_id\": \"65c5d21e055f2cea81524164\",\n    \"loan_id\": \"65c5d9e646eac4f838561e8a\",\n    \"type\": \"repayment\",\n    \"statuses\": [\n        {\n            \"status\": \"processing\",\n            \"timestamp\": \"2024-02-09T08:11:23.122Z\",\n            \"updated_by\": \"65a6696c888d21a7b4b50e64\"\n        },\n        {\n            \"status\": \"approved\",\n            \"timestamp\": \"2024-02-09T08:13:01.554Z\",\n            \"updated_by\": \"65c5d21e055f2cea81524164\"\n        }\n    ],\n    \"payment_date\": \"2023-12-15T12:49:12.848Z\",\n    \"amount\": 2000,\n    \"method\": \"bank_transfer\",\n    \"status\": \"approved\",\n    \"transaction_image\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/transaction_images/65c5d9e646eac4f838561e8a-1707466282900.png\",\n    \"created_at\": \"2024-02-09T08:11:23.123Z\",\n    \"updated_at\": \"2024-02-09T08:13:01.554Z\",\n    \"id\": \"65c5de2b46eac4f838561f29\"\n}"}],"_postman_id":"028b6ca3-51ec-4bbb-a195-c9aceb7816b2"}],"id":"7ec23dd9-a3c8-4ad1-8d2b-27a33284c345","description":"<p>To embark on your lending journey as a partner, we recommend following the happy flow to acquaint yourself with the entire process. To begin, you'll need to be whitelisted (if not already) for access to the lending sandbox APIs. Being whitelisted implies that you also possess your <code>partner_id</code> and <code>api_key</code> for the login API provided below.</p>\n<p>Upon providing this documentation, we will be sharing the <code>partner_id</code> and <code>api_key</code> with you as well. Please contact us if it is not yet provided.</p>\n<p>Please call this API to acquire a token, valid for 30 minutes, which should be attached in the header as a <code>Bearer token</code> for authentication purposes.</p>\n<p>In this particular documentation, you can add the token in Public Lending API folder authentication and all other APIs would automatically inherit the authentication from this parent folder.</p>\n","_postman_id":"7ec23dd9-a3c8-4ad1-8d2b-27a33284c345","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}}},{"name":"Integration APIs","item":[{"name":"Lending Users","item":[{"name":"Create Lending User","item":[],"id":"a83a6093-d31d-4995-b861-7857594a9d8b","description":"<p>Refer to this <a href=\"https://docs.creditbook.pk/#55d76658-7696-4466-b7bf-f7f72d90354f\">API</a> for creating a lending user.</p>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"d0c15a9a-3166-4707-b4f5-0e4c286778ce","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"7f8e4a61-c003-46e4-93c8-49a14e426502","type":"text/javascript","exec":[""]}}],"_postman_id":"a83a6093-d31d-4995-b861-7857594a9d8b"},{"name":"Get Contract URL","item":[],"id":"56470cee-f7c7-4568-a279-8c93108c5bb9","description":"<p>Refer to this <a href=\"https://docs.creditbook.pk/#b057f7f4-5681-42bd-88a4-720dfd61a9a7\">API</a> for fetching latest pending contract URL</p>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"e2ba28a2-dc11-4151-a627-6032c936493c","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"ae8d22e9-e660-4e0a-9169-709bdfa3a941","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"56470cee-f7c7-4568-a279-8c93108c5bb9"},{"name":"get-lending-user","id":"04b3e24e-21dd-4703-abf8-7c042bad4fb7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/users?email=DanteSparta18@gmail.com","description":"<p>Gets information of the user whose <code>email</code> , <code>contactNumber</code>, <code>ntn</code>, and/or <code>external_user_id</code> is passed in the query parameters. If no matching user exists then it returns <code>null</code>.</p>\n<h2 id=\"query-parameters\">Query Parameters</h2>\n<p>Either one or any combination of these query params can be used to fetch the user. Alteast one query param needs to exist in the request.</p>\n<ul>\n<li><p>email: <code>string</code></p>\n</li>\n<li><p>contactNumber: <code>string</code> - must be in format <code>+92XXXXXXXXXX</code></p>\n</li>\n<li><p>ntn: <code>string</code></p>\n</li>\n<li><p>external_user_id: <code>string</code></p>\n</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>Following is the KYB type in the response.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">interface response {\n  kyb: IKyb,\n}\ninterface IKyb {\n  _id: ObjectId;\n  fullName: string;\n  email?: string; //will be present if provided for the user at creation\n  contactNumber: string;\n  businessName: string;\n  businessType: KYBBusinessType;\n  businessAddress: string;\n  ntn: string;\n  status: CustomerStatus;\n  city?: string;\n  statuses?: Status[];\n  company_type?: CompanyType;\n  available_credit_limit: number; //will be available if signed contract is present in valid state. Will exclude pending amounts from active loans\n  active_loans: number; // will be present if signed contract is present in valid state and will include loans in Disbursed, Overdue, and Default state\n  display_id: string; \n  credit_limit: number; //will be available if signed contract is present in valid state\n  markup: number; //will be available if signed contract is present in valid state\n  proposed_credit_limit?: number; //will be available if contract is generated but yet to be signed\n  proposed_markup?: number; //will be available if contract is generated but yet to be signed\n  facilities: IFacility[]; //contains all contract details\n  // kyb files\n  industry?: string;\n  product?: string;\n  product_codes?: string | string[];\n  yearsExperienceProduct?: number;\n  partnerCnic?: IFile[];\n  partnershipDeed?: IFile[];\n  incorporationCertificate?: IFile[];\n  authorityLetter?: IFile[];\n  directorsResolution?: IFile[];\n  memorandumArticlesAssociation?: IFile[];\n  boardMemberCnic?: IFile[];\n  pocCnic?: IFile[];\n  beneficialOwnerCnic?: IFile[];\n  cnicFront?: IFile[];\n  cnicBack?: IFile[];\n  proprietorshipDeclaration?: IFile[];\n  ntnCertificate?: IFile[];\n  bankStatement?: IFile[];\n  financialStatement?: IFile[];\n  addendum?: IFile[];\n  formAB?: IFile[];\n  external_user_id?: string; //will be present if provided at the time of creation\n  created_at: Date;\n  updated_at: Date;\n}\nexport enum CustomerStatus {\n  IN_PROGRESS = 'in_progress',\n  APPROVED = 'approved',\n  REJECTED = 'rejected',\n  PENDING = 'pending',\n}\nenum CompanyType {\n  PUBLIC = 'public_limited_company',\n  PRIVATE = 'private_limited_company',\n}\nenum KYBBusinessType {\n  PARTNERSHIP = 'partnership',\n  SOLE_PROPRIETORSHIP = 'soleProprietorship',\n  COMPANY = 'company',\n  INDIVIDUAL = 'individual',\n  BRANCH_OFFICE = 'branchOffice',\n  NONE = 'none',\n}\ninterface Status {\n  status: string;\n  timestamp: Date;\n  updated_by: string;\n  reason?: string;\n  comment?: string;\n}\ninterface IFacility {\n  id: string;\n  envelope_id: string;\n  envelope_url: string;\n  credit_limit: number;\n  markup: number;\n  contract_documents: string[];\n  contract_details: any;\n  signing_date: Date;\n  expiry_date: Date;\n  status: ContractStatus;\n  status_history: Status[];\n}\nenum ContractStatus {\n  CONTRACT_VALID = 'contract_valid',\n  CONTRACT_EXPIRED = 'contract_expired',\n  CONTRACT_PENDING = 'contract_pending',\n}\ninterface IFile {\n  name: string;\n  resourceURL: string;\n  size: number;\n  verified: boolean;\n}\n\n</code></pre>\n<p>See sample response (may not contain every property that will be returned due to status)</p>\n<h2 id=\"note\">Note</h2>\n<ol>\n<li><p><code>kyb.credit_limit</code> will depict assigned credit_limit for user.</p>\n</li>\n<li><p><code>kyb.status</code> will depict current status of user’s profile (pending, approved or rejected).</p>\n</li>\n<li><p>The reason for rejection will be present in the <code>kyb.statuses</code> array. Check example:</p>\n</li>\n</ol>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">\"statuses\": [\n  {\n      \"status\": \"under_review\",\n      \"timestamp\": \"2023-10-04T13:22:20.750Z\",\n      \"updated_by\": \"system\"\n  },\n  {\n      \"status\": \"rejected\",\n      \"timestamp\": \"2023-10-04T14:05:38.281Z\",\n      \"updated_by\": \"645264057a20e4d48a6530f0\",\n      \"reason\": \"Documents expired/name not matching\"\n  }\n]\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","users"],"host":["{{base_url_lms}}"],"query":[{"key":"email","value":"DanteSparta18@gmail.com"}],"variable":[]}},"response":[{"id":"6d7a682a-cd19-4307-99b8-b3c3737e2501","name":"response","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{base_url_lms}}/v1/external-lending/sme/users?email=DanteSparta18@gmail.com","host":["{{base_url_lms}}"],"path":["v1","external-lending","sme","users"],"query":[{"key":"email","value":"DanteSparta18@gmail.com"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 26 Mar 2024 06:50:59 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"5486"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"298"},{"key":"RateLimit-Reset","value":"16"},{"key":"ETag","value":"W/\"156e-faL6v270glWzqT9eFfmVRnU60O4\""}],"cookie":[],"responseTime":null,"body":"{\n    \"kyb\": {\n        \"refund_dispute_amount\": 0,\n        \"_id\": \"66027000caaa9d57100817a7\",\n        \"email\": \"DanteSparta18@gmail.com\",\n        \"contactNumber\": \"+923361234567\",\n        \"fullName\": \"MadDante\",\n        \"businessName\": \"Riot Games\",\n        \"display_id\": \"OR-K-P5UUTB\",\n        \"businessType\": \"company\",\n        \"businessAddress\": \"123/4 - 11 - Korangi, Karachi\",\n        \"ntn\": \"111111111\",\n        \"status\": \"pending\",\n        \"statuses\": [\n            {\n                \"status\": \"pending\",\n                \"timestamp\": \"2024-03-26T06:49:36.026Z\",\n                \"updated_by\": \"system\",\n                \"reason\": \"Update by User\"\n            }\n        ],\n        \"directorsResolution\": [\n            {\n                \"name\": \"picture_1.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/directorsResolution/0-e27c5c04-5ee2-479f-bcd5-2f0433ff075b.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GXKNUIQNK%2F20240326%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240326T065059Z&X-Amz-Expires=3600&X-Amz-Signature=5aaff0c7e8fa3201f1c363587b5056a14f177db61a4e6f1cc3f5ba9aef321a9b&X-Amz-SignedHeaders=host&x-id=GetObject\",\n                \"size\": 1370168\n            },\n            {\n                \"name\": \"picture 2.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/directorsResolution/1-c0145e2f-f96d-4e43-ae7d-f28f36a7e772.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GXKNUIQNK%2F20240326%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240326T065059Z&X-Amz-Expires=3600&X-Amz-Signature=7bc8e2e1e05a98061ff405157eaf1f57eb292d706f96264eb7bd406b9b8acb72&X-Amz-SignedHeaders=host&x-id=GetObject\",\n                \"size\": 1370168\n            }\n        ],\n        \"memorandumArticlesAssociation\": [\n            {\n                \"name\": \"picture_3.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/memorandumArticlesAssociation/0-33c30a30-9528-49b8-86a8-e5cf91d8482b.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GXKNUIQNK%2F20240326%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240326T065059Z&X-Amz-Expires=3600&X-Amz-Signature=ef0c29e27f16be657c8538315474d6ec12169f880ac08e2d6d599f435942ae5a&X-Amz-SignedHeaders=host&x-id=GetObject\",\n                \"size\": 1370168\n            }\n        ],\n        \"boardMemberCnic\": [\n            {\n                \"name\": \"placeholder-name.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/boardMemberCnic/0-9ef4d429-a854-483e-8fd3-cea35a511c84.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GXKNUIQNK%2F20240326%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240326T065059Z&X-Amz-Expires=3600&X-Amz-Signature=98bbaa937c8a2daed184d038457ee0bfe8ba751eb13be5bd8153f5ae5545da2c&X-Amz-SignedHeaders=host&x-id=GetObject\",\n                \"size\": 1370168\n            }\n        ],\n        \"pocCnic\": [\n            {\n                \"name\": \"placeholder-name.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/pocCnic/0-24fbc676-cb1e-43dc-a52b-74a94e4444c6.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GXKNUIQNK%2F20240326%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240326T065059Z&X-Amz-Expires=3600&X-Amz-Signature=ebe062867e427c2819c82319a7adfbd2524425ebd636d4dc2f41efedaa856a40&X-Amz-SignedHeaders=host&x-id=GetObject\",\n                \"size\": 1370168\n            }\n        ],\n        \"beneficialOwnerCnic\": [\n            {\n                \"name\": \"placeholder-name.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/beneficialOwnerCnic/0-1e7b862d-8a7c-41e5-9138-179e721363d8.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GXKNUIQNK%2F20240326%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240326T065059Z&X-Amz-Expires=3600&X-Amz-Signature=a066e82fd60be0fe94adb52e3ec26421440d7a6ae15310b6717637ac1f1734da&X-Amz-SignedHeaders=host&x-id=GetObject\",\n                \"size\": 1370168\n            }\n        ],\n        \"pastPurchaseOrders\": [\n            {\n                \"name\": \"placeholder-name.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/pastPurchaseOrders/0-f6839919-2c5d-45d3-8864-27c803e5b3fb.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GXKNUIQNK%2F20240326%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240326T065059Z&X-Amz-Expires=3600&X-Amz-Signature=d575b8d82d40872428973643698857c3999dfc30228b1c5d54b29ee21054ae15&X-Amz-SignedHeaders=host&x-id=GetObject\",\n                \"size\": 1370168\n            }\n        ],\n        \"pastInvoices\": [\n            {\n                \"name\": \"placeholder-name.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/pastInvoices/0-cafc30bf-7eb7-4e34-b689-274375a36c8d.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GXKNUIQNK%2F20240326%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240326T065059Z&X-Amz-Expires=3600&X-Amz-Signature=7e08dfa28b696dedbdf1b3e7c111b1caa9261a01d6dbf1d138db9ecbaea01ff3&X-Amz-SignedHeaders=host&x-id=GetObject\",\n                \"size\": 1370168\n            }\n        ],\n        \"otherFiles\": [\n            {\n                \"name\": \"placeholder-name.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/otherFiles/0-90f539b7-0bc9-4aa2-b46b-a3970a42a05f.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GXKNUIQNK%2F20240326%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240326T065059Z&X-Amz-Expires=3600&X-Amz-Signature=a650fe139be06fe876102abf7cd87ca595b96d217a161a84e40526872f23a2c0&X-Amz-SignedHeaders=host&x-id=GetObject\",\n                \"size\": 1370168\n            }\n        ],\n        \"facilities\": [\n            {\n                \"envelope_id\": \"66e82d4092bbb6b303bda7e9\",\n                \"envelope_url\": \"https://stag-secure.dashsign.co/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZlbG9wZV9pZCI6IjY2ZTgyZDQwOTJiYmI2YjMwM2JkYTdlOSIsInJlY2lwaWVudF9pZCI6IjY2ZTJjNTMxZDc2MzE2NzU1YzI2YWRlMiIsImlhdCI6MTcyNjQ5MTk2OCwiZXhwIjoxNzI5MDgwMzY4fQ.fGp1cgtsm5lLv4KJQQW3sySp3eeR-HkhlZlBeMCyrPI\",\n                \"credit_limit\": 100000,\n                \"markup\": 30,\n                \"contract_documents\": [\n                    \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/Contract_document_1_66e2c531d76316755c26ade2_1727184943.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GYZCBJV45%2F20241120%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20241120T064506Z&X-Amz-Expires=3600&X-Amz-Signature=72f88fb31c1cf922c10f2c60ae4839a22c708cc0148b8e408b7b71851a4f58e4&X-Amz-SignedHeaders=host&x-id=GetObject\",\n                    \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/Contract_document_2_66e2c531d76316755c26ade2_1727184943.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GYZCBJV45%2F20241120%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20241120T064506Z&X-Amz-Expires=3600&X-Amz-Signature=8ad4c64c19c42a0afa43b8e660dc7826437cf4061bd4aa5f8c8a36dc3bcf5778&X-Amz-SignedHeaders=host&x-id=GetObject\",\n                    \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/Contract_document_3_66e2c531d76316755c26ade2_1727184943.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GYZCBJV45%2F20241120%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20241120T064506Z&X-Amz-Expires=3600&X-Amz-Signature=67eccb6cda947756645e6e003bc891f015428fcbba1827acb11850392418876c&X-Amz-SignedHeaders=host&x-id=GetObject\"\n                ],\n                \"signing_date\": \"2024-09-24T13:35:43.579Z\",\n                \"expiry_date\": \"2054-09-24T13:35:43.579Z\",\n                \"status_history\": [\n                    {\n                        \"status\": \"contract_pending\",\n                        \"timestamp\": \"2024-09-16T13:06:09.000Z\",\n                        \"updated_by\": \"system\"\n                    },\n                    {\n                        \"status\": \"contract_valid\",\n                        \"timestamp\": \"2024-09-24T13:35:43.580Z\",\n                        \"updated_by\": \"system\"\n                    }\n                ],\n                \"contract_details\": {\n                    \"language\": \"en\",\n                    \"designation\": \"dummy\",\n                    \"gender\": \"male\",\n                    \"male_relative\": \"father\",\n                    \"facility_amount_digits\": \"100000\",\n                    \"facility_markup\": \"30\",\n                    \"facility_tenure\": \"30\",\n                    \"net_worth_digits\": \"1000000\",\n                    \"loan_purpose\": \"testing\",\n                    \"cnic_number\": \"111111111\"\n                },\n                \"status\": \"contract_valid\",\n                \"amendments\": []\n            }\n        ],\n        \"available_credit_limit\": 100000,\n        \"credit_limit\": 100000,\n        \"markup\": 30,\n        \"contractual_credit_limit\": 100000,\n        \"created_at\": \"2024-03-26T06:49:36.031Z\",\n        \"updated_at\": \"2024-03-26T06:49:41.742Z\",\n        \"id\": \"66027000caaa9d57100817a7\"\n    }\n}"}],"_postman_id":"04b3e24e-21dd-4703-abf8-7c042bad4fb7"},{"name":"update-lending-user","id":"787ade6b-16ff-416e-ba38-48cd7e1d07b0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"DanteSparta18@gmail.com\",\n    \"fullName\": \"MadDanteNew\",\n    \"ntn\": \"12345678\",\n    \"businessAddress\": \"Hyderabad, Sindh, Pakistan\",\n    \"contactNumber\": \"+923351234567\",\n    \"businessName\": \"Riot Games New\",\n    \"memorandumArticlesAssociation\": [\n        {\n            \"name\": \"memorandumAA-New\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pocCnic\": [\n        {\n            \"name\": \"pocCnic-New\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/users","description":"<p>This API updates an existing lending user whose <code>email</code> , <code>contactNumber</code>, <code>ntn</code>, and/or <code>external_user_id</code> is passed in the query parameters. All <code>KYB/KYC</code> information to be changed is entered via the API body. Since this is an update, not all information is mandatory all the time related to the required KYB information based on <code>business_type</code>. Also, once the information is updated, the <code>status</code> of <code>KYB</code> again goes to <code>under_review</code> and the user is blocked from creating any further finance requests until the <code>KYB</code> is approved again from CB. To simulate processing <code>KYB</code>, you can access the <code>Process KYB</code> API.</p>\n<p>If the <code>KYB</code> was rejected, subsequent requests for updates may result in an error response. In some cases, a cooldown time may be assigned to <code>KYB</code> applications. Once the cooldown time expires, an update request will be accepted.</p>\n<h2 id=\"query-parameters\">Query Parameters</h2>\n<p>Either one or any combination of these query params can be used to fetch the user that needs to be updated. Alteast one query param needs to exist in the request.</p>\n<ul>\n<li><p>email: <code>string</code></p>\n</li>\n<li><p>contactNumber: <code>string</code> - must be in format <code>+92XXXXXXXXXX</code></p>\n</li>\n<li><p>ntn: <code>string</code></p>\n</li>\n<li><p>external_user_id: <code>string</code></p>\n</li>\n</ul>\n<h2 id=\"note\">Note</h2>\n<p>Fields to be updated are to be sent in the request body with their corresponding values. All fields are optional.</p>\n<p><em>For backward compatibility we still allow the</em> <code>email</code> <em>of the user, to be sent in the request body. However you are reccomended to send the user search params in the query params of the request.</em></p>\n<h2 id=\"request-body-parameters\">Request Body Parameters</h2>\n<h3 id=\"applicable-for-all-business-types\">Applicable for All Business Types</h3>\n<ul>\n<li><p><code>external_user_id</code>: <code>string</code> - (optional) - field if partner would like to link their user identifier. It is recommended to send this all the time.</p>\n</li>\n<li><p><code>fullName</code>: <code>string</code> - (optional)</p>\n</li>\n<li><p><code>contactNumber</code>: <code>string</code> - (optional) - in format <code>+92xxxxxxxxxx</code> - <code>must be unique</code></p>\n</li>\n<li><p><code>businessName</code>: <code>string</code> - (optional)</p>\n</li>\n<li><p><code>businessType</code>: <code>individual</code> | <code>branchOffice</code> | <code>partnership</code> | <code>company</code> | <code>soleProprietorship</code> - (optional)</p>\n</li>\n<li><p><code>businessAddress</code>: <code>string</code> - (optional)</p>\n</li>\n<li><p><code>pastPurchaseOrders</code>: <code>Array{FileDto}</code> - (optional)</p>\n</li>\n<li><p><code>pastInvoices</code>: <code>Array{FileDto}</code> - (optional)</p>\n</li>\n<li><p><code>financialStatement</code>: <code>Array{FileDto}</code> - (optional)</p>\n</li>\n<li><p><code>otherFiles</code>: <code>Array</code> - (optional) - Any extra files that partner has. name must be present to demonstrate what the file is about.</p>\n</li>\n<li><p><code>bankDetails</code>: <code>bankDetailsDto</code> - (optional) - has 3 mandatory fields i.e. <code>accountTitle</code>, <code>accountNumber</code> and <code>bankCode</code> and 1 optional (but recommended) field for <code>iban</code>. Use <a href=\"https://docs.creditbook.pk/#b639d910-f86e-4bf2-ba38-a6deb763add0\">get-banks</a> api for <code>bankCode</code>.</p>\n</li>\n</ul>\n<h3 id=\"fields-if-businesstype-is-individual\">Fields if <em><strong>businessType</strong></em> is <em><strong>individual</strong></em></h3>\n<ul>\n<li><p><code>cnicFront</code> - <code>Array{FileDto}</code> - (optional)</p>\n</li>\n<li><p><code>cnicBack</code> - <code>Array{FileDto}</code> - (optional)</p>\n</li>\n</ul>\n<h3 id=\"fields-if-businesstype-is-soleproprietership\">Fields if <em><strong>businessType</strong></em> is <em><strong>soleProprietership</strong></em></h3>\n<ul>\n<li><p><code>cnicFront</code> - <code>Array{FileDto}</code> - (optional)</p>\n</li>\n<li><p><code>cnicBack</code> - <code>Array{FileDto}</code> - (optional)</p>\n</li>\n<li><p><code>proprietorshipDeclaration</code> - <code>Array{FileDto}</code> - (optional) - Proprietorship Declaration Letter from the Bank</p>\n</li>\n<li><p><code>ntnCertificate</code> - <code>Array{FileDto}</code> - (optional)</p>\n</li>\n<li><p><code>bankStatement</code> - <code>Array{FileDto}</code> - (optional) - bank statement of 6 months</p>\n</li>\n</ul>\n<h3 id=\"fields-if-businesstype-is-partnership\">Fields if <em><strong>businessType</strong></em> is <em><strong>partnership</strong></em></h3>\n<ul>\n<li><p><code>partnerCnic</code>: <code>Array{FileDto}</code> - (optional) - CNICs of all Partners (Front and Back in Single file)</p>\n</li>\n<li><p><code>partnershipDeed</code>: <code>Array{FileDto}</code> - (optional) - Attested copy of Partnership Deed</p>\n</li>\n<li><p><code>incorporationCertificate</code>: <code>Array{FileDto}</code> - (optional) - Attested copy of Registration Certificate with Registrar of Firms</p>\n</li>\n<li><p><code>authorityLetter</code>: <code>Array{FileDto}</code> - (optional) - Authority letter from all partners, in original, authorizing the person(s) to operate firm’s account</p>\n</li>\n</ul>\n<h2 id=\"fields-if-businesstype-is-company\">Fields if <em><strong>businessType</strong></em> is <em><strong>company</strong></em></h2>\n<ul>\n<li><p><code>directorsResolution</code>: <code>Array{FileDto}</code> - (optional) - Certified Copy of Resolution of Board of Directors for opening of account</p>\n</li>\n<li><p><code>memorandumArticlesAssociation</code>: <code>Array{FileDto}</code> - (optional) - Certified Copy of Memorandum and Articles of Association</p>\n</li>\n<li><p><code>boardMemberCnic</code>: <code>Array{FileDto}</code> - (optional) - CNICs of all Board members (Front and Back in Single file)</p>\n</li>\n<li><p><code>pocCnic</code>: <code>Array{FileDto}</code> - (optional) - CNIC of the Person authorized as Point of Contact</p>\n</li>\n<li><p><code>beneficialOwnerCnic</code>:<code>Array{FileDto}</code> - (optional) - CNICs of the beneficial owners (Front and Back)</p>\n</li>\n<li><p><code>addendum</code>: <code>Array{FileDto}</code> - (optional) - Form II in case of newly incorporated company and Form A/Form C whichever is applicable; and Form 29 if already incorporated company</p>\n</li>\n<li><p><code>formAB</code>: <code>Array{FileDto}</code> - (optional) - Certified copy of Latest Form-A/Form-B</p>\n</li>\n</ul>\n<h3 id=\"fields-if-businesstype-is-branchoffice\">Fields if <em><strong>businessType</strong></em> is <em><strong>branchOffice</strong></em></h3>\n<ul>\n<li><p><code>permissionLetter</code> - <code>Array{FileDto}</code> - (optional) - Permission letter from relevant authority i-e Board of Investment</p>\n</li>\n<li><p><code>signatoryPassports</code> - <code>Array{FileDto}</code> - (optional) - Valid passports of all the signatories of account</p>\n</li>\n<li><p><code>formIIParticulars</code> - <code>Array{FileDto}</code> - (optional) - Form II about particulars of directors, Principal Officer etc. in case of newly registered branch or liaison office of a foreign company</p>\n</li>\n<li><p><code>principalOfficeAuthorization</code> - <code>Array{FileDto}</code> - (optional) - A Letter from Principal Office of the entity authorizing the person(s) to open and operate the account</p>\n</li>\n</ul>\n<h3 id=\"filedto-type\">FileDTO Type</h3>\n<p>Please make sure to send <code>FileDto</code> typed files in the following format. Convert to array of objects where applicable</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">type FileDto {\n     resourceURL: string; // This is the link to the image/document. It should be downloadable.\n     name?: string // optional description of the file\n}\n\n</code></pre>\n<h3 id=\"bankdetailsdto-type\">BankDetailsDTO Type</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">type BankDetailsDto {\n     bankCode: string; // bank code associated with the user's bank (use get-banks api) \n     accountTitle: string // bank account title\n     accountNumber: string //bank account number\n     iban?: string //IBAN of the given bank account number\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","users"],"host":["{{base_url_lms}}"],"query":[],"variable":[]}},"response":[{"id":"912fba95-b4cb-4192-a726-2fb0553cd827","name":"response","originalRequest":{"method":"PATCH","header":[{"key":"","value":"","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\n    \"email\": \"DanteSparta18@gmail.com\",\n    \"fullName\": \"MadDanteNew\",\n    \"ntn\": \"12345678\",\n    \"businessAddress\": \"Hyderabad, Sindh, Pakistan\",\n    \"contactNumber\": \"+923351234567\",\n    \"businessName\": \"Riot Games New\",\n    \"memorandumArticlesAssociation\": [\n        {\n            \"name\": \"memorandumAA-New\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ],\n    \"pocCnic\": [\n        {\n            \"name\": \"pocCnic-New\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/users"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 26 Mar 2024 06:54:00 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"2644"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"15"},{"key":"ETag","value":"W/\"a54-j7k3vpGIt1aG/qL+IaS7mE1Hy2o\""}],"cookie":[],"responseTime":null,"body":"{\n    \"kyb\": {\n        \"_id\": \"66027000caaa9d57100817a7\",\n        \"email\": \"DanteSparta18@gmail.com\",\n        \"contactNumber\": \"+923351234567\",\n        \"fullName\": \"MadDanteNew\",\n        \"businessName\": \"Riot Games New\",\n        \"display_id\": \"OR-K-P5UUTB\",\n        \"businessType\": \"company\",\n        \"businessAddress\": \"Hyderabad, Sindh, Pakistan\",\n        \"ntn\": \"12345678\",\n        \"status\": \"pending\",\n        \"statuses\": [\n            {\n                \"status\": \"pending\",\n                \"timestamp\": \"2024-03-26T06:49:36.026Z\",\n                \"updated_by\": \"system\",\n                \"reason\": \"Update by User\"\n            },\n            {\n                \"status\": \"pending\",\n                \"timestamp\": \"2024-03-26T06:54:00.443Z\",\n                \"updated_by\": \"system\",\n                \"reason\": \"Update by User\"\n            }\n        ],\n        \"directorsResolution\": [\n            {\n                \"name\": \"picture_1.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/directorsResolution/0-e27c5c04-5ee2-479f-bcd5-2f0433ff075b.png\",\n                \"size\": 1370168\n            },\n            {\n                \"name\": \"picture 2.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/directorsResolution/1-c0145e2f-f96d-4e43-ae7d-f28f36a7e772.png\",\n                \"size\": 1370168\n            }\n        ],\n        \"memorandumArticlesAssociation\": [\n            {\n                \"name\": \"memorandumAA-New\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\",\n                \"size\": 0\n            }\n        ],\n        \"boardMemberCnic\": [\n            {\n                \"name\": \"placeholder-name.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/boardMemberCnic/0-9ef4d429-a854-483e-8fd3-cea35a511c84.png\",\n                \"size\": 1370168\n            }\n        ],\n        \"pocCnic\": [\n            {\n                \"name\": \"pocCnic-New\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\",\n                \"size\": 0\n            }\n        ],\n        \"beneficialOwnerCnic\": [\n            {\n                \"name\": \"placeholder-name.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/beneficialOwnerCnic/0-1e7b862d-8a7c-41e5-9138-179e721363d8.png\",\n                \"size\": 1370168\n            }\n        ],\n        \"pastPurchaseOrders\": [\n            {\n                \"name\": \"placeholder-name.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/pastPurchaseOrders/0-f6839919-2c5d-45d3-8864-27c803e5b3fb.png\",\n                \"size\": 1370168\n            }\n        ],\n        \"pastInvoices\": [\n            {\n                \"name\": \"placeholder-name.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/pastInvoices/0-cafc30bf-7eb7-4e34-b689-274375a36c8d.png\",\n                \"size\": 1370168\n            }\n        ],\n        \"otherFiles\": [\n            {\n                \"name\": \"placeholder-name.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/66027000caaa9d57100817a7/otherFiles/0-90f539b7-0bc9-4aa2-b46b-a3970a42a05f.png\",\n                \"size\": 1370168\n            }\n        ],\n        \"facilities\": [],\n        \"created_at\": \"2024-03-26T06:49:36.031Z\",\n        \"updated_at\": \"2024-03-26T06:54:00.444Z\",\n        \"id\": \"66027000caaa9d57100817a7\"\n    }\n}"}],"_postman_id":"787ade6b-16ff-416e-ba38-48cd7e1d07b0"}],"id":"9a91e260-1f61-4bcb-952b-6d24e700db85","description":"<p>These APIs focus on performing CRUD operations for lending user-specific data.</p>\n","_postman_id":"9a91e260-1f61-4bcb-952b-6d24e700db85","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}}},{"name":"Loan-Transactions","item":[{"name":"Create Transaction","item":[],"id":"8988b3de-dc06-4114-ba72-24b165adc246","description":"<p>Refer to this <a href=\"https://docs.creditbook.pk/#1ef3ee1a-a2c5-4c13-a6ee-61690ac1378d\">API</a> for creating a loan transaction of a <code>disbursed</code> loan</p>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"dcda49db-4178-4dff-9ae3-b040e6471810","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"b50c19e4-557b-404d-acc8-477e11488f96","type":"text/javascript","exec":[""]}}],"_postman_id":"8988b3de-dc06-4114-ba72-24b165adc246"},{"name":"get-all-transactions","id":"3624c3b9-0791-4a4d-adfd-3be00fd6cf6b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/loans/65c62405c5f722d4ad492b8e/transaction","description":"<p>This API helps in getting all loan transactions of a selected loan. This would also include all the disbursement and repayment transactions</p>\n<h2 id=\"request-parameters\">Request Parameters</h2>\n<ul>\n<li><strong>loan_id</strong> (string, required): loan <code>id</code> for which the transactions are to be retrieved</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>See sample response.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","loans","65c62405c5f722d4ad492b8e","transaction"],"host":["{{base_url_lms}}"],"query":[],"variable":[]}},"response":[{"id":"c8492899-47bb-4628-ac46-b7833f654b0d","name":"response","originalRequest":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/loans/65c5d9e646eac4f838561e8a/transaction"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 08:12:17 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1430"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"297"},{"key":"RateLimit-Reset","value":"16"},{"key":"ETag","value":"W/\"596-0630NFl4ZzTIJoUxJj+ZzXA3C0Y\""}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"user_id\": \"65c5d21e055f2cea81524164\",\n        \"loan_id\": \"65c5d9e646eac4f838561e8a\",\n        \"type\": \"disbursement\",\n        \"statuses\": [\n            {\n                \"status\": \"processing\",\n                \"timestamp\": \"2024-02-09T08:04:35.227Z\",\n                \"updated_by\": \"system\"\n            },\n            {\n                \"status\": \"approved\",\n                \"timestamp\": \"2024-02-09T08:04:35.244Z\",\n                \"updated_by\": \"65a6696c888d21a7b4b50e64\"\n            }\n        ],\n        \"payment_date\": \"2024-02-09T08:04:35.227Z\",\n        \"amount\": 2000,\n        \"method\": \"bank_transfer\",\n        \"status\": \"approved\",\n        \"created_at\": \"2024-02-09T08:04:35.229Z\",\n        \"updated_at\": \"2024-02-09T08:04:35.244Z\",\n        \"id\": \"65c5dc9346eac4f838561f16\"\n    },\n    {\n        \"user_id\": \"65c5d21e055f2cea81524164\",\n        \"loan_id\": \"65c5d9e646eac4f838561e8a\",\n        \"type\": \"repayment\",\n        \"statuses\": [\n            {\n                \"status\": \"processing\",\n                \"timestamp\": \"2024-02-09T08:11:23.122Z\",\n                \"updated_by\": \"65a6696c888d21a7b4b50e64\"\n            }\n        ],\n        \"payment_date\": \"2023-12-15T12:49:12.848Z\",\n        \"amount\": 2000,\n        \"method\": \"bank_transfer\",\n        \"status\": \"processing\",\n        \"transaction_image\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/transaction_images/65c5d9e646eac4f838561e8a-1707466282900.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GXKNUIQNK%2F20240209%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240209T081217Z&X-Amz-Expires=3600&X-Amz-Signature=d4e5aabf8bcbd92aba0fb8d6128de81eb3c965758f7e02888b67d587e61cfce7&X-Amz-SignedHeaders=host&x-id=GetObject\",\n        \"created_at\": \"2024-02-09T08:11:23.123Z\",\n        \"updated_at\": \"2024-02-09T08:11:23.123Z\",\n        \"id\": \"65c5de2b46eac4f838561f29\"\n    }\n]"}],"_postman_id":"3624c3b9-0791-4a4d-adfd-3be00fd6cf6b"},{"name":"get-transaction-by-id","id":"f3a19811-9f7e-49c9-bbd1-83ca64e8295b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/loans/65c62405c5f722d4ad492b8e/transaction/65c62569c5f722d4ad492bf0","description":"<p>This API won't be much useful at the user side however, partners can use it to fetch the transaction with <code>id=transaction_id</code> of loan with <code>id=loan_id</code> of any loan. Please make sure to send correct ids otherwise will throw not found error.</p>\n<h2 id=\"request-parameters\">Request Parameters</h2>\n<ul>\n<li><strong>loan_id</strong> (string, required): loan <code>id</code> for which the transaction details is to be retrieved</li>\n<li><strong>transaction_id</strong> (string, required): transaction <code>id</code> whose details are to be retrieved</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>See sample response.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","loans","65c62405c5f722d4ad492b8e","transaction","65c62569c5f722d4ad492bf0"],"host":["{{base_url_lms}}"],"query":[],"variable":[]}},"response":[{"id":"2f167dc1-cd0f-4ab9-9bd5-efc8d59fd666","name":"response","originalRequest":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/loans/65c5d9e646eac4f838561e8a/transaction/65c5de2b46eac4f838561f29"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 08:12:06 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"593"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"298"},{"key":"RateLimit-Reset","value":"28"},{"key":"ETag","value":"W/\"251-K2Cmdr/vanIPkEsKTWimb6PkEAo\""}],"cookie":[],"responseTime":null,"body":"{\n    \"user_id\": \"65c5d21e055f2cea81524164\",\n    \"loan_id\": \"65c5d9e646eac4f838561e8a\",\n    \"type\": \"repayment\",\n    \"statuses\": [\n        {\n            \"status\": \"processing\",\n            \"timestamp\": \"2024-02-09T08:11:23.122Z\",\n            \"updated_by\": \"65a6696c888d21a7b4b50e64\"\n        }\n    ],\n    \"payment_date\": \"2023-12-15T12:49:12.848Z\",\n    \"amount\": 2000,\n    \"method\": \"bank_transfer\",\n    \"status\": \"processing\",\n    \"transaction_image\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/transaction_images/65c5d9e646eac4f838561e8a-1707466282900.png\",\n    \"created_at\": \"2024-02-09T08:11:23.123Z\",\n    \"updated_at\": \"2024-02-09T08:11:23.123Z\",\n    \"id\": \"65c5de2b46eac4f838561f29\"\n}"}],"_postman_id":"f3a19811-9f7e-49c9-bbd1-83ca64e8295b"}],"id":"96060405-53e6-4f81-8999-443c6dbf3f0c","description":"<p>These APIs focus on performing CRUD operations for loans-transactions</p>\n","_postman_id":"96060405-53e6-4f81-8999-443c6dbf3f0c","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}}},{"name":"Loans","item":[{"name":"Create Loan","item":[],"id":"70096d60-5dfa-4567-a9b0-2ce766240245","description":"<p>Refer to this <a href=\"https://docs.creditbook.pk/#1fd4226a-aabf-4809-8419-4ea0c6e26d31\">API</a> for creating a loan of a user</p>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"dcda49db-4178-4dff-9ae3-b040e6471810","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"b50c19e4-557b-404d-acc8-477e11488f96","type":"text/javascript","exec":[""]}}],"_postman_id":"70096d60-5dfa-4567-a9b0-2ce766240245"},{"name":"get-all-loans","id":"3282dfe7-7d16-4de8-9239-9b983a5493d9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/loans?email=DanteSparta20@gmail.com&loanStatuses=under_review, disbursed","description":"<p>This API helps in getting all of the user whose <code>email</code>, <code>contactNumber</code>, <code>ntn</code>, and/or <code>external_user_id</code> is passed in the query parameters. If no loans exist, returns an empty array. This should typically be used to display all the loans to the user.</p>\n<h2 id=\"request-query-parameters\">Request Query Parameters</h2>\n<ul>\n<li><p><strong>email/ntn/external_user_id/contactNumber</strong> (string, required): any of the customer's unique identifier for which the loans are to be fetched</p>\n</li>\n<li><p><strong>loanStatuses</strong> (string, optional): comma separated statuses for the loans to be fetched. If not sent in the request then loans of all statuses will be fetched. Following are the possible statuses of loans:</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">enum FinanceAppState {\n  // Initial Statuses - Can be considered as Under Review\n  IN_PROGRESS = 'in_progress',\n  UNDER_REVIEW = 'under_review',\n  REVISION_REQUESTED = 'revision_requested',\n  AWAITING_LM_APPROVAL = 'awaiting_lm_approval',\n  AWAITING_ADMIN_APPROVAL = 'awaiting_admin_approval',\n  // Active loan statuses\n  APPROVED = 'approved',\n  READY_TO_DISBURSE = 'ready_to_disburse',\n  DISBURSED = 'disbursed',\n  OVERDUE = 'overdue',\n  DEFAULT = 'default',\n  // terminal\n  REJECTED = 'rejected',\n  COMPLETED = 'completed',\n}\n\n</code></pre>\n<h2 id=\"note\">Note</h2>\n<p>To see how to figure out statuses or reasons for a particular loan, check the Get Loan By ID API. Same logic would apply here.</p>\n<ol>\n<li><p><code>loan.pending</code> will depict current outstanding amount.</p>\n</li>\n<li><p><code>loan.status</code> will depict current status of loan (under_review, approved, disbursed, overdue, completed or rejected).</p>\n</li>\n<li><p>The reason for rejection will be present in the <code>loan.statuses</code> array. The latest status will have the relevant reason. For example:</p>\n</li>\n</ol>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">\"statuses\": [\n  {\n      \"status\": \"under_review\",\n      \"timestamp\": \"2023-10-04T13:22:20.750Z\",\n      \"updated_by\": \"system\"\n  },\n  {\n      \"status\": \"rejected\",\n      \"timestamp\": \"2023-10-04T14:05:38.281Z\",\n      \"updated_by\": \"645264057a20e4d48a6530f0\",\n      \"reason\": \"Documents expired/name not matching\" &lt;--- Mentioned Reason\n  }\n]\n\n</code></pre>\n<h2 id=\"query-parameters\">Query Parameters</h2>\n<p>Either one or any combination of these query params can be used to fetch the loans of the user. Alteast one query param needs to exist in the request.</p>\n<ul>\n<li><p>email: <code>string</code></p>\n</li>\n<li><p>contactNumber: <code>string</code> - must be in format <code>+92XXXXXXXXXX</code></p>\n</li>\n<li><p>ntn: <code>string</code></p>\n</li>\n<li><p>external_user_id: <code>string</code></p>\n</li>\n</ul>\n<p>Optioanl Query Param:</p>\n<ul>\n<li>loanStatuses: <code>string</code> - (optional) - comma-separated value for loan statuses (by default will fetch loans with all statuses.</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>Following is the loan type in the response.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">interface response {\n  loans: ILoan,\n}\ninterface ILoan {\n  _id: ObjectId;\n  display_id: string;\n  user_id: string;\n  customer_name: string;\n  disbursement_date?: Date;\n  principal_amount?: number;\n  statuses?: StatusObject[];\n  status: FinanceAppState;\n  type: LoanType;\n  tenure?: number;\n  business_type?: BusinessSegmentType;\n  markup?: number;\n  markup_per_day?: number;\n  due_date?: Date;\n  payments?: {\n    principal_repaid: number;\n    late_fees: number;\n    markup_fee: number;\n  };\n  pending?: {\n    principal: number;\n    late_fees: number;\n    markup_fee: number;\n  };\n  disbursement_account_details?: {\n    account_number: string;\n    account_title: string;\n    bank_code: string;\n    iban?: string;\n  };\n  disbursement_account_id?: string; // This will be a bank account id in our bank accounts collection\n  raw?: string;\n  created_at?: Date;\n  updated_at?: Date;\n  external_images?: any;\n  external_user_id?: string;\n}\nenum BusinessSegmentType {\n  SME = 'sme',\n  MSME = 'msme',\n}\nenum LoanType {\n  FIXED = 'fixed',\n  DAILY = 'daily',\n}\nenum FinanceAppState {\n  // Initial Statuses - Can be considered as Under Review\n  IN_PROGRESS = 'in_progress',\n  UNDER_REVIEW = 'under_review',\n  REVISION_REQUESTED = 'revision_requested',\n  AWAITING_LM_APPROVAL = 'awaiting_lm_approval',\n  AWAITING_ADMIN_APPROVAL = 'awaiting_admin_approval',\n  // Active loan statuses\n  APPROVED = 'approved',\n  READY_TO_DISBURSE = 'ready_to_disburse',\n  DISBURSED = 'disbursed',\n  OVERDUE = 'overdue',\n  DEFAULT = 'default',\n  // terminal\n  REJECTED = 'rejected',\n  COMPLETED = 'completed',\n}\ninterface Status {\n  status: string;\n  timestamp: Date;\n  updated_by: string; // user_id of LMS personnel\n  reason?: string;\n  comment?: string;\n}\n\n</code></pre>\n<p>See sample response (may not contain every property that will be returned due to status)</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","loans"],"host":["{{base_url_lms}}"],"query":[{"key":"email","value":"DanteSparta20@gmail.com"},{"key":"loanStatuses","value":"under_review, disbursed"}],"variable":[]}},"response":[{"id":"47e39deb-7ba6-43e7-b4d7-e1ce126f88f4","name":"response","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{base_url_lms}}/v1/external-lending/sme/loans?email=DanteSparta14@gmail.com","host":["{{base_url_lms}}"],"path":["v1","external-lending","sme","loans"],"query":[{"key":"email","value":"DanteSparta14@gmail.com"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 07:55:18 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"991"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"298"},{"key":"RateLimit-Reset","value":"15"},{"key":"ETag","value":"W/\"3df-IxN4kfRIN+/bxtY8z73jeZNmTkg\""}],"cookie":[],"responseTime":null,"body":"{\n    \"loans\": [\n        {\n            \"_id\": \"65c5d9e646eac4f838561e8a\",\n            \"invoice_data\": [\n                {\n                    \"name\": \"Invoice_Doc_1.png\",\n                    \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/0-9f9b1cf8-45f2-45f5-bc2f-5d60b8d9dd3e.png\"\n                },\n                {\n                    \"name\": \"Invoice_Doc_2.png\",\n                    \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/1-d32e60cf-3705-4fe8-9a7d-a0853a9d4dbd.png\"\n                },\n                {\n                    \"name\": \"Invoice_Doc_3.png\",\n                    \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/2-270d8178-8210-46a9-9825-dfe1063f6131.png\"\n                }\n            ],\n            \"required_financing\": 20000,\n            \"user_id\": \"65c5d21e055f2cea81524164\",\n            \"customer_name\": \"Riot Games New\",\n            \"principal_amount\": 20000,\n            \"statuses\": [\n                {\n                    \"status\": \"under_review\",\n                    \"timestamp\": \"2024-02-09T07:53:10.462Z\",\n                    \"updated_by\": \"system\"\n                }\n            ],\n            \"status\": \"under_review\",\n            \"type\": \"daily\",\n            \"created_at\": \"2024-02-09T07:53:10.502Z\",\n            \"updated_at\": \"2024-02-09T07:53:12.152Z\",\n            \"id\": \"65c5d9e646eac4f838561e8a\"\n        }\n    ]\n}"}],"_postman_id":"3282dfe7-7d16-4de8-9239-9b983a5493d9"},{"name":"get-loan-by-id","id":"1e37e580-c291-46db-a80e-653990443b68","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/loans/65c62405c5f722d4ad492b8e","description":"<p>This gets the specific loan based on <code>id</code> passed in request parameters. This should not be used by the customer as there is no user validation in this API however, partners can use it for their own ease to get details of certain loans of their users.</p>\n<h2 id=\"request-parameters\">Request Parameters</h2>\n<ul>\n<li><strong>loan_id</strong> (string): The unique identifier of the loan.</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>See sample response. (Or see <a href=\"https://docs.creditbook.pk/#a248accb-4da0-4948-ba42-24702d468c68\">get-all-loans</a> response for one element)</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","loans","65c62405c5f722d4ad492b8e"],"host":["{{base_url_lms}}"],"query":[],"variable":[]}},"response":[{"id":"8fbd9f81-9f46-4de2-9bcb-daea0c955762","name":"response","originalRequest":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/loans/65c5d9e646eac4f838561e8a"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 07:53:36 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"988"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"58"},{"key":"ETag","value":"W/\"3dc-fLSUG1G5B2y71sRdxReRt5XDYqA\""}],"cookie":[],"responseTime":null,"body":"{\n    \"loan\": {\n        \"_id\": \"65c5d9e646eac4f838561e8a\",\n        \"invoice_data\": [\n            {\n                \"name\": \"Invoice_Doc_1.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/0-9f9b1cf8-45f2-45f5-bc2f-5d60b8d9dd3e.png\"\n            },\n            {\n                \"name\": \"Invoice_Doc_2.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/1-d32e60cf-3705-4fe8-9a7d-a0853a9d4dbd.png\"\n            },\n            {\n                \"name\": \"Invoice_Doc_3.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/2-270d8178-8210-46a9-9825-dfe1063f6131.png\"\n            }\n        ],\n        \"required_financing\": 20000,\n        \"user_id\": \"65c5d21e055f2cea81524164\",\n        \"customer_name\": \"Riot Games New\",\n        \"principal_amount\": 20000,\n        \"statuses\": [\n            {\n                \"status\": \"under_review\",\n                \"timestamp\": \"2024-02-09T07:53:10.462Z\",\n                \"updated_by\": \"system\"\n            }\n        ],\n        \"status\": \"under_review\",\n        \"loan_product\": {\n            \"shariah_compliant\": true,\n            \"late_fee\": {\n                \"applicable\": true,\n                \"multiplier\": 0.5,\n                \"grace_period\": 4\n            },\n            \"security\": \"Hypothecation on current assets\",\n            \"maturity\": {\n                \"type\": \"fixed\",\n                \"max\": 30\n            },\n            \"repayment_schedule\": {\n                \"early_repayment\": true,\n                \"repayment_method\": \"bullet\",\n                \"tenor_control\": \"financial_institution\"\n            },\n            \"interest_rate\": {\n                \"method\": \"daily\",\n                \"type\": \"fixed\",\n                \"max\": 3.5\n            },\n            \"flow_of_funds\": {\n                \"disbursement\": \"third_party\",\n                \"repayment\": \"borrower\"\n            },\n            \"notification_medium\": \"sms\",\n            \"disable_virtual_account\": false,\n            \"revenue_share\": 33.33\n        },\n        \"type\": \"daily\",\n        \"created_at\": \"2024-02-09T07:53:10.502Z\",\n        \"updated_at\": \"2024-02-09T07:53:12.152Z\",\n        \"id\": \"65c5d9e646eac4f838561e8a\"\n    }\n}"}],"_postman_id":"1e37e580-c291-46db-a80e-653990443b68"},{"name":"update-loan","id":"fbb60a04-ec5b-4401-a305-178568a81d74","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"invoice_data\": [\n        {\n            \"name\": \"invoice_doc_new\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/loans/65c62405c5f722d4ad492b8e","description":"<p>API is used to mark refund in the system.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"principal_amount\": 1000, // mandatory\n    \"reason\": \"reason for refund\", // non mandatory \n    \"type\": \"refund\" // type can be refund or dispute\n}\n\n</code></pre>\n<p>Note: This endpoint can only be configuratively enabled and wouldn't be available for all partner by default.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","loans","65c62405c5f722d4ad492b8e"],"host":["{{base_url_lms}}"],"query":[],"variable":[]}},"response":[{"id":"d0e72e3b-edcd-420f-b824-078858e59d3c","name":"response","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"invoice_data\": [\n        {\n            \"name\": \"invoice_doc_new\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/loans/65c5d9e646eac4f838561e8a"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 07:57:30 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1533"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"4"},{"key":"ETag","value":"W/\"5fd-8+xLtRc9bWnPj4XDLUOjuWDhkuE\""}],"cookie":[],"responseTime":null,"body":"{\n    \"loan\": {\n        \"_id\": \"65c5d9e646eac4f838561e8a\",\n        \"invoice_data\": [\n            {\n                \"name\": \"Invoice_Doc_1.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/0-9f9b1cf8-45f2-45f5-bc2f-5d60b8d9dd3e.png\"\n            },\n            {\n                \"name\": \"Invoice_Doc_2.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/1-d32e60cf-3705-4fe8-9a7d-a0853a9d4dbd.png\"\n            },\n            {\n                \"name\": \"Invoice_Doc_3.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/2-270d8178-8210-46a9-9825-dfe1063f6131.png\"\n            },\n            {\n                \"name\": \"invoice_doc_new.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/3-bbbe4285-70e9-48da-89fa-1cd5ac8bd3ae.png\"\n            },\n            {\n                \"name\": \"invoice_doc_new\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n            }\n        ],\n        \"required_financing\": 20000,\n        \"user_id\": \"65c5d21e055f2cea81524164\",\n        \"customer_name\": \"Riot Games New\",\n        \"principal_amount\": 20000,\n        \"statuses\": [\n            {\n                \"status\": \"under_review\",\n                \"timestamp\": \"2024-02-09T07:53:10.462Z\",\n                \"updated_by\": \"system\"\n            },\n            {\n                \"status\": \"under_review\",\n                \"timestamp\": \"2024-02-09T07:55:55.810Z\",\n                \"updated_by\": \"system\"\n            },\n            {\n                \"status\": \"under_review\",\n                \"timestamp\": \"2024-02-09T07:57:30.357Z\",\n                \"updated_by\": \"system\"\n            }\n        ],\n        \"status\": \"under_review\",\n        \"type\": \"daily\",\n        \"created_at\": \"2024-02-09T07:53:10.502Z\",\n        \"updated_at\": \"2024-02-09T07:57:30.357Z\",\n        \"id\": \"65c5d9e646eac4f838561e8a\"\n    }\n}"}],"_postman_id":"fbb60a04-ec5b-4401-a305-178568a81d74"},{"name":"get-repayment-details","id":"645224c1-032e-4311-87d0-3ccfd5d6fddf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/loans/repayment-details?email=DanteSparta18@gmail.com","description":"<p>This API is to be used at user side for them to get their repayment details and instructions for repaying. If the virtual account isn't created yet, this would return an appropriate message with repayment details as <code>null</code>.</p>\n<h2 id=\"request-query-parameters\">Request Query Parameters</h2>\n<ul>\n<li><strong>email/ntn/external_user_id/contactNumber</strong> (string, required): any of the customer's unique identifier for which the repayment-details are to be fetched</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>See sample response.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","loans","repayment-details"],"host":["{{base_url_lms}}"],"query":[{"key":"email","value":"DanteSparta18@gmail.com"}],"variable":[]}},"response":[{"id":"99f9475e-44fc-4815-b7f0-74c469406ed5","name":"response","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{base_url_lms}}/v1/external-lending/sme/loans/repayment-details?email=DanteSparta14@gmail.com","host":["{{base_url_lms}}"],"path":["v1","external-lending","sme","loans","repayment-details"],"query":[{"key":"email","value":"DanteSparta14@gmail.com"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 07:58:44 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"501"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"298"},{"key":"RateLimit-Reset","value":"49"},{"key":"ETag","value":"W/\"1f5-ZWCXGUq+jF3AON5AptnSxaH15eA\""}],"cookie":[],"responseTime":null,"body":"{\n    \"repayment_address\": {\n        \"account_title\": \"MadDanteNew\",\n        \"account_number\": \"2761214856546174\",\n        \"bank_name\": \"Faysal Bank Limited\",\n        \"iban\": \"PK31FAYS2761214856546174\"\n    },\n    \"instructions\": \"How to Repay?\\n\\nLog in to your banking app.\\n\\nUse the CB account number given above to transfer the amount payable today.\\nRemember:\\nRepayment starts from a minimum of PKR 1000.\\nDo not pay more than the amount payable today.\\n\\nCreditBook will send you a confirmation message once the repayment has successfully been made.\"\n}"}],"_postman_id":"645224c1-032e-4311-87d0-3ccfd5d6fddf"},{"name":"predict-balances","id":"d36a8b62-a869-40a7-ad30-aa08b4d4bc51","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"{\n    \"user_id\": \"65c622dc055f2cea81524265\",\n    \"tenure\": 30,\n    \"principal_amount\": 10000\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/loans/predict","description":"<p>This API helps in predicting the balances of the loan at the end of it's tenure given that the full repayment took all of the loan's tenure. This API can be used to gain insights while creating or approving a finance application.</p>\n<h2 id=\"request-parameters\">Request Parameters</h2>\n<ul>\n<li><p><strong>user_id</strong> (string, required): <code>id</code> of the <code>kyb</code> object of the user</p>\n</li>\n<li><p><strong>disbursement_date</strong> (DateString, optional): default to today's date minus the tenure but can be set by sending as well</p>\n</li>\n<li><p><strong>today_date</strong> (DateString, optional): default on today's date. Used to choose which day to simulate balances for.</p>\n</li>\n<li><p><strong>tenure</strong> (number, required): tenure of the loan whose balances are to be predicted</p>\n</li>\n<li><p><strong>principal_amount</strong> (number, required): financing amount of the loan that will be disbursed to the user.</p>\n</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>See sample response.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","loans","predict"],"host":["{{base_url_lms}}"],"query":[],"variable":[]}},"response":[{"id":"68446226-0341-4576-8b07-f276728ed420","name":"response","originalRequest":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/loans/predict"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 07:59:20 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"134"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"297"},{"key":"RateLimit-Reset","value":"14"},{"key":"ETag","value":"W/\"86-JJ7TKdsFmn8Ynl9zIN4jCpUBISQ\""}],"cookie":[],"responseTime":null,"body":"{\n    \"balances\": {\n        \"lateFeesPending\": 2877,\n        \"lateFeesRepaid\": 0,\n        \"markupRepaid\": 0,\n        \"markupPending\": 2466,\n        \"amountPending\": 100000,\n        \"amountRepaid\": 0\n    }\n}"}],"_postman_id":"d36a8b62-a869-40a7-ad30-aa08b4d4bc51"},{"name":"refund-loan","id":"725f0e5b-429c-40c7-b4dd-272bd09b9b6d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"principal_amount\": 1000,\n    \"reason\": \"reason for refund\",\n    \"type\": \"refund\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/loans/:id/refund","description":"<p><strong>Purpose:</strong>  </p>\n<p>API is used to mark refund in the system.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"principal_amount\": 1000, // mandatory\n    \"reason\": \"reason for refund\", // non mandatory \n    \"type\": \"refund\" // type can be refund or dispute\n}\n\n</code></pre>\n<p><strong>Note</strong>: This endpoint can only be configuratively enabled and wouldn't be available for all partner by default.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","loans",":id","refund"],"host":["{{base_url_lms}}"],"query":[],"variable":[{"description":{"content":"<p>loan id to refund for</p>\n","type":"text/plain"},"type":"any","value":"","key":"id"}]}},"response":[{"id":"6e4d86db-0968-47df-ab49-88bd40affa20","name":"response","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"invoice_data\": [\n        {\n            \"name\": \"invoice_doc_new\",\n            \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/loans/65c5d9e646eac4f838561e8a"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Fri, 09 Feb 2024 07:57:30 GMT","uuid":"d1dec587-293f-4de9-8a17-24ed99a39d73"},{"key":"Content-Type","value":"application/json; charset=utf-8","uuid":"1d40d41c-50ad-4c79-b6c4-c5a7a2b19bef"},{"key":"Content-Length","value":"1533","uuid":"20fc2a81-59b7-4a62-af00-383265c790ed"},{"key":"Connection","value":"keep-alive","uuid":"b487692e-20d2-423f-a208-99b5e4895b4d"},{"key":"Access-Control-Allow-Origin","value":"*","uuid":"28e85eb9-98dd-4390-a369-175cb9136d26"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests","uuid":"2e0295a9-a211-4c0c-81bd-fdf52d2bd765"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp","uuid":"e2c34d62-f262-4af8-bbc5-6854208283f1"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin","uuid":"8186a15a-3512-4b3b-a094-44da1a646832"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin","uuid":"1a24c999-5d27-44ba-b502-0a0faf5b6c9d"},{"key":"Origin-Agent-Cluster","value":"?1","uuid":"e4d2e51e-9349-49b3-ac94-af7fa689dfd7"},{"key":"Referrer-Policy","value":"no-referrer","uuid":"2f1e874f-d330-4533-a92f-472d0af9d78b"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains","uuid":"aed2aa42-5eb2-4b4e-a9c2-9c5afebcd80b"},{"key":"X-Content-Type-Options","value":"nosniff","uuid":"9afac39d-139a-4228-ad27-bddb5ea7f14e"},{"key":"X-DNS-Prefetch-Control","value":"off","uuid":"77921d79-d4d1-414b-a182-3df5c991868a"},{"key":"X-Download-Options","value":"noopen","uuid":"e2dbb528-74f2-4c51-8116-fb0ca793b7f6"},{"key":"X-Frame-Options","value":"SAMEORIGIN","uuid":"58adea53-66a9-4fd6-aaf6-e2bc489208ab"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none","uuid":"74809883-ca6a-401d-879c-7f758cfb6321"},{"key":"X-XSS-Protection","value":"0","uuid":"1740a9bc-a32f-433d-a034-f2539536d5db"},{"key":"RateLimit-Policy","value":"300;w=60","uuid":"ba63dee1-8140-4a0c-b3e2-57bff79c0b6f"},{"key":"RateLimit-Limit","value":"300","uuid":"a197837c-5329-4f45-863c-c0b0830ed65e"},{"key":"RateLimit-Remaining","value":"299","uuid":"5115381a-2c73-4463-9a14-e3fccdd31766"},{"key":"RateLimit-Reset","value":"4","uuid":"365c5520-c04c-4f30-8dda-ebb54ef309bd"},{"key":"ETag","value":"W/\"5fd-8+xLtRc9bWnPj4XDLUOjuWDhkuE\"","uuid":"f76d708e-058b-4613-a491-e5b97da63f01"}],"cookie":[],"responseTime":null,"body":"{\n    \"loan\": {\n        \"_id\": \"65c5d9e646eac4f838561e8a\",\n        \"invoice_data\": [\n            {\n                \"name\": \"Invoice_Doc_1.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/0-9f9b1cf8-45f2-45f5-bc2f-5d60b8d9dd3e.png\"\n            },\n            {\n                \"name\": \"Invoice_Doc_2.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/1-d32e60cf-3705-4fe8-9a7d-a0853a9d4dbd.png\"\n            },\n            {\n                \"name\": \"Invoice_Doc_3.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/2-270d8178-8210-46a9-9825-dfe1063f6131.png\"\n            },\n            {\n                \"name\": \"invoice_doc_new.png\",\n                \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/65c5d21e055f2cea81524164/invoice_data/3-bbbe4285-70e9-48da-89fa-1cd5ac8bd3ae.png\"\n            },\n            {\n                \"name\": \"invoice_doc_new\",\n                \"resourceURL\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png\"\n            }\n        ],\n        \"required_financing\": 20000,\n        \"user_id\": \"65c5d21e055f2cea81524164\",\n        \"customer_name\": \"Riot Games New\",\n        \"principal_amount\": 20000,\n        \"statuses\": [\n            {\n                \"status\": \"under_review\",\n                \"timestamp\": \"2024-02-09T07:53:10.462Z\",\n                \"updated_by\": \"system\"\n            },\n            {\n                \"status\": \"under_review\",\n                \"timestamp\": \"2024-02-09T07:55:55.810Z\",\n                \"updated_by\": \"system\"\n            },\n            {\n                \"status\": \"under_review\",\n                \"timestamp\": \"2024-02-09T07:57:30.357Z\",\n                \"updated_by\": \"system\"\n            }\n        ],\n        \"status\": \"under_review\",\n        \"type\": \"daily\",\n        \"created_at\": \"2024-02-09T07:53:10.502Z\",\n        \"updated_at\": \"2024-02-09T07:57:30.357Z\",\n        \"id\": \"65c5d9e646eac4f838561e8a\"\n    }\n}"}],"_postman_id":"725f0e5b-429c-40c7-b4dd-272bd09b9b6d"}],"id":"5e119281-413a-4387-8afd-07a7fcdf5242","description":"<p>These APIs focus on performing CRUD operations for loans.</p>\n","_postman_id":"5e119281-413a-4387-8afd-07a7fcdf5242","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}}},{"name":"Banks","item":[{"name":"get-banks","id":"9d9d3874-05ad-4654-b348-8e412eec8d54","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/banks","description":"<p>This API can be used to get the available banks that CB support. This can help in identifying the <code>bank_code</code> when submitting bank account details of the user</p>\n<h2 id=\"response-body\">Response Body</h2>\n<p>See sample response.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","banks"],"host":["{{base_url_lms}}"],"query":[],"variable":[]}},"response":[{"id":"a34c444e-fdf7-46d9-8dcc-a15f217d12a3","name":"response","originalRequest":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/banks"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 26 Mar 2024 06:55:12 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"6266"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"3"},{"key":"ETag","value":"W/\"187a-rK0jlXe0M6JLXO0w+DijXRRCGVg\""}],"cookie":[],"responseTime":null,"body":"{\n    \"banks\": [\n        {\n            \"bank_name\": \"First Women Bank Limited\",\n            \"mnemonic\": \"FWBL\",\n            \"bank_code\": \"047\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/first-women-bank.webp\",\n            \"id\": \"6488347be63016c52e361ca3\"\n        },\n        {\n            \"bank_name\": \"Askari Bank Limited\",\n            \"mnemonic\": \"ASCM\",\n            \"bank_code\": \"017\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/askari-bank.webp\",\n            \"id\": \"6488347be63016c52e361c9b\"\n        },\n        {\n            \"bank_name\": \"Bank Al-Falah Limited\",\n            \"mnemonic\": \"BAFL\",\n            \"bank_code\": \"053\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/bank-alfalah.webp\",\n            \"id\": \"6488347be63016c52e361c9c\"\n        },\n        {\n            \"bank_name\": \"Bank Al-Habib Limited\",\n            \"mnemonic\": \"BAHL\",\n            \"bank_code\": \"023\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/bank-al-habib.webp\",\n            \"id\": \"6488347be63016c52e361c9d\"\n        },\n        {\n            \"bank_name\": \"Albarka Islamic Bank\",\n            \"mnemonic\": \"ABPL\",\n            \"bank_code\": \"016\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/al-baraka.webp\",\n            \"id\": \"6488347be63016c52e361c99\"\n        },\n        {\n            \"bank_name\": \"Bankislami Pakistan Limited\",\n            \"mnemonic\": \"BIPL\",\n            \"bank_code\": \"021\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/bank-islami.webp\",\n            \"id\": \"6488347be63016c52e361c9e\"\n        },\n        {\n            \"bank_name\": \"Allied Bank Limited\",\n            \"mnemonic\": \"ABL\",\n            \"bank_code\": \"014\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/allied-bank.webp\",\n            \"id\": \"6488347be63016c52e361c9a\"\n        },\n        {\n            \"bank_name\": \"NIB Bank Limited\",\n            \"mnemonic\": \"NIB\",\n            \"bank_code\": \"059\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/nib-bank.webp\",\n            \"id\": \"6488347be63016c52e361ca9\"\n        },\n        {\n            \"bank_name\": \"Standard Chartered Bank\",\n            \"mnemonic\": \"SCB\",\n            \"bank_code\": \"038\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/standard-chartered.webp\",\n            \"id\": \"6488347be63016c52e361cae\"\n        },\n        {\n            \"bank_name\": \"Sindh Bank Limited\",\n            \"mnemonic\": \"SND\",\n            \"bank_code\": \"043\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/sindh-bank.webp\",\n            \"id\": \"6488347be63016c52e361cac\"\n        },\n        {\n            \"bank_name\": \"Summit Bank Limited\",\n            \"mnemonic\": \"SMBL\",\n            \"bank_code\": \"081\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/summit-bank.webp\",\n            \"id\": \"6488347be63016c52e361caf\"\n        },\n        {\n            \"bank_name\": \"MCB Islamic Bank\",\n            \"mnemonic\": \"MIB\",\n            \"bank_code\": \"044\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/mcb-islamic-bank.webp\",\n            \"id\": \"6488347be63016c52e361cb1\"\n        },\n        {\n            \"bank_name\": \"Meezan Bank Limited\",\n            \"mnemonic\": \"MBL\",\n            \"bank_code\": \"\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/meezan-bank.webp\",\n            \"id\": \"6488347be63016c52e361cb7\"\n        },\n        {\n            \"bank_name\": \"Burj Bank Limited\",\n            \"mnemonic\": \"BBL\",\n            \"bank_code\": \"003\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/burj-bank.webp\",\n            \"id\": \"6488347be63016c52e361c9f\"\n        },\n        {\n            \"bank_name\": \"Habib Metropolitan Bank Limited\",\n            \"mnemonic\": \"HMBL\",\n            \"bank_code\": \"064\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/habib-metropolitan-bank.webp\",\n            \"id\": \"6488347be63016c52e361ca5\"\n        },\n        {\n            \"bank_name\": \"MCB Bank Limited\",\n            \"mnemonic\": \"MCB\",\n            \"bank_code\": \"062\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/mcb-bank.webp\",\n            \"id\": \"6488347be63016c52e361ca7\"\n        },\n        {\n            \"bank_name\": \"Soneri Bank Limited\",\n            \"mnemonic\": \"SME\",\n            \"bank_code\": \"085\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/soneri-bank.webp\",\n            \"id\": \"6488347be63016c52e361cad\"\n        },\n        {\n            \"bank_name\": \"Jazzcash\",\n            \"mnemonic\": \"JC\",\n            \"bank_code\": \"094\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/jazz-cash.webp\",\n            \"id\": \"6488347be63016c52e361cb6\"\n        },\n        {\n            \"bank_name\": \"Faysal Bank Limited\",\n            \"mnemonic\": \"FBL\",\n            \"bank_code\": \"060\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/faysal-bank.webp\",\n            \"id\": \"6488347be63016c52e361ca2\"\n        },\n        {\n            \"bank_name\": \"NayaPay\",\n            \"mnemonic\": \"NP\",\n            \"bank_code\": \"010\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/nayapay.webp\",\n            \"id\": \"6492c9bf7d1885016ee7fd00\"\n        },\n        {\n            \"bank_name\": \"SadaPay\",\n            \"mnemonic\": \"SP\",\n            \"bank_code\": \"050\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/sadapay.webp\",\n            \"id\": \"6492c9ef7d1885016ee7fd2c\"\n        },\n        {\n            \"bank_name\": \"National Bank Of Pakistan\",\n            \"mnemonic\": \"NBP\",\n            \"bank_code\": \"070\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/national-bank.webp\",\n            \"id\": \"6488347be63016c52e361ca8\"\n        },\n        {\n            \"bank_name\": \"Samba Bank Limited\",\n            \"mnemonic\": \"SBL\",\n            \"bank_code\": \"028\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/samba-bank.webp\",\n            \"id\": \"6488347be63016c52e361caa\"\n        },\n        {\n            \"bank_name\": \"JS Bank Limited\",\n            \"mnemonic\": \"JS\",\n            \"bank_code\": \"018\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/js-bank.webp\",\n            \"id\": \"6488347be63016c52e361ca6\"\n        },\n        {\n            \"bank_name\": \"Apna Microfinance Bank\",\n            \"mnemonic\": \"AMB\",\n            \"bank_code\": \"093\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/apna-microfinance-bank.webp\",\n            \"id\": \"6488347be63016c52e361cb0\"\n        },\n        {\n            \"bank_name\": \"United Bank Limited\",\n            \"mnemonic\": \"UBL\",\n            \"bank_code\": \"086\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/united-bank.webp\",\n            \"id\": \"6488347be63016c52e361cb3\"\n        },\n        {\n            \"bank_name\": \"Easypaisa\",\n            \"mnemonic\": \"EP\",\n            \"bank_code\": \"027\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/easy-paisa.webp\",\n            \"id\": \"6488347be63016c52e361cb5\"\n        },\n        {\n            \"bank_name\": \"Bank Of Khyber\",\n            \"mnemonic\": \"BOK\",\n            \"bank_code\": \"061\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/bank-of-khyber.webp\",\n            \"id\": \"6488347be63016c52e361cb4\"\n        },\n        {\n            \"bank_name\": \"Dubai Islamic Bank\",\n            \"mnemonic\": \"DIB\",\n            \"bank_code\": \"013\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/dubai-islamic.webp\",\n            \"id\": \"6488347be63016c52e361ca1\"\n        },\n        {\n            \"bank_name\": \"Habib Bank Limited\",\n            \"mnemonic\": \"HBL\",\n            \"bank_code\": \"054\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/habib-bank.webp\",\n            \"id\": \"6488347be63016c52e361ca4\"\n        },\n        {\n            \"bank_name\": \"The Bank Of Punjab\",\n            \"mnemonic\": \"BOP\",\n            \"bank_code\": \"083\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/bank-of-punjab.webp\",\n            \"id\": \"6488347be63016c52e361cb2\"\n        },\n        {\n            \"bank_name\": \"Silk Bank Limited\",\n            \"mnemonic\": \"SILK\",\n            \"bank_code\": \"066\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/silk-bank.webp\",\n            \"id\": \"6488347be63016c52e361cab\"\n        },\n        {\n            \"bank_name\": \"Mobilink Microfinance Bank\",\n            \"mnemonic\": \"MMBL\",\n            \"bank_code\": \"100\",\n            \"bank_logo_img\": \"https://banks-logo.s3.ap-southeast-1.amazonaws.com/mobilink-microfinance-bank.webp\",\n            \"id\": \"654389658b20fc432940d20a\"\n        }\n    ]\n}"}],"_postman_id":"9d9d3874-05ad-4654-b348-8e412eec8d54"}],"id":"be9e12e0-58fa-486d-a551-637db6acb0a0","_postman_id":"be9e12e0-58fa-486d-a551-637db6acb0a0","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}}},{"name":"Bank-Accounts","item":[{"name":"get-bank-accounts","id":"5be3eb67-56ad-453d-99c9-97b4ddcd1d7a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/bank-accounts?ntn=39943-29287285-0","description":"<p>Gets bank accounts of the user whose <code>email</code> , <code>contactNumber</code>, <code>ntn</code>, and/or <code>external_user_id</code> is passed in the query parameters. If no bank-account exists for the user then it returns empty array.</p>\n<h2 id=\"query-parameters\">Query Parameters</h2>\n<p>Either one or any combination of these query params can be used to fetch the user. Alteast one query param needs to exist in the request.</p>\n<ul>\n<li><p>email: <code>string</code></p>\n</li>\n<li><p>contactNumber: <code>string</code> - must be in format <code>+92XXXXXXXXXX</code></p>\n</li>\n<li><p>ntn: <code>string</code></p>\n</li>\n<li><p>external_user_id: <code>string</code></p>\n</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>Following is the response type and also see sample response</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">interface response {\n  bankAccounts: Array&lt;IBankAccount&gt;,\n}\ninterface IBankAccount {\n  _id: ObjectId;\n  account_number: string;\n  account_title: string;\n  bank_code: string;\n  iban?: string;\n  mnemonic: BankMnemonic;\n  owner: Owner;\n  created_at: Date;\n  updated_at: Date;\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","bank-accounts"],"host":["{{base_url_lms}}"],"query":[{"key":"ntn","value":"39943-29287285-0"}],"variable":[]}},"response":[{"id":"6a949428-c50e-4dd0-bd54-ddebb16cb15d","name":"response","originalRequest":{"method":"GET","header":[],"url":{"raw":"localhost:3005/v1/external-lending/sme/bank-accounts?ntn=39943-29287285-0","host":["localhost"],"port":"3005","path":["v1","external-lending","sme","bank-accounts"],"query":[{"key":"ntn","value":"39943-29287285-0"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"25"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"910"},{"key":"ETag","value":"W/\"38e-KhEgd4jRDx1lqxGI7eYlqPDZVBw\""},{"key":"Date","value":"Fri, 24 May 2024 10:13:17 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"bankAccounts\": [\n        {\n            \"account_title\": \"SMARTLANE IT SOLUTION (PVT) LIMITED\",\n            \"account_number\": \"UPDATED\",\n            \"bank_code\": \"053\",\n            \"iban\": \"312321321UPDATERR\",\n            \"mnemonic\": \"BAFL\",\n            \"owner\": {\n                \"id\": \"664dba1d88ae36d6ce08fa7a\",\n                \"type\": \"user\"\n            },\n            \"created_at\": \"2024-05-22T09:25:49.994Z\",\n            \"updated_at\": \"2024-05-24T10:05:45.616Z\",\n            \"id\": \"664dba1d88ae36d6ce08fa80\"\n        },\n        {\n            \"account_title\": \"NEW ACCOUNT\",\n            \"account_number\": \"04771007648259\",\n            \"bank_code\": \"053\",\n            \"iban\": \"312321321\",\n            \"mnemonic\": \"BAFL\",\n            \"owner\": {\n                \"id\": \"664dba1d88ae36d6ce08fa7a\",\n                \"type\": \"user\"\n            },\n            \"created_at\": \"2024-05-22T09:26:42.390Z\",\n            \"updated_at\": \"2024-05-22T09:26:42.390Z\",\n            \"id\": \"664dba5288ae36d6ce08fa8b\"\n        },\n        {\n            \"account_title\": \"NEW ACCOUNT\",\n            \"account_number\": \"04771007648259\",\n            \"bank_code\": \"053\",\n            \"iban\": \"312321321\",\n            \"mnemonic\": \"BAFL\",\n            \"owner\": {\n                \"id\": \"664dba1d88ae36d6ce08fa7a\",\n                \"type\": \"user\"\n            },\n            \"created_at\": \"2024-05-24T10:05:29.216Z\",\n            \"updated_at\": \"2024-05-24T10:05:29.216Z\",\n            \"id\": \"665066699d510088fe7a7e73\"\n        }\n    ]\n}"}],"_postman_id":"5be3eb67-56ad-453d-99c9-97b4ddcd1d7a"},{"name":"create-bank-account","id":"47b9516c-b8b8-477c-895c-c4f9d97e9547","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"iban\": \"312321321\",\n    \"bankCode\": \"053\",\n    \"accountTitle\": \"NEW ACCOUNT\",\n    \"accountNumber\": \"04771007648259\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/bank-accounts?ntn=39943-29287285-0","description":"<p>Creates a bank account detail document of the user whose <code>email</code> , <code>contactNumber</code>, <code>ntn</code>, and/or <code>external_user_id</code> is passed in the query parameters.</p>\n<h2 id=\"query-parameters\">Query Parameters</h2>\n<p>Either one or any combination of these query params can be used to fetch the user. Alteast one query param needs to exist in the request.</p>\n<ul>\n<li><p>email: <code>string</code></p>\n</li>\n<li><p>contactNumber: <code>string</code> - must be in format <code>+92XXXXXXXXXX</code></p>\n</li>\n<li><p>ntn: <code>string</code></p>\n</li>\n<li><p>external_user_id: <code>string</code></p>\n</li>\n</ul>\n<h2 id=\"body-parameters\">Body Parameters</h2>\n<ul>\n<li><p>iban: &lt;<code>string</code>, <code>optional</code>&gt;</p>\n</li>\n<li><p>bankCode: &lt;<code>string</code>, <code>required</code>&gt; - must be in format retrieved from <a href=\"https://docs.creditbook.pk/#b639d910-f86e-4bf2-ba38-a6deb763add0\">get-banks</a> API for the selected bank</p>\n</li>\n<li><p>accountTitle: &lt;<code>string</code>, <code>required</code>&gt;</p>\n</li>\n<li><p>accountNumber: &lt;<code>string</code>, <code>required</code>&gt;</p>\n</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>Following is the response type and also see sample response</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">interface response {\n  createdBankAccount: IBankAccount,\n}\ninterface IBankAccount {\n  _id: ObjectId;\n  account_number: string;\n  account_title: string;\n  bank_code: string;\n  iban?: string;\n  mnemonic: BankMnemonic;\n  owner: Owner;\n  created_at: Date;\n  updated_at: Date;\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","bank-accounts"],"host":["{{base_url_lms}}"],"query":[{"key":"ntn","value":"39943-29287285-0"}],"variable":[]}},"response":[{"id":"9f6d17ff-357b-490b-a357-7eb58b7a3d6c","name":"response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"iban\": \"312321321\",\n    \"bankCode\": \"053\",\n    \"accountTitle\": \"NEW ACCOUNT\",\n    \"accountNumber\": \"04771007648259\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{base_url}}/v1/external-lending/sme/bank-accounts?ntn=39943-29287285-0","host":["{{base_url}}"],"path":["v1","external-lending","sme","bank-accounts"],"query":[{"key":"ntn","value":"39943-29287285-0"}]}},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"299"},{"key":"RateLimit-Reset","value":"58"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"311"},{"key":"ETag","value":"W/\"137-M9i2mg5SSAbNUCs/OQaE0S66D5s\""},{"key":"Date","value":"Fri, 24 May 2024 10:13:43 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"createdBankAccount\": {\n        \"account_title\": \"NEW ACCOUNT\",\n        \"account_number\": \"04771007648259\",\n        \"bank_code\": \"053\",\n        \"iban\": \"312321321\",\n        \"mnemonic\": \"BAFL\",\n        \"owner\": {\n            \"id\": \"664dba1d88ae36d6ce08fa7a\",\n            \"type\": \"user\"\n        },\n        \"created_at\": \"2024-05-24T10:13:43.596Z\",\n        \"updated_at\": \"2024-05-24T10:13:43.596Z\",\n        \"id\": \"665068579d510088fe7a7e7d\"\n    }\n}"}],"_postman_id":"47b9516c-b8b8-477c-895c-c4f9d97e9547"},{"name":"update-bank-account","id":"b967d66a-5b16-44d1-bb98-632cebd44d25","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"iban\": \"312321321UPDATERR\",\n    \"accountNumber\": \"UPDATED\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/bank-accounts/664dba1d88ae36d6ce08fa80?ntn=39943-29287285-0","description":"<p>Updates an already existing bank account detail document whose <code>id</code> is sent in the API params, for the user whose <code>email</code> , <code>contactNumber</code>, <code>ntn</code>, and/or <code>external_user_id</code> is passed in the query parameters.</p>\n<h2 id=\"api-param\">API Param</h2>\n<ul>\n<li>id: <code>string</code>- <code>_id</code> of the bank-account which needs to be updated</li>\n</ul>\n<h2 id=\"query-parameters\">Query Parameters</h2>\n<p>Either one or any combination of these query params can be used to fetch the user. Alteast one query param needs to exist in the request.</p>\n<ul>\n<li><p>email: <code>string</code></p>\n</li>\n<li><p>contactNumber: <code>string</code> - must be in format <code>+92XXXXXXXXXX</code></p>\n</li>\n<li><p>ntn: <code>string</code></p>\n</li>\n<li><p>external_user_id: <code>string</code></p>\n</li>\n</ul>\n<h2 id=\"body-parameters\">Body Parameters</h2>\n<ul>\n<li><p>iban: &lt;<code>string</code>, <code>optional</code>&gt;</p>\n</li>\n<li><p>bankCode: &lt;<code>string</code>, <code>required</code>&gt; - must be in format retrieved from <a href=\"https://docs.creditbook.pk/#b639d910-f86e-4bf2-ba38-a6deb763add0\">get-banks</a> API for the selected bank</p>\n</li>\n<li><p>accountTitle: &lt;<code>string</code>, <code>required</code>&gt;</p>\n</li>\n<li><p>accountNumber: &lt;<code>string</code>, <code>required</code>&gt;</p>\n</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>Following is the response type and also see sample response</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">interface response {\n  updatedBankAccount: IBankAccount,\n}\ninterface IBankAccount {\n  _id: ObjectId;\n  account_number: string;\n  account_title: string;\n  bank_code: string;\n  iban?: string;\n  mnemonic: BankMnemonic;\n  owner: Owner;\n  created_at: Date;\n  updated_at: Date;\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","bank-accounts","664dba1d88ae36d6ce08fa80"],"host":["{{base_url_lms}}"],"query":[{"key":"ntn","value":"39943-29287285-0"}],"variable":[]}},"response":[{"id":"65f3bd81-54d3-40c7-a906-8ce64090b542","name":"response","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"iban\": \"312321321UPDATERR\",\n    \"accountNumber\": \"UPDATED\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"localhost:3005/v1/external-lending/sme/bank-accounts/664dba1d88ae36d6ce08fa80?ntn=39943-29287285-0","host":["localhost"],"port":"3005","path":["v1","external-lending","sme","bank-accounts","664dba1d88ae36d6ce08fa80"],"query":[{"key":"ntn","value":"39943-29287285-0"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"298"},{"key":"RateLimit-Reset","value":"32"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"336"},{"key":"ETag","value":"W/\"150-Z5jlbFZ6ycWMzYOKwqxOruE/9ew\""},{"key":"Date","value":"Fri, 24 May 2024 10:14:09 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"updatedBankAccount\": {\n        \"account_title\": \"SMARTLANE IT SOLUTION (PVT) LIMITED\",\n        \"account_number\": \"UPDATED\",\n        \"bank_code\": \"053\",\n        \"iban\": \"312321321UPDATERR\",\n        \"mnemonic\": \"BAFL\",\n        \"owner\": {\n            \"id\": \"664dba1d88ae36d6ce08fa7a\",\n            \"type\": \"user\"\n        },\n        \"created_at\": \"2024-05-22T09:25:49.994Z\",\n        \"updated_at\": \"2024-05-24T10:14:09.310Z\",\n        \"id\": \"664dba1d88ae36d6ce08fa80\"\n    }\n}"}],"_postman_id":"b967d66a-5b16-44d1-bb98-632cebd44d25"}],"id":"bc116974-c7eb-401d-adb5-1e26589f9009","description":"<h4 id=\"upcoming-features\"><strong>Upcoming Features</strong></h4>\n<p>This collection is upcoming. Currently they are not live.</p>\n<p>These APIs focus on performing CRUD operations for bank-account details of user</p>\n","event":[{"listen":"prerequest","script":{"id":"a6f6c876-8c4e-4891-9136-c4b57afdace2","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"25abdf0b-4e69-40dd-b1a4-4fafca158bcc","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"bc116974-c7eb-401d-adb5-1e26589f9009","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}}},{"name":"S3","item":[{"name":"get-presigned-url","id":"fa5047c1-d6ef-4bae-b6ed-cc28ea875995","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url_lms}}/v1/external-lending/sme/s3/presigned-url?file_name=filename.png","description":"<p>This API helps in generating a presigned url to upload a document.</p>\n<h2 id=\"request-query-parameters\">Request Query Parameters</h2>\n<ul>\n<li>file_name (string, required): name of the file, it is essential that the file name is appended with a valid extension to ensure the correct configuration of the MIME type.</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<ul>\n<li><p><code>putPresignedURL</code> : URL on which the document needs to be uploaded</p>\n</li>\n<li><p><code>resourceURL</code> : URL on which the uploaded document will exist</p>\n</li>\n<li><p><code>getPreSignedURL</code>: View-only URL for the document (resourceURL will be private by default)</p>\n</li>\n<li><p><code>contentType</code>: Mime Type for the document according to the extension of the file_name query parameter.</p>\n</li>\n</ul>\n<p>The next step after generating the presigned url is to upload a document to this presigned url. Below is sample code for this next step in javascript:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">const filePath = 'path/to/file'\nconst { contentType, putPresignedURL } = response; // response of the get-presigned-url API\naxios.put(putPresignedURL, filePath, {\n    headers: {\n        'Content-Type': contentType,\n    },\n});\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}},"urlObject":{"path":["v1","external-lending","sme","s3","presigned-url"],"host":["{{base_url_lms}}"],"query":[{"key":"file_name","value":"filename.png"}],"variable":[]}},"response":[{"id":"02a3a4a5-a76f-4572-83f0-49c3bd7e6a16","name":"response","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{base_url_lms}}/v1/external-lending/sme/s3/presigned-url?file_name=filename.png","host":["{{base_url_lms}}"],"path":["v1","external-lending","sme","s3","presigned-url"],"query":[{"key":"file_name","value":"filename.png"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 19 Feb 2024 10:21:18 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"999"},{"key":"Connection","value":"keep-alive"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Embedder-Policy","value":"require-corp"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"RateLimit-Policy","value":"300;w=60"},{"key":"RateLimit-Limit","value":"300"},{"key":"RateLimit-Remaining","value":"296"},{"key":"RateLimit-Reset","value":"16"},{"key":"ETag","value":"W/\"3e7-8ACTcSfowanfRzHNFvnNA6PCps4\""}],"cookie":[],"responseTime":null,"body":"{\n    \"putPresignedURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/filename-1708338078928-69.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GXKNUIQNK%2F20240219%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240219T102118Z&X-Amz-Expires=900&X-Amz-Signature=88735af43c77d41801d19fda1ba919afb8bc3427e725cec589140f135e75f1da&X-Amz-SignedHeaders=host&x-id=PutObject\",\n    \"resourceURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/filename-1708338078928-69.png\",\n    \"getPreSignedURL\": \"https://cb-lending-staging.s3.ap-southeast-1.amazonaws.com/filename-1708338078928-69.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GXKNUIQNK%2F20240219%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240219T102118Z&X-Amz-Expires=3600&X-Amz-Signature=bfd73183b975f39acd16087eddf9a72863ea248ba4940dd24842f8fae0c4a217&X-Amz-SignedHeaders=host&x-id=GetObject\",\n    \"contentType\": \"image/png\"\n}"}],"_postman_id":"fa5047c1-d6ef-4bae-b6ed-cc28ea875995"}],"id":"ad1d4edf-bb9f-42eb-b741-9da0893add02","description":"<p>This collection is related to file storage and retrieval</p>\n","_postman_id":"ad1d4edf-bb9f-42eb-b741-9da0893add02","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}}},{"name":"Transactional Data Sharing","item":[{"name":"Transactional Data Sharing","id":"39f1f9cb-5d7a-472f-8492-9b7f63a1071b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"{{base_url_lms}}/v1/external-lending/sme/partner/data-sharing?noOfFiles=2","description":"<p>This API allows partners to generate signed URLs, facilitating the seamless uploading of files. In instances where partners need to upload multiple files, the API offers the capability to obtain multiple signed URLs for each file through a single API call. Additionally, the API supports the zip format when dealing with multiple files.</p>\n<h2 id=\"note\">Note</h2>\n<ul>\n<li><p>Partners can upload individual files or ZIP files using the provided signed URLs</p>\n</li>\n<li><p>Signed URLs expire after 30 minutes</p>\n</li>\n<li><p>The maximum number of signed URLs that can be generated in a single API call is limited to 10</p>\n</li>\n</ul>\n<h2 id=\"type-of-errors\">Type of Errors</h2>\n<ul>\n<li><p><strong>401 Unauthorized</strong>: Invalid/Missing API key or partner ID</p>\n</li>\n<li><p><strong>403 Forbidden</strong>: Partner not authorized to generate signed URLs</p>\n</li>\n<li><p><strong>500 Internal Server Error</strong>: An error occurred on the server</p>\n</li>\n</ul>\n<h2 id=\"request-parameters\">Request Parameters</h2>\n<ul>\n<li><strong>noOfFiles</strong> (optional, integer): The number of signed URLs to generate (default: 1, maximum: 10).</li>\n</ul>\n<h2 id=\"response-body\">Response Body</h2>\n<p>See sample response.</p>\n<h2 id=\"post-processing---uploading-file-using-signed-url\">Post-Processing - Uploading File Using Signed URL</h2>\n<h3 id=\"steps\">Steps</h3>\n<ul>\n<li><p><strong>Obtain a Signed URL:</strong></p>\n<ul>\n<li>Use the above API to generate a signed URL for file upload</li>\n</ul>\n</li>\n<li><p><strong>Prepare the File:</strong></p>\n<ul>\n<li><p>Ensure the file you intend to upload is ready and accessible</p>\n</li>\n<li><p>Verify the file type</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Construct the Request:</strong></p>\n<ul>\n<li>Choose either a command-line tool (like curl) or any programming language (like Python) to make the request.</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"using-curl-command-line\">Using curl (command-line)</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl -X PUT \\\n  -H \"Content-Type: &lt;file_type&gt;\" \\\n  --upload-file &lt;file_path&gt; \\\n  &lt;signed_url_link&gt;\n\n</code></pre>\n<p>Replace placeholders with actual values:</p>\n<ul>\n<li><p>: The MIME type of the file (e.g., <code>application/csv</code>, <code>application/zip</code>)</p>\n</li>\n<li><p>: The full path to the file on your system</p>\n</li>\n<li><p>: The obtained signed URL</p>\n</li>\n</ul>\n<h3 id=\"using-python\">Using Python</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">import requests\nurl = &lt;signed_url_link&gt;\nfile_path = &lt;file_path&gt;\nheaders = {\"Content-Type\": &lt;file_type&gt;}\nwith open(file_path, \"rb\") as file:\n    response = requests.put(url, data=file, headers=headers)\nif response.status_code == 200:\n    print(\"File uploaded successfully!\")\nelse:\n    print(f\"Error uploading file: {response.text}\")\n\n</code></pre>\n<p>Replace placeholders with actual values as in the curl example</p>\n<h2 id=\"key-points\">Key Points</h2>\n<ul>\n<li><p>Signed URLs are time-sensitive and expire after a set duration.</p>\n</li>\n<li><p>Ensure you use the correct HTTP method (PUT in this case) and headers.</p>\n</li>\n<li><p>Specify the accurate file path and type.</p>\n</li>\n<li><p>Handle potential errors by checking the response status code.</p>\n</li>\n</ul>\n","urlObject":{"path":["v1","external-lending","sme","partner","data-sharing"],"host":["{{base_url_lms}}"],"query":[{"key":"noOfFiles","value":"2"}],"variable":[]}},"response":[{"id":"36bfafdb-9adb-47a0-8eaa-618e8808f26d","name":"response","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmdfaWQiOiI2NmM1YjIwZmI1NGZjZDc2YThhZTVlNDUiLCJ1c2VyX2lkIjoiNjZkMWI4YmFkOTgyNzZlNDgyOTJlZDc4Iiwicm9sZSI6InBhcnRuZXIiLCJuYW1lIjoiQ2F0dmlzaW9uIiwiaXNzIjoiY2ItbWFpbi1iYWNrZW5kLmNiZnMtYXV0aCIsInBheWxvYWRfdmVyc2lvbiI6MywicGxhdGZvcm0iOiJwYXJ0bmVyIiwic3ViIjoiNjZkMWI4YmFkOTgyNzZlNDgyOTJlZDc4IiwibWV0YSI6eyJzZWxmaWVfcmVxdWlyZWQiOmZhbHNlLCJtYXR1cml0eSI6eyJ0eXBlIjoiYmFuZHMiLCJtYXgiOjMwLCJtaW4iOjF9fSwiaWF0IjoxNzM2NDA0NzE3LCJleHAiOjE3MzY0MDgzMTd9.qc3P7cQchNTuTSsXwRlobUytqqG5ZzoqcE-er3EnTkk","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":{"raw":"{{base_url_lms}}/v1/external-lending/sme/partner/data-sharing?noOfFiles=2","host":["{{base_url_lms}}"],"path":["v1","external-lending","sme","partner","data-sharing"],"query":[{"key":"noOfFiles","value":"2"}]}},"status":"OK","code":200,"_postman_previewlanguage":"html","header":[{"key":"content-type","value":"text/html; charset=utf-8"},{"key":"X-Cloud-Trace-Context","value":"4d4d5ae2cbcc2c1c1f94ef29586fc409;o=1"},{"key":"Date","value":"Fri, 16 Feb 2024 07:56:51 GMT"},{"key":"Server","value":"Google Frontend"},{"key":"Content-Length","value":"918"},{"key":"Alt-Svc","value":"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"data\": {\n        \"signedURL\": [\n            \"https://s3.ap-southeast-1.amazonaws.com/S3_TRANSACTIONAL_DATA_BUCKET/66d1b8bad98276e48292ed78/1736404903989-0?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GYZCBJV45%2F20250109%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20250109T064143Z&X-Amz-Expires=3600&X-Amz-Signature=368243fd9d67bfddc53080e279030b4ad62bb31ca3a6fe5749f3e58fd11a4b7c&X-Amz-SignedHeaders=host&x-id=PutObject\",\n            \"https://s3.ap-southeast-1.amazonaws.com/S3_TRANSACTIONAL_DATA_BUCKET/66d1b8bad98276e48292ed78/1736404903992-1?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2HE4366GYZCBJV45%2F20250109%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20250109T064143Z&X-Amz-Expires=3600&X-Amz-Signature=aebe5013e823ce9b8f83cfbff1d0b1ae3e9a8f88c052927776a440c5ef3048b7&X-Amz-SignedHeaders=host&x-id=PutObject\"\n        ]\n    },\n    \"message\": \"success\"\n}"}],"_postman_id":"39f1f9cb-5d7a-472f-8492-9b7f63a1071b"}],"id":"3f740325-bd4c-4e0d-a434-a15f938499f2","description":"<h3 id=\"summary\">Summary</h3>\n<ul>\n<li><p>Must share at least 6 months of transaction history</p>\n</li>\n<li><p>Data must not be older than 30 days from application date</p>\n</li>\n<li><p>Share new data every 3 lending cycles for active borrowers</p>\n</li>\n<li><p>Each transaction must include: unique identifier (matching KYC), business name, date, and amount</p>\n</li>\n<li><p>Raw data only - no formatting, merged cells, or aggregated data</p>\n</li>\n<li><p>Maintain consistent format and fields across all data submissions</p>\n</li>\n<li><p>For API users: use platform's user_id; For Partner Book: use mobile number</p>\n</li>\n</ul>\n<h3 id=\"introduction\">Introduction</h3>\n<p>This guide outlines the requirements and best practices for sharing transactional data effectively and efficiently. At CreditBook We process this data to maintain robust risk assessment standards. By following these guidelines, you'll ensure smooth processing of applications and continued access to financing for your customers.</p>\n<h4 id=\"why-we-need-transactional-data\">Why We Need Transactional Data</h4>\n<p>Our platform leverages advanced analytics to perform swift and accurate risk assessments without requiring lengthy traditional review processes. Transactional data provides vital insights into business performance and creditworthiness, allowing us to:</p>\n<ol>\n<li><p>Make faster lending decisions</p>\n</li>\n<li><p>Offer more accurate and personalized financing terms</p>\n</li>\n<li><p>Reduce the documentation burden on your customers</p>\n</li>\n<li><p>Maintain ongoing monitoring of portfolio health</p>\n</li>\n</ol>\n<h4 id=\"data-freshness-requirements\">Data Freshness Requirements</h4>\n<p>Keeping data current is crucial for accurate risk assessment. We require regular updates based on the following schedule:</p>\n<ul>\n<li><p>For new applications: <strong>Data must not be older than 30 days</strong> from the application date</p>\n</li>\n<li><p>For existing borrowers: <strong>Updated data must be shared at least every three lending cycles</strong> for review purposes</p>\n</li>\n<li><p>Failure to provide timely updates may result in rejected applications or reviews</p>\n</li>\n</ul>\n<h3 id=\"minimum-data-requirements\">Minimum Data Requirements</h3>\n<h4 id=\"historical-depth\">Historical Depth</h4>\n<p>All profiles must include a <strong>minimum of 6 months of transactional history</strong>. Applications with insufficient history will be automatically rejected.</p>\n<h4 id=\"required-fields\">Required Fields</h4>\n<p>Every transaction record must include:</p>\n<ul>\n<li><p>Unique identifier (matching KYC application)</p>\n</li>\n<li><p>Business name</p>\n</li>\n<li><p>Transaction/order date</p>\n</li>\n<li><p>Transaction amount</p>\n</li>\n</ul>\n<h4 id=\"identifier-requirements\">Identifier Requirements</h4>\n<ul>\n<li><p>API Integration Partners: Use your platform's <code>user_id</code> which can then be shared as <code>external_user_id</code> when creating lending users (<code>{{base_url_lms}}/v1/external-lending/sme/users</code> )</p>\n</li>\n<li><p>Partner Book Users: Use customer mobile number</p>\n</li>\n<li><p>The chosen identifier must match exactly with the KYC application information</p>\n</li>\n</ul>\n<h3 id=\"data-format-best-practices\">Data Format Best Practices</h3>\n<h4 id=\"file-structure\">File Structure</h4>\n<ul>\n<li><p>Provide raw data without formatting or merged cells</p>\n</li>\n<li><p>Each row must be self-contained with all required information</p>\n</li>\n<li><p>Avoid aggregated data - provide individual transaction records</p>\n</li>\n<li><p>Include all identifying information in every row</p>\n</li>\n</ul>\n<h4 id=\"date-formatting\">Date Formatting</h4>\n<ul>\n<li><p>Use consistent date format including day, month, and year</p>\n</li>\n<li><p>Example: \"2024-02-18\" or \"18/02/2024\"</p>\n</li>\n<li><p>Dates should be in proper date format, not text</p>\n</li>\n</ul>\n<h4 id=\"transaction-level-detail\">Transaction Level Detail</h4>\n<p>We strongly recommend providing order-level transaction data rather than aggregated summaries because it:</p>\n<ul>\n<li><p>Enables more accurate risk assessment</p>\n</li>\n<li><p>Provides deeper insights into business patterns</p>\n</li>\n<li><p>May result in more favorable financing terms</p>\n</li>\n<li><p>Allows for better monitoring of business health</p>\n</li>\n</ul>\n<h4 id=\"consistent-format\">Consistent Format</h4>\n<p>Another critical aspect is to maintain a standard data format in each upload, to make sure our data pipelines are able to process the information as fast as possible. Data shared should follow the same fields and naming conventions, <strong>change in fields or schema must be avoided.</strong></p>\n<h3 id=\"common-issues-to-avoid\">Common Issues to Avoid</h3>\n<ul>\n<li><p>Sending aggregated monthly or weekly data instead of individual transactions</p>\n</li>\n<li><p>Inconsistent identifier usage across records</p>\n</li>\n<li><p>Missing transaction dates or using incorrect date formats</p>\n</li>\n<li><p>Incomplete historical data</p>\n</li>\n<li><p>Formatted spreadsheets with merged cells or complex formatting</p>\n</li>\n<li><p>Mismatched identifiers between KYC and transaction data</p>\n</li>\n</ul>\n<h3 id=\"data-submission-process\">Data Submission Process</h3>\n<ol>\n<li><p>Ensure all data meets the minimum requirements outlined above</p>\n</li>\n<li><p>Verify that identifiers match KYC application information</p>\n</li>\n<li><p>Check that the most recent transaction is within the 30-day threshold</p>\n</li>\n<li><p>Submit data in raw format without any special formatting</p>\n</li>\n</ol>\n<h3 id=\"recommended-api-implementation\">Recommended API Implementation</h3>\n<h4 id=\"for-new-usersapplicants\">For New Users/Applicants</h4>\n<p>When implementing programmatic data sharing for new users, timing and completeness are crucial for efficient processing:</p>\n<p>The initial data upload should occur immediately after the user completes their KYC application. This ensures seamless processing and prevents delays in application review. Your implementation should:</p>\n<ol>\n<li><p>Trigger the data upload automatically upon KYC completion</p>\n</li>\n<li><p>Include a minimum of 6 months of historical transaction data</p>\n</li>\n<li><p>Follow the transaction data format specifications detailed in previous section</p>\n</li>\n</ol>\n<h4 id=\"for-existing-borrowers\">For Existing Borrowers</h4>\n<p>For active borrowers, maintaining regular data updates is essential for ongoing risk assessment:</p>\n<ol>\n<li><p>Frequency Requirements:</p>\n<ul>\n<li><p>Minimum: Monthly updates</p>\n</li>\n<li><p>Maximum: Every 3 months</p>\n</li>\n<li><p>Set up automated scheduling to ensure consistent delivery within these parameters</p>\n</li>\n</ul>\n</li>\n<li><p>Data Scope:</p>\n<ul>\n<li><p>Include all transactions since the last data upload</p>\n</li>\n<li><p>Ensure continuity with previously shared data to maintain a complete transaction history</p>\n</li>\n<li><p>Maintain consistent formatting and field names across all submissions</p>\n</li>\n</ul>\n</li>\n</ol>\n<h4 id=\"implementation-best-practices\">Implementation Best Practices</h4>\n<p>When setting up your API integration:</p>\n<ol>\n<li><p>Implement error handling and retry mechanisms</p>\n</li>\n<li><p>Set up monitoring for failed uploads</p>\n</li>\n<li><p>Maintain logs of successful data submissions</p>\n</li>\n<li><p>Include validation checks before sending data:</p>\n<ol>\n<li><p>Verify date ranges are complete</p>\n</li>\n<li><p>Check for required fields</p>\n</li>\n<li><p>Validate identifier consistency</p>\n</li>\n<li><p>Confirm data freshness requirements are met</p>\n</li>\n</ol>\n</li>\n</ol>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"6b1a7e5c-f26c-4085-bf8c-d4a28f9a46df","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"d185f6cb-ef2f-40d6-b1e7-d3e8f57d6330","type":"text/javascript","exec":[""]}}],"_postman_id":"3f740325-bd4c-4e0d-a434-a15f938499f2"},{"name":"Notification Webhook","item":[{"name":"Setting up Authentication of Webhook URLs","item":[],"id":"206a170c-25bb-4fee-90ac-2351f4dd5310","description":"<p>For you to integrate a webhook, we would require a standardised authentication setup followed for each of the webhook URL. Therefore, the standard is to provide us with an authentication URL that intakes email and password (dedicated for us) and returns a JWT token. Following is how we expect to have invoke the Authentication API and receive the token where the <code>base_auth_url</code>(Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Authentication URL</code>), email, and password (which are provided to us) are sent as below in the request body.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">    const loginResponse = await axios.post(base_auth_url, {\n      email,\n      password,\n    });\n    return loginResponse.data.token;\n\n</code></pre>\n<p>This token is to be used further in the Authorization header property for every other API. Following is how every webhook will be invoked from our end. Here, you can fill <a href=\"https://docs.google.com/forms/d/e/1FAIpQLScHl73bsiB_Xg-3baHD7iLTbb_TOJBA2UaMJC6zjEhOZ0Kuqg/viewform?usp=send_form\">this</a> form to provide us with different (or same) URLs to invoke the webhook that needs to be called for certain events. <code>payload</code> here are specific to the triggered event (discussed in the Payloads for Webhook URLs section)</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">await axios.post(webhook_url, payload,  {\n        headers: {\n          Authorization: token,\n        },\n      })\n\n</code></pre>\n<p><strong>IMPORTANT</strong>: Notice here that each of the webhook must be a <strong>POST</strong> request.</p>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"33a85fe3-d41d-45fb-a339-8f0a18b7b5dc","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"70665aa5-7029-46e3-bb50-b5143032865c","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"206a170c-25bb-4fee-90ac-2351f4dd5310"},{"name":"Payloads for Webhook URLs","item":[{"name":"General Event Payload","item":[],"id":"49b7b8d4-ed45-4436-bf65-b83d2aea445c","description":"<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: IWebhookEventType\n    timestamp: string; // ISO 8601 date format in string\n    event_data: T // generic type dependent on event\n}\nenum IWebhookEventType {\n  CUSTOMER_PROFILE_CREATION = 'customer_profile_creation',\n  CUSTOMER_PROFILE_REJECTION = 'customer_profile_rejection',\n  CUSTOMER_PROFILE_APPROVAL = 'customer_profile_approval',\n  CREDIT_LIMIT_UPDATE = 'credit_limit_update',\n\n  LOAN_CREATION = 'loan_creation',\n  LOAN_REJECTION = 'loan_rejection',\n  LOAN_APPROVED = 'loan_approved',\n  LOAN_DISBURSED = 'loan_disbursed',\n  LOAN_COMPLETED = 'loan_completed',\n  LOAN_MARKED_OVERDUE = 'loan_marked_overdue',\n\n  LOAN_TRANSACTION_CREATION = 'loan_transaction_creation',\n  LOAN_TRANSACTION_APPROVED = 'loan_transaction_approved',\n  LOAN_TRANSACTION_CANCELLED = 'loan_transaction_cancelled',\n}\n\n</code></pre>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"311401fd-5a04-4fdd-abbf-36d959410a2e","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"72a8c96c-3735-48f8-aa52-36163ab129d3","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"49b7b8d4-ed45-4436-bf65-b83d2aea445c"},{"name":"Customer Profile Created","item":[],"id":"d0dc1b29-2f00-44c1-8147-244f9d708b56","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Customer Profile Created URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: 'customer_profile_creation'\n    timestamp: string // ISO 8601 date format in string\n    event_data: {\n        user_id: string;\n        external_user_id?: string\n        status: 'pending'\n    }\n}\n\n</code></pre>\n","_postman_id":"d0dc1b29-2f00-44c1-8147-244f9d708b56","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"2d3d730c-8259-4e9e-8e1b-1eabcae071e7","id":"2d3d730c-8259-4e9e-8e1b-1eabcae071e7","name":"Payloads for Webhook URLs","type":"folder"}}},{"name":"Customer Profile Rejected Payload","item":[],"id":"0cc88009-72ac-4443-a8ac-78e0fc6ce7fd","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Customer Profile Rejected URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: 'customer_profile_rejection'\n    timestamp: string // ISO 8601 date format in string\n    event_data: {\n        user_id: string;\n        external_user_id?: string\n        status: 'rejected' | 'need_more_info'\n        reason: string\n        comment?: string\n    }\n}\n\n</code></pre>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"b3178ee4-5729-4b3f-806d-c3813c049774","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"2d543801-d31d-45e4-80f7-e2398c324ecf","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"0cc88009-72ac-4443-a8ac-78e0fc6ce7fd"},{"name":"Customer Profile Approved - Contract Pending","item":[],"id":"d673988a-51f7-4373-b13f-9ebf6d1ca2d9","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Customer Profile Approved URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: 'customer_profile_approval'\n    timestamp: string; // ISO 8601 date format in string\n    event_data: {\n        user_id: string;\n        external_user_id?: string\n        status: 'approved'\n        contract_status: \"contract_pending\";\n        facilities?: IFacility[];\n        contract_url?: string;\n        credit_limit?: number;\n    }\n}\n\n</code></pre>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"7fcb11cb-73c4-4996-a720-711d510fe448","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"5c3a7a1b-9c13-4139-8e86-65f2108f371d","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"d673988a-51f7-4373-b13f-9ebf6d1ca2d9"},{"name":"Loan Created","item":[],"id":"14dab959-3769-4107-af6a-95f9efe6ee9d","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Loan Created URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: 'loan_creation'\n    timestamp: string // ISO 8601 date format in string\n    event_data: {\n        user_id: string;\n        external_user_id?: string\n        status: 'under_review'\n    }\n}\n\n</code></pre>\n","_postman_id":"14dab959-3769-4107-af6a-95f9efe6ee9d","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"2d3d730c-8259-4e9e-8e1b-1eabcae071e7","id":"2d3d730c-8259-4e9e-8e1b-1eabcae071e7","name":"Payloads for Webhook URLs","type":"folder"}}},{"name":"Loan Rejection","item":[],"id":"5fb83cd9-ac30-42df-894f-ef3600bc9b09","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Loan Rejected URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">    event_type: 'loan_rejection'\n    timestamp: string; // ISO 8601 date format in string\n    event_data: {\n        user_id: string;\n        external_user_id?: string\n        loan_id: string;\n        status: 'rejected' | 'need_more_info'\n        reason: string;\n        comment?: string;\n    }\n}\n\n</code></pre>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"f4dda37a-7a0e-4004-a023-ebaf7f77f6b6","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"053436f3-c4ed-43fe-89b1-317ef8ef040d","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"5fb83cd9-ac30-42df-894f-ef3600bc9b09"},{"name":"Loan Approved","item":[],"id":"2fe0dac0-8a78-4639-9d52-5de10db9c98f","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Loan Approved URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: 'loan_approved'\n    timestamp: string; // ISO 8601 date format in string\n    event_data: {\n        user_id: string;\n        external_user_id?: string\n        loan_id: string;\n        status: 'approved' \n        principal_amount: number;\n        markup: number; // markup in percentage\n        tenure: number; // tenure in days\n    }\n}\n\n</code></pre>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"045eef36-042b-4a82-a7bf-a7d3fd5ba025","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"157f316e-9fc7-4843-a0f0-fe087e7c5788","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"2fe0dac0-8a78-4639-9d52-5de10db9c98f"},{"name":"Loan Disbursed","item":[],"id":"d5ded30a-c4df-45b8-b135-106516db3a49","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Loan Disbursed URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: 'loan_disbursed';\n    timestamp: string; // ISO 8601 date format in string\n    event_data: {\n        user_id: string;\n        external_user_id?: string\n        loan_id: string;\n        status: 'disbursed';\n        disbursed_amount: number;\n    }\n}\n\n</code></pre>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"fd91f30d-ba50-4c6a-be9d-f329a293c4de","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"b3819272-82c7-46f8-a4c1-2a7fc926f3ef","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"d5ded30a-c4df-45b8-b135-106516db3a49"},{"name":"Loan Completed","item":[],"id":"9df0fa12-ebba-4204-a850-5dbfeff16e2c","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Loan Completed URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: 'loan_completed';\n    timestamp: string; // ISO 8601 date format in string\n    event_data: {\n        user_id: string;\n        external_user_id?: string\n        loan_id: string;\n        status: 'completed';\n        payments: {\n            principal_repaid: number;\n          markup_fee: number;\n            late_fees: number;\n        }\n    }\n}\n\n</code></pre>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"6b602f86-0937-4004-904e-ac9733e3b774","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"8380586e-da04-43ff-bc81-16781e9d1173","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"9df0fa12-ebba-4204-a850-5dbfeff16e2c"},{"name":"Loan Marked Overdue","item":[],"id":"2a262a01-0df8-4794-865e-2a1b847564b3","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Loan Marked Overdue URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: 'loan_marked_overdue';\n    timestamp: string; // ISO 8601 date format in string\n    event_data: {\n        user_id: string;\n        external_user_id?: string\n        loan_id: string;\n        status: 'overdue';\n    }\n}\n\n</code></pre>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"7ceeca7b-a4ab-4a86-98a2-f29e1e5162b4","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"dc825de2-64ed-40d9-a2c3-8e3ea0ea27b5","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"2a262a01-0df8-4794-865e-2a1b847564b3"},{"name":"Loan Transaction Creation","item":[],"id":"d2a88999-959e-4fe5-a610-5b451d823aec","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Loan Transaction Created URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: 'loan_transaction_creation';\n    timestamp: string; // ISO 8601 date format in string\n    event_data: {\n        user_id: string;\n        external_user_id?: string;\n        loan_id: string;\n        loan_transaction_id: string;\n        amount: number;\n        payment_date: string; // ISO 8601 date format in string,\n        type: LoanTransactionType;\n        status: 'processing';\n    }\n}\nenum TransactionType {\n  DISBURSEMENT = 'disbursement',\n  REPAYMENT = 'repayment',\n  ADJUSTMENT = 'adjustment', // for adjusting the loan amount\n  REFUND = 'refund', // for refunding the loan repayments\n}\n\n</code></pre>\n","_postman_id":"d2a88999-959e-4fe5-a610-5b451d823aec","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"2d3d730c-8259-4e9e-8e1b-1eabcae071e7","id":"2d3d730c-8259-4e9e-8e1b-1eabcae071e7","name":"Payloads for Webhook URLs","type":"folder"}}},{"name":"Loan Transaction Approved","item":[],"id":"057dc367-d065-472e-b927-4a71fe58bc4e","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Loan Transaction Approved URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: 'loan_transaction_approved';\n    timestamp: string; // ISO 8601 date format in string\n    event_data: {\n        external_user_id?: string;\n        user_id: string;\n        loan_id: string;\n        loan_transaction_id: string;\n        status: 'approved';\n    }\n}\n\n</code></pre>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"c7781a89-e80a-4594-867c-bbeb902511aa","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"02a98769-90dd-425c-9e3a-8b8cbb7e2658","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"057dc367-d065-472e-b927-4a71fe58bc4e"},{"name":"Loan Transaction Cancelled","item":[],"id":"0ede4dab-9e2b-413c-9c5f-b872266b5d5a","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Loan Transaction Cancelled URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: 'loan_transaction_cancelled';\n    timestamp: string; // ISO 8601 date format in string\n    event_data: {\n        external_user_id?: string;\n        user_id: string\n        loan_id: string\n        loan_transaction_id: string;\n        status: 'cancelled';\n    }\n}\n\n</code></pre>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"ee85da29-b600-4be0-8134-701c798698f2","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"625c0ed4-8f60-4e21-9513-2bdb03dd9513","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"0ede4dab-9e2b-413c-9c5f-b872266b5d5a"},{"name":"Credit Limit Updated - Contract Signed","item":[],"id":"d83da79b-fe3d-48b3-9e18-59844d8f18c3","description":"<p>Referring from the <a href=\"https://forms.gle/c9JqGViSywfKTF1WA\">form</a>: <code>Credit Limit Updated URL</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">{\n    event_type: 'credit_limit_update'\n    timestamp: string; // ISO 8601 date format in string\n    event_data: {\n        user_id: string;\n        external_user_id?: string\n        status: 'approved'\n        contract_status: 'contract_valid';\n    }\n}\n\n</code></pre>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"57eb2a68-e71c-400d-859d-6366efe64a52","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"d88f745f-1cf3-45dd-abcf-67157d2212ca","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"d83da79b-fe3d-48b3-9e18-59844d8f18c3"}],"id":"2d3d730c-8259-4e9e-8e1b-1eabcae071e7","description":"<p>Following are the event payloads respective to each event.</p>\n<h1 id=\"note\">Note:</h1>\n<p>To accommodate future updates, ensure that your DTO does not enforce strict validations that would block new properties in the event payload. This flexibility will allow the webhook request payload to include any additional properties that may be introduced over time without immediate changes at your end.<br />Partners are also requested to handle webhook calls in an idempotent way. In case of repeat calls of the same payload, change should only be effected once.</p>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"0740fadc-0da9-4b28-b3ce-d9244035ffe0","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"c4792bdc-3694-4fca-8084-e511bf7e0f0a","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"2d3d730c-8259-4e9e-8e1b-1eabcae071e7"}],"id":"84d43685-eb8e-4f7d-897f-c0f310d7539d","description":"<p>Partners can provide a webhook to get notified for status updates to profiles, loans, loan-transactions.</p>\n<p>The partner can alternatively fetch the specified record to see the current status if real-time notifications are not important by calling the above integration APIs</p>\n<h2 id=\"note\">Note:</h2>\n<p>After finalising the webhooks, kindly fill out <a href=\"https://docs.google.com/forms/d/e/1FAIpQLScHl73bsiB_Xg-3baHD7iLTbb_TOJBA2UaMJC6zjEhOZ0Kuqg/viewform\">this</a> form to inform us about the properties related to configuring webhook invocation on our end.</p>\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"935040ac-9621-4a80-b56f-d701ee63d3c5","type":"text/javascript","packages":{},"exec":[""]}},{"listen":"test","script":{"id":"85df6fdb-50f5-4544-bd86-ada6809e8bf8","type":"text/javascript","packages":{},"exec":[""]}}],"_postman_id":"84d43685-eb8e-4f7d-897f-c0f310d7539d"}],"id":"349a8830-1562-4396-910d-7afbc727b789","description":"<p>Once done with the happy flow, we also recommend to get acquainted with these Utility APIs which would help in configuring the whole flow for users. These includes getting or updating information when in process of creating a financial request.</p>\n","_postman_id":"349a8830-1562-4396-910d-7afbc727b789","auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":true,"source":{"_postman_id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","id":"9bd876f8-1ffa-4657-9dc3-fc4b819f0c8a","name":"CreditBook Embedded Finance APIs","type":"collection"}}}],"auth":{"type":"bearer","bearer":{"basicConfig":[]}},"event":[{"listen":"prerequest","script":{"id":"e2701cc7-cce0-4722-94e6-5beb2c7ea73f","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"aef5386f-ce0c-43bd-8639-bf311a3a8f0f","type":"text/javascript","exec":[""]}}]}