CART API Spec
CART API Spec
[Credit Assessment
and Robotics
Transformation]
API Specification v2.0
CART API Specification
Contents
Upload API.............................................................................................................................................................3
Upload Binary ........................................................................................................................................................5
Download Report (JSON) ......................................................................................................................................6
Download Report (XML) .......................................................................................................................................7
Download Report (EXCEL) ...................................................................................................................................8
Generate Auto-Fetch URL .....................................................................................................................................9
Callback Details ...................................................................................................................................................11
Annexure ..............................................................................................................................................................13
List of Document Status ...................................................................................................................................13
Banks for Auto Fetch ........................................................................................................................................13
Error Messages in Call-back API .....................................................................................................................14
CART API Specification
Upload API
API Overview
URL https://cartbi.com/api/upload
Type POST
Request Content multipart/form-data
Type
Response Content application/json
Type
Header 1 auth-Token Provided by CART Team(starts with API://)
Description This API can take a single PDF file or a single ZIP file containing multiple documents. CART
automatically segregates the data on the basis of account number. If a customer has multiple
statements for same account, then all the statements will be consolidated and a single summary
would be generated. Similarly, if a customer has multiple accounts in different banks and has
multiple documents against each account, then CART will consolidate all the data on the basis of
account number.
This API only submits the data to CART server and generates a unique document Id against each
API call. If the status in the response is ‘Submitted’ that means your documents were uploaded
successfully. In case you get the status as ‘Rejected’ then you will get the error message as well in
the response.
Request Details
file Somefile.pdf
metadata {"password": "","bank":"Other", "name":"Loan Application Number", "productType" : "Salaried"}
documentDetails [{"groupCompany":"", "accountNumber":"","accountType":"","internal":true, "odCcLimit":50000,
"organizationName":"employerName"}]
authToken <this auth-token will be used while calling the Call-back. Only required if auth-token is dynamic>
Request Attributes
Field Sub-field Data Required Description
Type
metadata password String As If a file is password protected, you must provide the
applicable password. If there are multiple files with different
password, then all passwords can be concatenated with
comma (,) without caring about the order. If one
password is “ABC01” and another is “XYZ01” then we
can accept any of the two “ABC01,XYZ01” or
“XYZ01,ABC01”
metadata bank String Yes “Other” can be passed for auto-detection of Bank if
Bank Name is not available or single requests containing
documents from multiple banks. Else you can pass Bank
Id as provided by CART team.
metadata name String Optional It can be used to tag the request with a unique
identifier like loan application number or any other
CART API Specification
unique internal identifier.
documentDetails groupCompany String Optional It takes the name of sister concerns, which can further
be utilized to detect internal transfers within
organization.
documentDetails accountNumber String Optional If you want to specify the ODCC limit for an account,
you can pass the account number for which ODCC limit
is to be considered.
documentDetails accountType String Optional Possible values will be Savings Account, Current
Account, Overdraft / Cash Credit, Director/Promoter
documentDetails internal boolean Optional True, if groupCompany to be considered for Internal
transfers else false.
documentDetails odCcLimit Double Optional To specify the OD Limit of an account.
documentDetails organizationName String Optional In case of a Salaried account, employer name can be
passed if available to increase the accuracy of Salary
detection.
authToken authToken String Optional This authorization token will be used while calling your
Call-back API. Only required if auth-token is dynamic. If
it is static, it can registered in our system while
integration.
Sample Response
{
"docId": "DOC000XXX",
"status": "Submitted",
"message": null,
"periodStart": null,
"periodEnd": null,
"documents": null,
"fileName": "BankStatment1.pdf",
"uploadTime": 1658324994737,
"ocrFile": false,
"fileCount": 1,
"totalPages": 21,
"error": false
}
Error Codes
When Password is Incorrect
Status Rejected
message Incorrect Password : BankStatment1.pdf
When File is Corrupt
Status Rejected
message Invalid File
CART API Specification
Upload Binary
API Overview
URL https://cartbi.com/api/uploadBinary
Type POST
Request application/json
Content Type
Response application/json
Content Type
Header 1 auth-Token Provided by CART Team(starts with API://)
Header 2 Metadata {"password": "","bank":"Other", "name":"Loan Application Number",
"productType" : "Salaried"}
Header 3 Filename Appropriate filename with proper extension(,pdf/.zip)
Header 4 documentDetails [{"groupCompany":"", "accountNumber":"","accountType":"","internal":true,
"odCcLimit":50000, "organizationName":"employerName"}]
Description This API can take base64 representation of a single PDF file or a single ZIP file containing multiple
documents. Attribute level details of headers like metadata and documentDetails can be referred to
the first API /upload.
This API only submits the data to CART server and generates a unique document Id against each API
call. If the status in the response is ‘Submitted’ that means your documents were uploaded
successfully. In case you get the status as ‘Rejected’ then you will get the error message as well in
the response. Error codes and other details are similar to the Upload API
Sample Response
Similar to 1st API /api/upload
CART API Specification
API Overview
URL https://cartbi.com/api/downloadFile
Type POST
Request Content text/plain
Type
Response Content application/json
Type
Header 1 auth-Token Provided by CART Team(starts with API://)
Description When Call-back API is triggered with the status as “Processed”, that means report can now be
downloaded from CART.
Once you call this method, the status changes to “Downloaded”
Sample Request
DOC0XXXXXX
Sample Response
Link a Reference File
API Overview
URL https://cartbi.com/api/downloadFileAsXml
Type POST
Request Content text/plain
Type
Response Content application/xml
Type
Header 1 auth-Token Provided by CART Team(starts with API://)
Description When Call-back API is triggered with the status as “Processed”, that means report can now be
downloaded from CART.
Once you call this method, the status changes to “Downloaded”
Sample Request
DOC0XXXXXX
Sample Response
Link a Reference File
API Overview
URL https://cartbi.com/api/downloadFileAsExcel
Type POST
Request Content text/plain
Type
Response Content application/octet-stream
Type
Header 1 auth-Token Provided by CART Team(starts with API://)
Description When Call-back API is triggered with the status as “Processed”, that means report can now be
downloaded from CART.
Once you call this method, the status changes to “Downloaded”.
This API will return an excel file if Upload API is used and it will return a zip file containing excel
report and raw data in case if Auto-fetch journey is used.
Sample Request
DOC0XXXXXX
Sample Response
Link a Reference File, it can be Excel or Zip(in case of Auto fetch)
API Overview
URL https://cartbi.com/api/generateNetBankingRequest
Type POST
Request Content application/json
Type
Response Content application/json
Type
Header 1 auth-Token Provided by CART Team (starts with API://)
Description This API takes the basic details of customer like mobile number, name and the nature of activity
to be performed like fetching the data from Net Banking, Account Aggregator, GSTR Data or PDF
files directly from customer. This API returns a unique URL (temporary in nature) on every API
call. This URL can either be shared to customer directly via SMS/Email or can be opened in your
current web/mobile application using I-Frame or Web View. Once the customer is directed to the
link, user will see the respective flow as per the selected bank. If the bank name passed in the API
is “AA” then user will be re-directed to account aggregator flow, if “GSTR” then user will be asked
GST portal credentials, or “SBI/ICICI” etc then screen will capture the net banking credentials.
Request Attributes
Field Data Required Description
Type
fileNo String Optional It can be used to tag the request with a unique identifier like loan
application number or any other unique internal identifier.
name String Optional Customer Name, if available
bank String Optional AA If AA is passed, user will be directed to Consent screen to
approve or reject consent request.
GSTR User will see a screen to capture GSTR details.
SBI/ICICI/PNB Preselected bank for user to capture Net Banking or PDF
etc Upload as per defaultScreen parameter
accountType String Yes Default this to “Saving”
contactNo String Yes It should be 10 digit mobile number of end Customer.
clientAuthKey String Optional This authorization token will be used while calling your Call-back API. Only
required if auth-token is dynamic. If it is static, it can registered in our
system while integration.
organizationName String Optional In case of a Salaried account, employer name can be passed if available to
increase the accuracy of Salary detection.
defaultScreen boolean Optional If value is “PDF Upload” user will see an option to upload the files from his
device.
If value is “NetBanking” use will an option to complete the journey via Net
banking. BS will be directly downloaded from his Net banking portal. If
nothing is passed, user will have both the options and can proceed as per his
CART API Specification
will. Note: Not applicable for Account Aggregator flow.
organizationName Double Optional In case of a Salaried account, employer name can be passed if available to
increase the accuracy of Sal
periodStart Date Optional For GST/ITR only. To specify the period of Data to be downloaded
periodEnd Date Optional For GST/ITR only. To specify the period of Data to be downloaded
product String Optional For Account Aggregator only. Product should any one as per the configured
products
amount String Optional For Account Aggregator only. Loan amount to be passed, if required
Sample Request
{
"fileNo" : "LoanApp_10000021",
"name" : "Ravi Kumar",
"accountType" : "Saving",
"contactNo" : "9540213549",
"clientAuthKey" : null,
"organizationName" : "LARSEN AND TOUBRO",
"defaultScreen" : "NetBanking",
"bank" : "ICICI"
}
Sample Response
{
"requestId": "REQ00000467",
"tempUrl": "https://cartnetbanking.com/web/open?r=REQ00000467&u=pABPkWFZo5twxsdrKxeZRjGMpMLLM5yEU
qozFsasdazfs9Ra8WQo",
"validFrom": 1658330600069,
"vaildTo": 1658337800069,
"emailId": null,
"active": 1,
"status": "Pending",
"fileNo": "LoanApp_10000021",
"name": "Ravi Kumar",
"contactNo": "9540213549",
"accountType": "Saving",
"bank": "ICICI",
"requestType": "API",
"defaultScreen": "NetBanking",
"errorMessage": null,
"clientAuthKey": null,
"organizationName": "LARSEN AND TOUBRO",
"periodStart": null,
"periodEnd": null,
"product": null,
"amount": null
}
CART API Specification
Callback Details
@POST
@Path("/cart_callback")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_PLAIN)
public String cartAPICallback(Form status) {
//status contains keys (docId, requestId, status, reportFileName, endTime, message, fileNo)
//trigger your async download
return"Success";
}
Push notifications service can be consumed via any socket.io client by subscribing to “message” event. For
e.g.
In case you wish to integrate our web interface inside your application then we can communicate to your
client side scripting via standard IFrame message system.
Sample IFrame Code which can be plugged in your webpage :
<iframe src="<url received from “generate netbanking request”>" frameborder="0"
style="overflow:hidden;height:500px;width:100%" height="500px" width="100%"></iframe>
function onMessage(event) {
var data = event.data;
</script>
<body style="margin:0px;padding:0px;overflow:hidden">
<iframe
src="https://cartnetbanking.com/web/open?r=REQ00541903&u=LsaLQLO$q9soE~86ouvY876@h9v@38wpqL3MJ4R924a2cHX-
ITQ725ufk" frameborder="0" style="overflow:hidden;height:500px;width:100%" height="500px" width="100%"></iframe>
</body>
</html>
CART API Specification
Annexure
List of Document Status
Document Status
Submitted Document uploaded successfully for processing.
In Progress Document Processing has started and yet not completed.
Processed Uploaded document has been processed and is ready for report generation.
Downloaded Report has been downloaded.
Rejected Document uploaded is not applicable for processing due Invalid Files.
Deleted Document has been deleted from Server.
There might be minor changes in API with every new released version even after ensuring backward
compatibly for most of the end points.