Client

Client

new Client(client_id, client_secret, username, api_key, base_url, api_version, timeout)

Create instance of a Client

Source:
Parameters:
Name Type Default Description
client_id string

Your Veryfi client id

client_secret string

Your Veryfi client secret

username string

Your Veryfi username

api_key string

Your Veryfi API key

base_url string https://api.veryfi.com/
api_version string v8
timeout Number 120

Methods

delete_document(document_id)

Delete document from Veryfi

Source:
Parameters:
Name Type Description
document_id string

ID of the document you'd like to delete

get_document(document_id) → {JSON}

Retrieve document by ID

Source:
Parameters:
Name Type Description
document_id string

ID of the document you'd like to retrieve

Returns:
Type:
JSON

Data extracted from the Document

get_documents() → {JSON}

Get JSON of documents

Source:
Returns:
Type:
JSON

JSON object of previously processed documents

get_w2_document(document_id) → {JSON}

Get a w2 document

Source:
Parameters:
Name Type Description
document_id string

ID of the document you'd like to retrieve

Returns:
Type:
JSON

Data extracted from the Document

get_w2_documents(page) → {Array}

Get all w2 documents.

Source:
Parameters:
Name Type Description
page int

number, response is capped to maximum of 50 results per page.

Returns:
Type:
Array

An array of JSON with all w2 documents.

process_document(file_path, categories, delete_after_processing, kwargs) → {JSON}

Process a document and extract all the fields from it

Source:
Parameters:
Name Type Description
file_path String

Path on disk to a file to submit for data extraction

categories Array

List of categories Veryfi can use to categorize the document

delete_after_processing Boolean

Delete this document from Veryfi after data has been extracted

kwargs Object

Additional request parameters

Returns:
Type:
JSON

Data extracted from the document

Example
veryfi_client.process_document('file/path',
                               ['Entertainment','Food'],
                               true,
                               {"extra":"parameters"})

process_document_buffer(base64_encoded_string, file_name, categories, delete_after_processing, kwargs) → {JSON}

Process a document and extract all the fields from it

Source:
Parameters:
Name Type Description
base64_encoded_string String

Buffer of a file to submit for data extraction

file_name String

The file name including the extension

categories Array

List of categories Veryfi can use to categorize the document

delete_after_processing Boolean

Delete this document from Veryfi after data has been extracted

kwargs Object

Additional request parameters

Returns:
Type:
JSON

Data extracted from the document

Example
veryfi_client.process_document_buffer('base64_encoded_string',
                               'receipt.png',
                               ['Entertainment','Food'],
                               true,
                               {'extra': 'parameters'})

process_document_url(file_url, file_urls, categories, delete_after_processing, boost_mode, external_id, max_pages_to_process, kwargs) → {JSON}

Process document from url and extract all the fields from it.

Source:
Parameters:
Name Type Description
file_url string

Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".

file_urls Array

Required if file_url isn't specified. List of publicly accessible URLs to multiple files, e.g. ["https://cdn.example.com/receipt1.jpg", "https://cdn.example.com/receipt2.jpg"]

categories Array

List of categories to use when categorizing the document

delete_after_processing boolean

Delete this document from Veryfi after data has been extracted

boost_mode int

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

external_id string

Optional custom document identifier. Use this if you would like to assign your own ID to documents

max_pages_to_process int

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.

kwargs Object

Additional request parameters

Returns:
Type:
JSON

Data extracted from the document.

Example
veryfi_client.process_document_url('https://cdn.example.com/receipt.jpg')

process_w2_document(file_path, delete_after_processing, max_pages_to_process, kwargs) → {JSON}

Upload a document from a file path

Source:
Parameters:
Name Type Description
file_path String

Path on disk to a file to submit for data extraction

delete_after_processing boolean

Delete this document from Veryfi after data has been extracted

max_pages_to_process int

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.

kwargs Object

Additional request parameters

Returns:
Type:
JSON

Data extracted from the document.

process_w2_document_from_buffer(file_name, file_buffer, delete_after_processing, max_pages_to_process, kwargs) → {JSON}

Upload a document from a buffer.

Source:
Parameters:
Name Type Description
file_name String

The file name including the extension

file_buffer String

Buffer of a file to submit for data extraction

delete_after_processing boolean

Delete this document from Veryfi after data has been extracted

max_pages_to_process int

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.

kwargs Object

Additional request parameters

Returns:
Type:
JSON

Data extracted from the document.

process_w2_document_from_url(file_name, file_url, file_urls, delete_after_processing, max_pages_to_process, kwargs) → {JSON}

Process a w2 document from an url.

Source:
Parameters:
Name Type Description
file_name String

The file name including the extension

file_url string

Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".

file_urls Array

Required if file_url isn't specified. List of publicly accessible URLs to multiple files, e.g. ["https://cdn.example.com/receipt1.jpg", "https://cdn.example.com/receipt2.jpg"]

delete_after_processing boolean

Delete this document from Veryfi after data has been extracted

max_pages_to_process int

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.

kwargs Object

Additional request parameters

Returns:
Type:
JSON

Data extracted from the document.

update_document(document_id, kwargs) → {JSON}

Update data for a previously processed document, including almost any field like vendor, date, notes and etc.

Source:
Parameters:
Name Type Description
document_id string

ID of the document you'd like to update

kwargs Object

fields to update

Returns:
Type:
JSON

A document json with updated fields, if fields are writable. Otherwise a document with unchanged fields.

Example
veryfi_client.update_document(id, {date:"2021-01-01", notes:"look what I did"})