Get Results of Approved Invoices Using Date Filter
Endpoint Name: getapproveinvoices
Endpoint Details:This API is used to get the results of approved invoices which are approved by the approver of a company using date range filter, QBE status filter and username list.
Note: This API works only for Admin and Approver users.
Authorization: Bearer token as header
Request Type
Method
URL
POST
URL/access/klearstack/getapproveinvoices
Request Body
Type
Params
Values
Description
POST
company_name
string
Name of the company
POST
username
string
Username for a particular user of a company
POST
password
string
Password for a particular user of a company
POST
document_type
string
Type of document to be processed - “Invoices”, “Receipts”, “PurchaseOrders”,“NACH”,“LoanAgreement”
or “Insurances”
By default “Invoices” will be set if this parameter is not passed
Note: Optional Parameter
POST
from_date
string
Date from which the user wants approved invoices.
Format : “DD/MM/YYYY”
POST
to_date
string
Date till which user wants approved invoices.
Format : “DD/MM/YYYY”
POST
user_list
string
Name of users whose invoices are required.(comma separated)
Ex. “Creator,Creator1”
By default all users are considered.
Note: Optional Parameter
POST
QBE_status
string
Status of QBE integration.
Only two values are considered
“successful” or “failed” Note: Optional Parameter
Shell
Request Body
curl -X POST "URL/access/klearstack/getapproveinvoices" \
-H "Authorization: Bearer your_token_here" \
-H "Content-Type: application/json" \
-d '{
"company_name": "Replace_Company_Name_Here",
"username": "Replace_User_Name_Here",
"password": "Replace_Password_Here",
"document_type": "Invoices",
"from_date": "01/01/2024",
"to_date": "01/03/2024",
"user_list": "Creator,Creator1",
"QBE_status": "successful"
}'
Python
Request Body
import requests
# API URL
url = "URL/access/klearstack/getapproveinvoices"
# Request payload
data = {
"company_name": "Replace_Company_Name_Here",
"username": "Replace_User_Name_Here",
"password": "Replace_Password_Here",
"document_type": "Invoices", # Optional parameter
"from_date": "01/01/2024",
"to_date": "01/03/2024",
"user_list": "Creator,Creator1", # Optional parameter
"QBE_status": "successful"
}
# Headers
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer your_token_here"
}
# Make the POST request
response = requests.post(url, json=data, headers=headers)
# Print the response
if response.status_code == 200:
print(response.json())
else:
print("Error:", response.text)
Java
Request Body
import okhttp3.*;
import java.io.IOException;
public class GetApproveInvoicesAPI {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
// JSON payload
String jsonPayload = "{ \"company_name\": \"Replace_Company_Name_Here\", " +
"\"username\": \"Replace_User_Name_Here\", " +
"\"password\": \"Replace_Password_Here\", " +
"\"document_type\": \"Invoices\", " +
"\"from_date\": \"01/01/2024\", " +
"\"to_date\": \"01/03/2024\", " +
"\"user_list\": \"Creator,Creator1\", " +
"\"QBE_status\": \"successful\" }";
RequestBody body = RequestBody.create(
jsonPayload, MediaType.parse("application/json"));
Request request = new Request.Builder()
.url("URL/access/klearstack/getapproveinvoices")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer your_token_here")
.build();
try (Response response = client.newCall(request).execute()) {
if (response.isSuccessful()) {
System.out.println("Response: " + response.body().string());
} else {
System.out.println("Error: " + response.body().string());
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
Node Js
Request Body
var request = require('request');
const form_data = {
'company_name': 'Replace_Company_Name_Here',
'username': 'Replace_User_Name_Here',
'password': 'Replace_Password_Here',
'document_type': 'Invoices', // Optional parameter
'from_date': '01/01/2024',
'to_date': '01/03/2024',
'user_list': 'Creator,Creator1', // Optional parameter
'QBE_status': 'successful'
};
const options = {
url: 'URL/access/klearstack/getapproveinvoices',
json: form_data,
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_token_here'
}
};
request.post(options, function(err, httpResponse, body) {
if (err) {
console.error('Request failed:', err);
return;
}
console.log('Response:', body);
});
JavaScript
Request Body
var payload = JSON.stringify({
company_name: "Replace_Company_Name_Here",
username: "Replace_User_Name_Here",
password: "Replace_Password_Here",
document_type: "Invoices", // Optional parameter
from_date: "01/01/2024",
to_date: "01/03/2024",
user_list: "Creator,Creator1", // Optional parameter
QBE_status: "successful"
});
var xhr = new XMLHttpRequest();
xhr.open("POST", "URL/access/klearstack/getapproveinvoices", true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Authorization", "Bearer your_token_here");
// Handle response
xhr.onreadystatechange = function () {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
console.log("Response:", xhr.responseText);
} else {
console.error("Error:", xhr.responseText);
}
}
};
// Send request
xhr.send(payload);
API Response
Status
Example Response
200
{
"result": [
{
"Document_id": "5e9ebf7c1ed959c4bb4dc214",
"is_approved": 0,
"approved_date": "Wed Apr 14 2021",
"file_name": "tata capital west bengal 5712.pdf",
"overall_confidence": 0.917829326729445,
"AccountsData": {
"Supplier GL Account #": "1200021",
"Supplier ID": 1001,
"Supplier name": "Tatiana Henderson LLP",
"CGST": "450002, Central Input GST",
"SGST": "450001, State Input GST",
"IGST": "420003, Inter State Input GST",
"PurchaseAc": "980001, Printing & Stationery",
"SplitFlag": "false",
"LineItemAccounts": [
"LineItem1, 980001, Printing & Stationery, 49,357.00"
],
"SplitAccounts": [],
"individualQuickBookAc": [],
"individualQbItemType": [],
"sgstv": "",
"cgstv": "",
"igstv": "8,884.26",
"qbItemName": "",
"qbItemType": ""
},
"Inv_Date": {
"value": "23 February, 2020",
"confidence": 0.566981644843936,
"page_index": 1
},
"Inv_Number": {
"value": "MATTB-2331",
"confidence": 0.946715178008698,
"page_index": 1,
"coordinate": [
1283,
383,
1409,
409
]
},
"Inv_PO": {
"value": "P6060",
"confidence": 0.998517162654257,
"page_index": 1,
"coordinate": [
1287,
443,
1349,
468
]
},
"Inv_Total": {
"value": "30199",
"confidence": 0.970878755401809,
"page_index": 1,
"coordinate": [
0,
0,
0,
0
]
},
"Inv_CGST_Value": {
"value": "1661",
"confidence": 0.822383355941637,
"page_index": 1
},
"Inv_SGST_Value": {
"value": "1661",
"confidence": 0.881396053757078,
"page_index": 1
},
"Inv_CGST_Percent": {
"value": "5",
"confidence": 0.827240639155472,
"page_index": 1
},
"Inv_SGST_Percent": {
"value": "5",
"confidence": 0.823984961348311,
"page_index": 1
},
"Inv_Supplier": {
"value": "Pai International Electronics Ltd",
"page_index": 1,
"coordinate": [
0,
0,
0,
0
],
"confidence": 0.805663607700772
},
"Inv_Customer": {
"value": "Pai, INTERNATIONAL,",
"page_index": 1,
"coordinate": [
406,
58,
795,
105
],
"confidence": 0.954218689055312
},
"Inv_Type": {
"value": "Tax Invoice",
"confidence": 0.981186005027941,
"page_index": 1
},
"Inv_Currency": {
"value": "INR",
"confidence": 0.978,
"page_index": 1
},
"Inv_Origin": {
"value": "India",
"confidence": 0.978,
"page_index": 1
},
"Inv_Supplier_Address": {
"value": "GST INVOICE , PAI INTERNATIONAL ELECTRONICS LTD. , Corporate Office: # 28/1A, 100 Feet Road, Indiranagar, Bangalore-560 - 560038.",
"page_index": 1,
"coordinate": [
406,
3,
1179,
157
],
"confidence": 0.962132237592736
},
"Inv_Supplier_State": {
"value": "Karnataka",
"confidence": 0.95,
"page_index": 1
},
"Inv_Supplier_City": {
"value": "Bengaluru",
"confidence": 0.981349645091967,
"page_index": 1
},
"Inv_Supplier_Pincode": {
"value": "560038",
"confidence": 0.981349645091967,
"page_index": 1
},
"line_items": [
{
"row": {
"Description": "Dell Latitude 3400 C15 Intel Core I5 8265 U 8 Gb Ddr4 /512 Gb Ssd 14'' Screen(1366x768) Intel Uhd Graphic 620 10/100/1000 Ehernate Port Window 10 Pro With Bag Pack",
"of Goods": "",
"HSN Code": "8471",
"Quantity": "1 NOS",
"Rate": "49,357.00",
"per": "NOS",
"Line_Item_Total": "49,357.00"
},
"page_index": 1,
"coordinate": [
95,
776,
1343,
892
]
},
{
"row": {
"Description": "3 year warranty Output IGST 18%",
"HSN Code": "",
"Quantity": "",
"Rate": "18",
"per": "%",
"Line_Item_Total": "8,884.26"
},
"page_index": 2,
"coordinate": [
92,
777,
1325,
812
]
}
],
"data_items": [
{
"row": {
"Description": "APPLE IPHONE732GB 7 BLACK",
"serial_number": "MOBIP63",
"imei_number": "356642080262057",
"Line_Item_Total": "29900"
},
"page_index": 1,
"coordinate": [
153,
593,
342,
657
],
"confidence": 0.973677977720621
},
{
"row": {
"Description": "2 2 BOAT NECKLACE STYLE IN EAR SPORTS BT HEADSET ROCKERZ 255RBL",
"serial_number": "8904130843761/5314",
"imei_number": "",
"Line_Item_Total": "1899"
},
"page_index": 1,
"coordinate": [
152,
754,
374,
781
],
"confidence": 0.973677977720621
},
{
"row": {
"Description": "3 3 MOBILE CARRY BAG (PAPER)",
"serial_number": "BAG04",
"imei_number": "",
"Line_Item_Total": ""
},
"page_index": 1,
"coordinate": [
152,
835,
224,
859
],
"confidence": 0.973677977720621
}
]
}
],
"status": "complete",
“release_version”:”7.8.9”
}
400
{"error":"Please provide username."}
400
{"error":"Please provide password."}
401
{"error":"Incorrect username or password."}
500
{"error":"Something went wrong. Please try again later."}
Last updated