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 Details

    • getDocuments

      String getDocuments()
      Returns a json string String list of documents.
      Returns:
      the list of previously processed documents String
    • getDocumentsAsync

      CompletableFuture<String> getDocumentsAsync()
      Returns a json string CompletableFuture<String> list of documents.
      Returns:
      the list of previously processed documents String
    • getDocument

      String getDocument(String documentId)
      Returns a json string String document information
      Parameters:
      documentId - ID of the document you'd like to retrieve.
      Returns:
      the data extracted from the Document String
    • getDocumentAsync

      CompletableFuture<String> getDocumentAsync(String documentId)
      Returns a json string CompletableFuture<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 extraction
      categories - List of categories Veryfi can use to categorize the document
      deleteAfterProcessing - Delete this document from Veryfi after data has been extracted
      parameters - 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 extraction
      categories - List of categories Veryfi can use to categorize the document
      deleteAfterProcessing - Delete this document from Veryfi after data has been extracted
      parameters - 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 document
      deleteAfterProcessing - Delete this document from Veryfi after data has been extracted
      maxPagesToProcess - 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 0
      externalId - Optional custom document identifier. Use this if you would like to assign your own ID to documents
      parameters - 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 document
      deleteAfterProcessing - Delete this document from Veryfi after data has been extracted
      maxPagesToProcess - 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 0
      externalId - Optional custom document identifier. Use this if you would like to assign your own ID to documents
      parameters - Additional request parameters
      Returns:
      the data extracted from the Document CompletableFuture<String>
    • deleteDocument

      String deleteDocument(String documentId)
      Delete Document from Veryfi
      Parameters:
      documentId - ID of the document you'd like to delete.
      Returns:
      the response data. String
    • deleteDocumentAsync

      CompletableFuture<String> deleteDocumentAsync(String documentId)
      Delete Document from Veryfi.
      Parameters:
      documentId - ID of the document you'd like to delete.
      Returns:
      the response data. CompletableFuture<String>
    • updateDocument

      String updateDocument(String documentId, org.json.JSONObject parameters)
      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

      CompletableFuture<String> updateDocumentAsync(String documentId, org.json.JSONObject parameters)
      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

      String getLineItems(String documentId)
      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

      CompletableFuture<String> getLineItemsAsync(String documentId)
      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

      String getLineItem(String documentId, String lineItemId)
      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

      CompletableFuture<String> getLineItemAsync(String documentId, String lineItemId)
      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

      String addLineItem(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. 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

      String deleteLineItems(String documentId)
      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

      CompletableFuture<String> deleteLineItemsAsync(String documentId)
      Delete all line items on an existing document.
      Parameters:
      documentId - ID of the document you'd like to delete.
      Returns:
    • deleteLineItem

      String deleteLineItem(String documentId, String lineItemId)
      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

      CompletableFuture<String> deleteLineItemAsync(String documentId, String lineItemId)
      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

      void setBaseUrl(String baseUrl)
      By default is https://api.veryfi.com/api/;
      Parameters:
      baseUrl - for the Veryfi API
    • setHttpClient

      void setHttpClient(HttpClient httpClient)
      By default is https://api.veryfi.com/api/;
      Parameters:
      httpClient - for the Veryfi API