NAV
shell java python javascript

Product Flow

User On-Boarding

Dynamic Status/Banner API

curl --location 'https://user-dev.kredmint.in/user/eligibility'
--header 'Content-Type: application/json'
--header 'Authorization: Basic XXXX'
--data '{
    "username":"9819413273",
    "page":"profile",
    "source": "MOS"
}'
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"username\":\"9819413273\",\n    \"page\":\"profile\",\n    \"source\": \"MOS\"\n}");
Request request = new Request.Builder()
  .url("https://user-dev.kredmint.in/user/eligibility")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Basic XXXX")
  .build();
Response response = client.newCall(request).execute();
import http.client
import json

conn = http.client.HTTPSConnection("user-dev.kredmint.in") payload = json.dumps({ "username": "9819413273", "page": "profile", "source": "MOS" }) headers = { 'Content-Type': 'application/json', 'Authorization': 'Basic XXXX' } conn.request("POST", "/user/eligibility", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))

// WARNING: For POST requests, body is set to null by browsers.
var data = JSON.stringify({
  "username": "9819413273",
  "page": "profile",
  "source": "MOS"
});

var xhr = new XMLHttpRequest(); xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() { if(this.readyState === 4) { console.log(this.responseText); } });

xhr.open("POST", "https://user-dev.kredmint.in/user/eligibility"); xhr.setRequestHeader("Content-Type", "application/json"); xhr.setRequestHeader("Authorization", "Basic XXXX");

xhr.send(data);

This API can use to show the latest information about the user. for Ex. showing user status, assigned credit limit, banner url, etc.

HTTP Request

Sandbox: POST https://user-dev.kredmint.in/user/eligibility

Production: POST https://user.kredmint.in/user/eligibility

Request Body:

{
   "source": "BNPL",
   "username": "9887206895",
   "page": "profile",
   "failureDeepLink": "https://example.com/handler/failed",
   "successDeepLink": "https://example.com/handler/success",
   "backDeepLink": "https://example.com/handler/back",
   "userContext": {
       "fullName": "",
       "mobile": "",
       "email": "",
       "gender": "MALE",
       "gst": "",
       "pancard": "",
       "businessName": "",
       "aadharNumber": "",
       "gmv": {"minInLac": 0, "maxInLac": 0},
       "latLong": {"latitude": 0.0, "longitude": 0.0},
       "anchorVintageInDays": 368,
       "address": {
           "addressLine1": "",
           "addressLine2": "",
           "addressLine3": "",
           "state": "",
           "city": "",
           "pincode": ""
        },
        "companyOwned": "true"
     }
}

Response Body:

{
    "payload": {
        "show": true,
        "title": "Get a Credit Limit with kredmint.",
        "subTitle": "Kredmint lets you order now & pay later as per convenience.",
        "logoUrl": "https://kredmint-public.s3.ap-south-1.amazonaws.com/b3+(1).png",
        "landingUrl": "https://merchant2-dev.kredmint.in/auth/?sid=6626bb89d330a05177b64cce&userId=USR-2233&token=6b14bbb9-908a-4e9f-b7d0-99919189f195",
        "landingType": "DEFAULT",
        "availableCreditLimit": 0.0,
        "state": "IncompleteProfile",
        "creditLimit": 0.0,
        "totalOutstanding": 0.0
    },
    "sum": 0.0,
    "timestamp": 1713814409435,
    "error": null
}

Request Body Attributes

Attribute Description
source Static Value provided by kredmint.
username User mobile number.
page Static value profile.
failureDeepLink Handler for failure case to redirection from kredmint to client
successDeepLink Handler for success case to redirection from kredmint to client
backDeepLink Handler for back button action perform by the user to redirection from kredmint to client
userContext can pass user data to pre-fill user profile for seamless experience

Static Url

curl 'https://merchant2-dev.kredmint.in/auth?partnerId=XXX&clientToken=XXXX&mobile=9887206895'

This URL can configure to any banner or button to directly route on kredmint.

HTTP Request

Sandbox: https://merchant2-dev.kredmint.in/auth Note: Please use otp 1234 on development environment

Production: GET https://merchant.kredmint.in/auth

Query Parameters

Parameter Description
partnerId Partner ID provided by kredmint.
clientToken Token provided by kredmint.
mobile User mobile number.

Upload Financial Data

curl --location 'https://user-dev.kredmint.in/user/document/upload'
--header 'Authorization: Basic XXXX'
--form 'file=@"/path/to/file"'
--form 'docType="FINANCIAL_DATA"'
--form 'userId="USR-111"'
--form 'username="9887206895"'
--form 'docPassword=""'
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("file","file",
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File("/path/to/file")))
  .addFormDataPart("docType","FINANCIAL_DATA")
  .addFormDataPart("userId","USR-111")
  .addFormDataPart("username","9887206895")
  .addFormDataPart("docPassword","")
  .build();
Request request = new Request.Builder()
  .url("https://user-dev.kredmint.in/user/document/upload")
  .method("POST", body)
  .addHeader("Authorization", "Basic XXXX")
  .build();
Response response = client.newCall(request).execute();
import http.client
import mimetypes
from codecs import encode

conn = http.client.HTTPSConnection("user-dev.kredmint.in") dataList = [] boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T' dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=file; filename={0}'.format('file')))

fileType = mimetypes.guess_type('/path/to/file')[0] or 'application/octet-stream' dataList.append(encode('Content-Type: {}'.format(fileType))) dataList.append(encode(''))

with open('/path/to/file', 'rb') as f: dataList.append(f.read()) dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=docType;'))

dataList.append(encode('Content-Type: {}'.format('text/plain'))) dataList.append(encode(''))

dataList.append(encode("FINANCIAL_DATA")) dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=userId;'))

dataList.append(encode('Content-Type: {}'.format('text/plain'))) dataList.append(encode(''))

dataList.append(encode("USR-111")) dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=username;'))

dataList.append(encode('Content-Type: {}'.format('text/plain'))) dataList.append(encode(''))

dataList.append(encode("9887206895")) dataList.append(encode('--' + boundary)) dataList.append(encode('Content-Disposition: form-data; name=docPassword;'))

dataList.append(encode('Content-Type: {}'.format('text/plain'))) dataList.append(encode(''))

dataList.append(encode("")) dataList.append(encode('--'+boundary+'--')) dataList.append(encode('')) body = b'\r\n'.join(dataList) payload = body headers = { 'Authorization': 'Basic XXXX', 'Content-type': 'multipart/form-data; boundary={}'.format(boundary) } conn.request("POST", "/user/document/upload", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))

var data = new FormData();
data.append("file", fileInput.files[0], "file");
data.append("docType", "FINANCIAL_DATA");
data.append("userId", "USR-111");
data.append("username", "9887206895");
data.append("docPassword", "");

var xhr = new XMLHttpRequest(); xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() { if(this.readyState === 4) { console.log(this.responseText); } });

xhr.open("POST", "https://user-dev.kredmint.in/user/document/upload"); xhr.setRequestHeader("Authorization", "Basic XXXX");

xhr.send(data);

This API can use to upload financial data for underwriting.

HTTP Request

Sandbox: POST https://user-dev.kredmint.in/user/document/upload

Production: POST https://user.kredmint.in/user/document/upload

Response Body:

{
    "payload": {
        "id": "UDOC-5018",
        "createdBy": "USR-2255",
        "creationDate": 1714739453785,
        "lastModifiedDate": 1714739453785,
        "lastModifiedBy": "USR-2255",
        "url": "https://kredmint-user-doc-dev.s3.ap-south-1.kredmint.in/USR-2255/NGZvOf-TaxInvoice_AIN2425000543858.pdf",
        "userId": "USR-2255",
        "name": "TaxInvoice_AIN2425000543858.pdf",
        "relativeUrl": "USR-2255/NGZvOf-TaxInvoice_AIN2425000543858.pdf",
        "documentType": "FINANCIAL_DATA",
        "urlExpiryDate": 1714825853708,
        "seqPrefix": "UDOC-"
    },
    "sum": 0.0,
    "timestamp": 1714739453797,
    "error": null
}

Request Body Attributes

Attribute Description
file Supported file formats are csv and json.
docType Static value FINANCIAL_DATA.
userId Find it in eligibility api response (optional).
username mobile number
docPassword Send password if file is protected (optional)

Distributor / Supplier Management

Create New Distributor / Supplier

curl --location 'https://account-dev.kredmint.in/account/supplier' \
--header 'Authorization: Basic XXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "username": "9887206895",
    "accountHolderName": "Devratna Arya",
    "accountNumber": "12345432",
    "ifsc": "ICIC00000012",
    "bankName": "ICICI",
    "branchName": "Okhala",
    "gstin": "GST123",
    "supplierName": "Devratna Arya",
    "mobile": "7982892274",
    "email": "supplier@gmail.com"
}'

This API can use to create new suppliers or Distributors

HTTP Request

Sandbox: POST https://account-dev.kredmint.in/account/supplier

Production: POST https://account.kredmint.in/account/supplier

Request Body:

{
    "username": "9887206895",
    "accountHolderName": "Devratna Arya 1",
    "accountNumber": "12345432",
    "ifsc": "ICIC00000012",
    "bankName": "ICICI",
    "branchName": "Okhala",
    "gstin": "GST123",
    "supplierName": "Devratna Arya 1",
    "mobile": "798289227432",
    "email": "supplier1@gmail.com"
}

Response Body:

{
    "payload": {
        "id": "SUPB-123",
        "lenderId": "1234",
        "creationDate": 1715326942568,
        "lastModifiedDate": 1715326942568,
        "userId": "USR-2285",
        "mobile": "798289227432",
        "gstin": "GST123",
        "supplierName": "Devratna Arya 1",
        "supplierBankId": "BNK-275",
        "status": "Initiated",
        "email": "supplier1@gmail.com",
        "partnerInvoice": false,
        "seqPrefix": "SUPB-"
    },
    "sum": 0.0,
    "timestamp": 1715326942733,
    "error": null
}

Request Body Attributes

Attribute Description
username User mobile number. (Mandatory)
supplierName Supplier / Distributor full name (Mandatory)
mobile Supplier / Distributor mobile Number (Mandatory)
email Supplier / Distributor email id
gstin Supplier / Distributor GST Number
accountHolderName Account Holder Name (Mandatory)
accountNumber Bank account number (Mandatory)
ifsc IFSC code (Mandatory)
bankName Bank Name (Mandatory)
branchName Branch Name (Mandatory)

Get All Distributors / Suppliers

curl --location 'https://account-dev.kredmint.in/account/supplier?username=9887206895' \
--header 'Authorization: Basic XXXX'

This API can use to get all the suppliers or Distributors

HTTP Request

Sandbox: GET https://account-dev.kredmint.in/account/supplier

Production: GET https://account.kredmint.in/account/supplier

Response Body:

{
    "payload": [
        {
            "id": "SUPB-269",
            "lenderId": "639b1fd3802a930379de2128",
            "creationDate": 1715326286133,
            "lastModifiedDate": 1715326286133,
            "userId": "USR-2285",
            "mobile": "798289227",
            "gstin": "GST123",
            "supplierName": "Devratna Arya",
            "supplierBankId": "BNK-274",
            "status": "Initiated",
            "email": "supplier@gmail.com",
            "partnerInvoice": false,
            "seqPrefix": "SUPB-"
        }
    ],
    "sum": 0.0,
    "timestamp": 1715332382795,
    "error": null
}

Loan Disbursal

Invoice Pay by credit (Anchor Integration Flow)

curl --location 'https://user-dev.kredmint.in/user/eligibility'
--header 'Content-Type: application/json'
--header 'Authorization: Basic XXXX'
--data '{
    "username":"9819413273",
    "page":"payment",
    "source": "MOS",
    "invoiceNumber": "IN-123",
    "amount": 100.0,
    "paymentDate": 1713814546794
}'

This API can use to disburse amount from kredmint credit to supplier.

HTTP Request

Sandbox: POST https://user-dev.kredmint.in/user/eligibility

Production: POST https://user.kredmint.in/user/eligibility

Request Body:

{
   "source": "BNPL",
   "username": "9887206895",
   "page": "payment",
   "failureDeepLink": "https://example.com/handler/failed",
   "successDeepLink": "https://example.com/handler/success",
   "backDeepLink": "https://example.com/handler/back",
   "invoiceNumber": "",
   "paymentDate": 1234567890,
   "amount": 100.0,
   "invoicePdf": "https://example.com/invoice.pdf"
}

Response Body:

{
    "payload": {
        "show": true,
        "title": "Pay by kred Mint.",
        "subTitle": "Available Credit Rs 100000",
        "logoUrl": "https://kredmint-public.s3.ap-south-1.amazonaws.com/b3+(1).png",
        "landingUrl": "https://merchant2-dev.kredmint.in/auth/?sid=6626bc19d330a05177b64ccf&userId=USR-2225&token=f91fac22-1eb3-41cd-ba97-27edd0986b2f",
        "landingType": "INVOICE",
        "availableCreditLimit": 100000.0,
        "state": "Active",
        "creditLimit": 100000.0,
        "totalOutstanding": 0.0
    },
    "sum": 0.0,
    "timestamp": 1713814554113,
    "error": null
}

Request Body Attributes

Attribute Description
source Static Value provided by kredmint.
username User mobile number.
page Static value payment.
failureDeepLink Handler for failure case to redirection from kredmint to client
successDeepLink Handler for success case to redirection from kredmint to client
backDeepLink Handler for back button action perform by the user to redirection from kredmint to client
invoiceNumber unique identifier for the invoice
paymentDate Disbursement Date in millis
amount Invoice amount
invoicePdf URL for the invoice in pdf format

Invoice Pay by credit (Distributor / Supplier Integration Flow)

curl --location 'https://user-dev.kredmint.in/user/eligibility' \
--header 'Authorization: Basic XXXX' \
--header 'Content-Type: application/json' \
--data '{
    "username":"9887206895",
    "page":"payment",
    "invoiceNumber":"5435323121",
    "paymentDate":1715327098489,
    "amount":1000,
    "supplierId": "SUPB-270",
    "source": "BIZOM"
}'

This API can use to disburse amount from kredmint credit to supplier.

HTTP Request

Sandbox: POST https://user-dev.kredmint.in/user/eligibility

Production: POST https://user.kredmint.in/user/eligibility

Request Body:

{
    "username":"9887206895",
    "page":"payment",
    "invoiceNumber":"5435323121",
    "paymentDate":1715327098489,
    "amount":1000.0,
    "supplierId": "SUPB-270",
    "source": "BNPL",
    "failureDeepLink": "https://example.com/handler/failed",
    "successDeepLink": "https://example.com/handler/success",
    "backDeepLink": "https://example.com/handler/back",
    "invoicePdf": "https://example.com/invoice.pdf"
}

Response Body:

{
    "payload": {
        "show": true,
        "title": "Pay by kred Mint.",
        "subTitle": "Available Credit Rs 100000",
        "logoUrl": "https://kredmint-public.s3.ap-south-1.amazonaws.com/b3+(1).png",
        "landingUrl": "https://merchant2-dev.kredmint.in/auth/?sid=6626bc19d330a05177b64ccf&userId=USR-2225&token=f91fac22-1eb3-41cd-ba97-27edd0986b2f",
        "landingType": "INVOICE",
        "availableCreditLimit": 100000.0,
        "state": "Active",
        "creditLimit": 100000.0,
        "totalOutstanding": 0.0
    },
    "sum": 0.0,
    "timestamp": 1713814554113,
    "error": null
}

Request Body Attributes

Attribute Description
source Static Value provided by kredmint. (Mandatory)
username User mobile number. (Mandatory)
page Static value payment. (Mandatory)
supplierId Get it from the Create Supplier / Disctributor API response (Mandatory)
failureDeepLink Handler for failure case to redirection from kredmint to client
successDeepLink Handler for success case to redirection from kredmint to client
backDeepLink Handler for back button action perform by the user to redirection from kredmint to client
invoiceNumber unique identifier for the invoice (Mandatory)
paymentDate Disbursement Date in millis (Mandatory)
amount Invoice amount (Mandatory)
invoicePdf URL for the invoice in pdf format (Mandatory)

Invoice Upload API

Upload invoice once it is available in doc format

curl --location 'https://account-dev.kredmint.in/account/invoice/upload' \
--header 'Authorization: Basic XXX' \
--form 'file=@' \
--form 'username="959579"' \
--form 'invoiceNumber="543354123253"'

This API can use to push invoice doc after disbursal.

HTTP Request

Sandbox: POST https://account-dev.kredmint.in/account/invoice/upload

Production: POST https://account.kredmint.in/account/invoice/upload

Response Body:

{
    "payload": {
        "id": "UDOC-5588",
        "url": "https://kredmint-user-doc-dev.s3.ap-south-1.amazonaws.com/USR-2307/ADFJlB-Screenshot_2023-11-22_182933.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240529T123719Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86399&X-Amz-Credential=AKIAQPDDTIBA2GHW7WID%2F20240529%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Signature=9a2c74e2d2e4e419156d6d3c194c68fffa6b3e1967771260786914caad99eab5",
        "userId": "USR-2307",
        "name": "Screenshot 2023-11-22 182933.png",
        "relativeUrl": "USR-2307/ADFJlB-Screenshot_2023-11-22_182933.png",
        "documentType": "INVOICE",
        "urlExpiryDate": 1717072639779
    },
    "sum": 0.0,
    "timestamp": 1716986251645
}

Request Body Attributes

Attribute Description
file select pdf file.
username Common identifier (mobile number)
invoiceNumber same invoice number that was passed in Loan Disbursal API

Webhooks

Disbursement Start Notification Webhook

curl --location 'your webhook url'
--header 'Content-Type: application/json'
--header 'Authorization: Basic XXXX'
--data '{
    "payload": {
        "id": "IN-787",
        "username": "9599170579",
        "invoiceNumber": "543354123253",
        "paymentDate": 1716864267785,
        "amount": 1000.0,
        "transactionId": null,
        "status": "Initiated",
        "utr": null,
        "reason": null
    },
    "type": "INVOICE",
    "timestamp": 1716865119200
}'

This Webhook we will send once transaction successfully completed.

Request Body:

{
    "payload": {
        "id": "IN-787",
        "username": "9599170579",
        "invoiceNumber": "543354123253",
        "paymentDate": 1716864267785,
        "amount": 1000.0,
        "transactionId": null,
        "status": "Initiated",
        "utr": null,
        "reason": null
    },
    "type": "INVOICE",
    "timestamp": 1716865119200
}

Request Body Attributes

Attribute Description
invoiceNumber Same value as in disbursement request.
amount Disbursed amount.
paymentDate Same value as in disbursement request.
transactionId Unique id for the transaction
status Status of the transaction, expected values: Initiated, Verified, Approved, Paid, Failed, Completed, Cancelled
username Common identifier (mobile number)
id Kredmint unique id for the invoice
type it will differentiate the webhooks, expected values: PAYMENT, PAYMENT_SETTLEMENT, NACH, USER, INVOICE

Disbursement Success Notification Webhook

curl --location 'your webhook url'
--header 'Content-Type: application/json'
--header 'Authorization: Basic XXXX'
--data '{
    "payload": {
        "id": "IN-787",
        "username": "9599170579",
        "invoiceNumber": "543354123253",
        "paymentDate": 1716864267785,
        "amount": 1000.0,
        "transactionId": "gheahgfja",
        "status": "Paid",
        "utr": null,
        "reason": null
    },
    "type": "INVOICE",
    "timestamp": 1716865119200
}'

This Webhook we will send once transaction successfully completed.

Request Body:

{
    "payload": {
        "id": "IN-787",
        "username": "9599170579",
        "invoiceNumber": "543354123253",
        "paymentDate": 1716864267785,
        "amount": 1000.0,
        "transactionId": "dsfgkgsfd",
        "status": "Paid",
        "utr": null,
        "reason": null
    },
    "type": "INVOICE",
    "timestamp": 1716865119200
}

Request Body Attributes

Attribute Description
invoiceNumber Same value as in disbursement request.
amount Disbursed amount.
paymentDate Same value as in disbursement request.
transactionId Unique id for the transaction
status Status of the transaction, expected values: Initiated, Verified, Approved, Paid, Failed, Completed, Cancelled
username Common identifier (mobile number)
id Kredmint unique id for the invoice
type it will differentiate the webhooks, expected values: PAYMENT, PAYMENT_SETTLEMENT, NACH, USER, INVOICE

Disbursement Failure Notification Webhook

curl --location 'your webhook url'
--header 'Content-Type: application/json'
--header 'Authorization: Basic XXXX'
--data '{
    "payload": {
        "id": "IN-787",
        "username": "9599170579",
        "invoiceNumber": "543354123253",
        "paymentDate": 1716864267785,
        "amount": 1000.0,
        "transactionId": null,
        "status": "Failed",
        "utr": null,
        "reason": null
    },
    "type": "INVOICE",
    "timestamp": 1716865119200
}'

This Webhook we will send once transaction successfully completed.

Request Body:

{
    "payload": {
        "id": "IN-787",
        "username": "9599170579",
        "invoiceNumber": "543354123253",
        "paymentDate": 1716864267785,
        "amount": 1000.0,
        "transactionId": null,
        "status": "Failed",
        "utr": null,
        "reason": "invalid amount or date provided"
    },
    "type": "INVOICE",
    "timestamp": 1716865119200
}

Request Body Attributes

Attribute Description
invoiceNumber Same value as in disbursement request.
amount Disbursed amount.
paymentDate Same value as in disbursement request.
transactionId Unique id for the transaction
status Status of the transaction, expected values: Initiated, Verified, Approved, Paid, Failed, Completed, Cancelled
username Common identifier (mobile number)
id Kredmint unique id for the invoice
type it will differentiate the webhooks, expected values: PAYMENT, PAYMENT_SETTLEMENT, NACH, USER, INVOICE

Errors

The Kredmint API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- Your API key is not for requested resource.
404 Not Found -- The specified api/resource could not be found.
405 Method Not Allowed -- You tried to access with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many request! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.