Package veryfi
Interface Client
- All Known Implementing Classes:
ClientImpl
public interface Client
Veryfi API client for Java.
The instances of classes that implement this interface are thread-safe and immutable.
-
Method Summary
Modifier and TypeMethodDescriptionaddLineItem
(String documentId, AddLineItem payload) Add a new line item on an existing document.addLineItemAsync
(String documentId, AddLineItem payload) Add a new line item on an existing document.deleteDocument
(String documentId) Delete Document from VeryfideleteDocumentAsync
(String documentId) Delete Document from Veryfi.deleteLineItem
(String documentId, String lineItemId) Delete an existing line item on an existing document.deleteLineItemAsync
(String documentId, String lineItemId) Delete an existing line item on an existing document.deleteLineItems
(String documentId) Delete all line items on an existing document.deleteLineItemsAsync
(String documentId) Delete all line items on an existing document.getDocument
(String documentId) Returns a json stringString
document informationgetDocumentAsync
(String documentId) Returns a json stringCompletableFuture<String>
document information.Returns a json stringString
list of documents.Returns a json stringCompletableFuture<String>
list of documents.getLineItem
(String documentId, String lineItemId) Retrieve a line item for existing document by ID.getLineItemAsync
(String documentId, String lineItemId) Retrieve a line item for existing document by ID.getLineItems
(String documentId) Retrieve all line items for a document.getLineItemsAsync
(String documentId) Retrieve all line items for a document.processDocument
(String filePath, List<String> categories, boolean deleteAfterProcessing, org.json.JSONObject parameters) Process a document and extract all the fields from itprocessDocumentAsync
(String filePath, List<String> categories, boolean deleteAfterProcessing, org.json.JSONObject parameters) Process a document and extract all the fields from itprocessDocumentUrl
(String fileUrl, List<String> fileUrls, List<String> categories, boolean deleteAfterProcessing, int maxPagesToProcess, boolean boostMode, String externalId, org.json.JSONObject parameters) Process Document from url and extract all the fields from it.processDocumentUrlAsync
(String fileUrl, List<String> fileUrls, List<String> categories, boolean deleteAfterProcessing, int maxPagesToProcess, boolean boostMode, String externalId, org.json.JSONObject parameters) Process Document from url and extract all the fields from it.void
setBaseUrl
(String baseUrl) By default is https://api.veryfi.com/api/;void
setHttpClient
(HttpClient httpClient) By default is https://api.veryfi.com/api/;void
setTimeOut
(int timeOut) Define new time out for the requests in secondsupdateDocument
(String documentId, org.json.JSONObject parameters) Update data for a previously processed document, including almost any field like `vendor`, `date`, `notes` and etc.updateDocumentAsync
(String documentId, org.json.JSONObject parameters) Update data for a previously processed document, including almost any field like `vendor`, `date`, `notes` and etc.updateLineItem
(String documentId, String lineItemId, UpdateLineItem payload) Update an existing line item on an existing document.updateLineItemAsync
(String documentId, String lineItemId, UpdateLineItem payload) Update an existing line item on an existing document.
-
Method Details
-
getDocuments
String getDocuments()Returns a json stringString
list of documents.- Returns:
- the list of previously processed documents
String
-
getDocumentsAsync
CompletableFuture<String> getDocumentsAsync()Returns a json stringCompletableFuture<String>
list of documents.- Returns:
- the list of previously processed documents
String
-
getDocument
Returns a json stringString
document information- Parameters:
documentId
- ID of the document you'd like to retrieve.- Returns:
- the data extracted from the Document
String
-
getDocumentAsync
Returns a json stringCompletableFuture<String>
document information.- Parameters:
documentId
- ID of the document you'd like to retrieve.- Returns:
- the data extracted from the Document
CompletableFuture<String>
-
processDocument
String processDocument(String filePath, List<String> categories, boolean deleteAfterProcessing, org.json.JSONObject parameters) Process a document and extract all the fields from it- Parameters:
filePath
- Path on disk to a file to submit for data extractioncategories
- List of categories Veryfi can use to categorize the documentdeleteAfterProcessing
- Delete this document from Veryfi after data has been extractedparameters
- Additional request parameters- Returns:
- the data extracted from the Document
String
-
processDocumentAsync
CompletableFuture<String> processDocumentAsync(String filePath, List<String> categories, boolean deleteAfterProcessing, org.json.JSONObject parameters) Process a document and extract all the fields from it- Parameters:
filePath
- Path on disk to a file to submit for data extractioncategories
- List of categories Veryfi can use to categorize the documentdeleteAfterProcessing
- Delete this document from Veryfi after data has been extractedparameters
- Additional request parameters- Returns:
- the data extracted from the Document
CompletableFuture<String>
-
processDocumentUrl
String processDocumentUrl(String fileUrl, List<String> fileUrls, List<String> categories, boolean deleteAfterProcessing, int maxPagesToProcess, boolean boostMode, String externalId, org.json.JSONObject parameters) Process Document from url and extract all the fields from it.- Parameters:
fileUrl
- Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".fileUrls
- Required if file_url isn't specifies. List of publicly accessible URLs to multiple files, e.g. ["https://cdn.example.com/receipt1.jpg", "https://cdn.example.com/receipt2.jpg"]categories
- List of categories to use when categorizing the documentdeleteAfterProcessing
- Delete this document from Veryfi after data has been extractedmaxPagesToProcess
- When sending a long document to Veryfi for processing, this parameter controls how many pages of the document will be read and processed, starting from page 1.boostMode
- Flag that tells Veryfi whether boost mode should be enabled. When set to 1, Veryfi will skip data enrichment steps, but will process the document faster. Default value for this flag is 0externalId
- Optional custom document identifier. Use this if you would like to assign your own ID to documentsparameters
- Additional request parameters- Returns:
- the data extracted from the Document
String
-
processDocumentUrlAsync
CompletableFuture<String> processDocumentUrlAsync(String fileUrl, List<String> fileUrls, List<String> categories, boolean deleteAfterProcessing, int maxPagesToProcess, boolean boostMode, String externalId, org.json.JSONObject parameters) Process Document from url and extract all the fields from it.- Parameters:
fileUrl
- Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".fileUrls
- Required if file_url isn't specifies. List of publicly accessible URLs to multiple files, e.g. ["https://cdn.example.com/receipt1.jpg", "https://cdn.example.com/receipt2.jpg"]categories
- List of categories to use when categorizing the documentdeleteAfterProcessing
- Delete this document from Veryfi after data has been extractedmaxPagesToProcess
- When sending a long document to Veryfi for processing, this parameter controls how many pages of the document will be read and processed, starting from page 1.boostMode
- Flag that tells Veryfi whether boost mode should be enabled. When set to 1, Veryfi will skip data enrichment steps, but will process the document faster. Default value for this flag is 0externalId
- Optional custom document identifier. Use this if you would like to assign your own ID to documentsparameters
- Additional request parameters- Returns:
- the data extracted from the Document
CompletableFuture<String>
-
deleteDocument
Delete Document from Veryfi- Parameters:
documentId
- ID of the document you'd like to delete.- Returns:
- the response data.
String
-
deleteDocumentAsync
Delete Document from Veryfi.- Parameters:
documentId
- ID of the document you'd like to delete.- Returns:
- the response data.
CompletableFuture<String>
-
updateDocument
Update data for a previously processed document, including almost any field like `vendor`, `date`, `notes` and etc.- Parameters:
documentId
- ID of the document you'd like to update.parameters
- Additional request parameters.- Returns:
- A document json with updated fields, if fields are writable. Otherwise a document with unchanged fields.
String
-
updateDocumentAsync
Update data for a previously processed document, including almost any field like `vendor`, `date`, `notes` and etc.- Parameters:
documentId
- ID of the document you'd like to update.parameters
- Additional request parameters.- Returns:
- A document json with updated fields, if fields are writable. Otherwise a document with unchanged fields.
CompletableFuture<String>
-
getLineItems
Retrieve all line items for a document.- Parameters:
documentId
- ID of the document you'd like to retrieve.- Returns:
- List of line items extracted from the document.
String
-
getLineItemsAsync
Retrieve all line items for a document.- Parameters:
documentId
- ID of the document you'd like to retrieve.- Returns:
- List of line items extracted from the document.
CompletableFuture<String>
-
getLineItem
Retrieve a line item for existing document by ID.- Parameters:
documentId
- ID of the document you'd like to retrieve.lineItemId
- ID of the line item you'd like to retrieve.- Returns:
- Line item extracted from the document.
String
-
getLineItemAsync
Retrieve a line item for existing document by ID.- Parameters:
documentId
- ID of the document you'd like to retrieve.lineItemId
- ID of the line item you'd like to retrieve.- Returns:
- Line item extracted from the document.
CompletableFuture<String>
-
addLineItem
Add a new line item on an existing document.- Parameters:
documentId
- ID of the document you'd like to update.payload
- line item object to add.- Returns:
- Added line item data.
String
- Throws:
NotValidModelException
- when the model is not valid it throws this exception.
-
addLineItemAsync
CompletableFuture<String> addLineItemAsync(String documentId, AddLineItem payload) throws NotValidModelException Add a new line item on an existing document.- Parameters:
documentId
- ID of the document you'd like to update.payload
- line item object to add.- Returns:
- Added line item data.
CompletableFuture<String>
- Throws:
NotValidModelException
- when the model is not valid it throws this exception.
-
updateLineItem
String updateLineItem(String documentId, String lineItemId, UpdateLineItem payload) throws NotValidModelException Update an existing line item on an existing document.- Parameters:
documentId
- ID of the document you'd like to update.lineItemId
- ID of the line item you'd like to update.payload
- line item object to update.- Returns:
- Line item data with updated fields, if fields are writable. Otherwise line item data with unchanged fields.
String
- Throws:
NotValidModelException
- when the model is not valid it throws this exception.
-
updateLineItemAsync
CompletableFuture<String> updateLineItemAsync(String documentId, String lineItemId, UpdateLineItem payload) throws NotValidModelException Update an existing line item on an existing document.- Parameters:
documentId
- ID of the document you'd like to update.lineItemId
- ID of the line item you'd like to update.payload
- line item object to update.- Returns:
- Line item data with updated fields, if fields are writable. Otherwise line item data with unchanged fields.
CompletableFuture<String>
- Throws:
NotValidModelException
- when the model is not valid it throws this exception.
-
deleteLineItems
Delete all line items on an existing document.- Parameters:
documentId
- ID of the document you'd like to delete.- Returns:
- the response data.
String
-
deleteLineItemsAsync
Delete all line items on an existing document.- Parameters:
documentId
- ID of the document you'd like to delete.- Returns:
-
deleteLineItem
Delete an existing line item on an existing document.- Parameters:
documentId
- ID of the document you'd like to delete.lineItemId
- ID of the line item you'd like to delete.- Returns:
- the response data.
String
-
deleteLineItemAsync
Delete an existing line item on an existing document.- Parameters:
documentId
- ID of the document you'd like to delete.lineItemId
- ID of the line item you'd like to delete.- Returns:
- the response data.
CompletableFuture<String>
-
setTimeOut
void setTimeOut(int timeOut) Define new time out for the requests in seconds- Parameters:
timeOut
- of the http requests in seconds
-
setBaseUrl
By default is https://api.veryfi.com/api/;- Parameters:
baseUrl
- for the Veryfi API
-
setHttpClient
By default is https://api.veryfi.com/api/;- Parameters:
httpClient
- for the Veryfi API
-