> For the complete documentation index, see [llms.txt](https://klearstack.gitbook.io/klearstack-api-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://klearstack.gitbook.io/klearstack-api-documentation/fetch-documents/get-results-of-modified-invoices-since-the-last-pull.md).

# Get Results of Modified Invoices since the last pull

Endpoint Name : `getmodifiedinvoices`

Request type : `POST`

Authorization : Bearer token as header

Endpoint Details : This API is used to get the results of modified invoices which are modified by any user of a company since the last pull.

### Request Type

<table data-header-hidden><thead><tr><th width="115"></th><th></th></tr></thead><tbody><tr><td>Method</td><td>URL</td></tr><tr><td>POST</td><td><code>URL/access/klearstack/getmodifiedinvoices</code></td></tr></tbody></table>

### Request Body

<table data-header-hidden><thead><tr><th width="110.0909423828125"></th><th width="99.272705078125"></th><th width="104.27276611328125"></th><th></th></tr></thead><tbody><tr><td>Params</td><td>Values</td><td>Required</td><td>Description</td></tr><tr><td>company_name</td><td>string</td><td>Yes</td><td>Name of the company</td></tr><tr><td>username</td><td>string</td><td>Yes</td><td>Username for a particular user of a company</td></tr><tr><td>password</td><td>string</td><td>Yes</td><td>Password for a particular user of a company</td></tr><tr><td>document_type</td><td>string</td><td>No</td><td><p>Type of document to be processed - “Invoices”,  “Receipts”, “PurchaseOrders”,“NACH”,“LoanAgreement”</p><p>or “Insurances”.</p><p>By default “Invoices” will be set if this parameter is not passed</p><p>Note: Optional Parameter</p></td></tr></tbody></table>

### Shall

* Request Body

```sh
curl --location "URL/access/klearstack/getmodifiedinvoices" \
  --header "Authorization: Bearer your_token_here" \
  --form "company_name=Replace_Company_Name_Here" \
  --form "username=Replace_User_Name_Here" \
  --form "password=Replace_Password_Here" \
  --form "document_type=Invoices"
```

### Python

* Request Body

```python
import requests

url = "URL/access/klearstack/getmodifiedinvoices"

payload = {'company_name': 'Replace_Company_Name_Here',
'username': 'Replace_User_Name_Here',
'password': 'Replace_Password_Here',
'document_type': 'Invoices'}
files=[

]
headers = {
  'Authorization': 'Bearer your_token_here'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

```

### Java (OkHttp)

* Request Body

```java
OkHttpClient client = new OkHttpClient();

RequestBody body = new MultipartBody.Builder()
    .setType(MultipartBody.FORM)
    .addFormDataPart("company_name", "Replace_Company_Name_Here")
    .addFormDataPart("username", "Replace_User_Name_Here")
    .addFormDataPart("password", "Replace_Password_Here")
    .addFormDataPart("document_type", "Invoices")
    .build();

Request request = new Request.Builder()
    .url("URL/access/klearstack/getmodifiedinvoices")
    .post(body)
    .addHeader("Authorization", "Bearer your_token_here")
    .build();

Response response = client.newCall(request).execute();
```

### Node.js (Axios)

* Request Body

```javascript
const axios = require('axios');
const FormData = require('form-data');

let formData = new FormData();
formData.append('company_name', 'Replace_Company_Name_Here');
formData.append('username', 'Replace_User_Name_Here');
formData.append('password', 'Replace_Password_Here');
formData.append('document_type', 'Invoices');

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'URL/access/klearstack/getmodifiedinvoices',
  headers: {
    'Authorization': 'Bearer your_token_here',
    ...formData.getHeaders()
  },
  data: formData
};

axios.request(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });
```

### JavaScript (XHR)

* Request Body

```javascript
// WARNING: For POST requests, body is set to null by browsers.

var formData = new FormData();
formData.append("company_name", "Replace_Company_Name_Here");
formData.append("username", "Replace_User_Name_Here");
formData.append("password", "Replace_Password_Here");
formData.append("document_type", "Invoices");

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

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

xhr.open("POST", "URL/access/klearstack/getmodifiedinvoices");
xhr.setRequestHeader("Authorization", "Bearer your_token_here");

xhr.send(formData);
```

### API Response

<table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>Status Code</td><td>Response</td></tr><tr><td>200</td><td><p></p><pre class="language-json"><code class="lang-json">{
    "result": [
        {
            "file_name": "24101020953_Invoice Copy_Invoice Copy_1.pdf",
            "status": "in_progress"
        }
    ],
    "status": "in_progress"
}
</code></pre></td></tr><tr><td>403</td><td>Forbidden: Client Error</td></tr><tr><td>501</td><td>Server Error</td></tr></tbody></table>
