0% found this document useful (0 votes)
12 views

CART API Spec

The CART API Specification v2.0 outlines the various APIs available for uploading documents, downloading reports, generating auto-fetch URLs, and handling callbacks. It includes detailed descriptions of request and response formats, error codes, and integration methods for web applications. Key functionalities include uploading PDF or ZIP files, downloading reports in multiple formats, and generating temporary URLs for customer actions related to banking data retrieval.

Uploaded by

ashutosh2894
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

CART API Spec

The CART API Specification v2.0 outlines the various APIs available for uploading documents, downloading reports, generating auto-fetch URLs, and handling callbacks. It includes detailed descriptions of request and response formats, error codes, and integration methods for web applications. Key functionalities include uploading PDF or ZIP files, downloading reports in multiple formats, and generating temporary URLs for customer actions related to banking data retrieval.

Uploaded by

ashutosh2894
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

CART API Specification

[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 Request – Headers to be passed separately


{
"file":"JVBERi0xLjMKJaqrrK0KNCAwIG9iago8PC…."
}

Sample Response
Similar to 1st API /api/upload
CART API Specification

Download Report (JSON)

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

Sample Response if document is Still has “In Progress” status


{
"docId": "DOC00011826",
"status": "In Progress",
"message": null,
"periodStart": null,
"periodEnd": null,
"documents": null,
"data": null,
"error": false
}
CART API Specification

Download Report (XML)

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

Sample Response if document is Still has “In Progress” status


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<downloadResponse>
<bankStatement>false</bankStatement>
<docId>DOC00011826</docId>
<error>false</error>
<status>In Progress</status>
</downloadResponse>
CART API Specification

Download Report (EXCEL)

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)

Sample Response if document is Still has “In Progress” status


HTTP 204 No Content
CART API Specification

Generate Auto-Fetch URL(For Net Banking/Account Aggregator/GSTR/PDF Upload)

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

API Specification for Processed/Rejected Documents (Server Side)


URL Your URI
Type POST
Request Content application/x-www-form-urlencoded
Type
Response Content text/plain
Type
Description After a document is processed and report is ready for download, we can call your end point with
relevant data so you may download the report. This facility avoids the need to wait for document
status to change before it can be downloaded.
Also when your callback API implementation is ready, please provide the endpoint of the API so
that we can configure it to our System, after this you will start receiving notifications.

Sample API (Java):

@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 for processed documents (Client / Server Side):

Push notifications service can be consumed via any socket.io client by subscribing to “message” event. For
e.g.

var socket = io.connect('https://cartbi.com:9092?token=auth-token'});


socket.on("message", function(msg) { Console.write(msg.docId) }); //processed document id
CART API Specification

Integration on web page via Javascript (Embedded View):

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>

HTML Sample to integrate Net Banking UI in your Web-View or I-frame


<!DOCTYPE html>
<html>
<script>
if (window.addEventListener) {
window.addEventListener("message", onMessage, false);
}

function onMessage(event) {
var data = event.data;

alert(data.status);// sample data json--> { source : "cartnetbanking.com", "status" : "SUCCESS/ERROR",


"request":"REQ00000039" }
}

</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.

Banks for Auto Fetch

Auto Fetch Bank Codes


Bank Code Type
AA Account Aggregator, if configured.
GSTR To fetch the GSTR Report.
ITRV To fetch ITR Acknowledgement Form
AXIS NetBanking
CITI NetBanking
HDFC NetBanking
ICICI NetBanking
INDUSIND NetBanking
KOTAK NetBanking
SBI NetBanking
RBL BANK NetBanking
CANARA NetBanking
IDFC NetBanking
PNB NetBanking
AU SMALL FINANCE BANK NetBanking
BOB NetBanking
CENTRAL BANK OF INDIA NetBanking
YES NetBanking
FEDRAL BANK NetBanking
INDIAN BANK NetBanking
UNION NetBanking
CART API Specification

Error Messages in Call-back API

Messages received in the Call-back Along with the status


S. No. Messages
1. Malformed/Invalid document.
2. Fraud Alert. File Created/Modified/Unlocked through unauthentic source.
3. Only .pdf and .zip format files supported
4. Please select Other as a bank in case of multiple bank zip file.
5. Please upload a consolidated zip file in case of multiple files.
6. Poor quality scan file.
7. Poor Scan Quality File. Not Readable records Ignored.
8. Poor quality scan file and duplicate records removed.
9. Duplicate Records Removed.
10. Ocr capability not subscribed for your Account.
11. OCR Daily Limit exceeded.
12. OCR is not allowed in testing environment.
13. OCR uploaded after 7PM will be processed on next business day.
14. Ocr / Pdf testing evaluation period expire
15. Ocr evaluation period Expire
16. Evaluation Period Over.
17. Page limit exceeded
18. Holiday. OCR will be processed next day.
19. Duplicate Documents.
20. Timed Out Exception.
21. Cancelled by user.
22. Latest Banking transactions not available.
23. Please get the approval from your RCM for this file and mailed to us at [email protected]
24. File not downloaded properly
25. Report Shared Offline
26. Balance generated manually
27. GSTR-1 files ignored.

There might be minor changes in API with every new released version even after ensuring backward
compatibly for most of the end points.

You might also like