Module veryfi.client
View Source
from veryfi.client_base import Client as ClientBase
from veryfi.a_docs import ADocs
from veryfi.bank_statements import BankStatements
from veryfi.bussines_cards import BussinesCards
from veryfi.checks import Checks
from veryfi.documents import Documents
from veryfi.w2s import W2s
from veryfi.w8s import W8s
from veryfi.w9s import W9s
class Client(ClientBase, ADocs, BankStatements, BussinesCards, Checks, Documents, W2s, W8s, W9s):
def __init__(
self,
client_id: str,
client_secret: str,
username: str,
api_key: str,
base_url: str = ClientBase.BASE_URL,
api_version: str = ClientBase.API_VERSION,
timeout: int = ClientBase.API_TIMEOUT,
):
super().__init__(
client_id=client_id,
client_secret=client_secret,
username=username,
api_key=api_key,
base_url=base_url,
api_version=api_version,
timeout=timeout,
)
ADocs.__init__(self, super())
BankStatements.__init__(self, super())
BussinesCards.__init__(self, super())
Checks.__init__(self, super())
Documents.__init__(self, super())
W2s.__init__(self, super())
W8s.__init__(self, super())
W9s.__init__(self, super())
Classes
Client
class Client(
client_id: str,
client_secret: str,
username: str,
api_key: str,
base_url: str = 'https://api.veryfi.com/api/',
api_version: str = 'v8',
timeout: int = 30
)
View Source
class Client(ClientBase, ADocs, BankStatements, BussinesCards, Checks, Documents, W2s, W8s, W9s):
def __init__(
self,
client_id: str,
client_secret: str,
username: str,
api_key: str,
base_url: str = ClientBase.BASE_URL,
api_version: str = ClientBase.API_VERSION,
timeout: int = ClientBase.API_TIMEOUT,
):
super().__init__(
client_id=client_id,
client_secret=client_secret,
username=username,
api_key=api_key,
base_url=base_url,
api_version=api_version,
timeout=timeout,
)
ADocs.__init__(self, super())
BankStatements.__init__(self, super())
BussinesCards.__init__(self, super())
Checks.__init__(self, super())
Documents.__init__(self, super())
W2s.__init__(self, super())
W8s.__init__(self, super())
W9s.__init__(self, super())
Ancestors (in MRO)
- veryfi.client_base.Client
- veryfi.a_docs.ADocs
- veryfi.bank_statements.BankStatements
- veryfi.bussines_cards.BussinesCards
- veryfi.checks.Checks
- veryfi.documents.Documents
- veryfi._documents.tags.Tags
- veryfi._documents.line_items.LineItems
- veryfi._documents.pdf_split.PDFSplit
- veryfi.w2s.W2s
- veryfi._w2s.w2_split.W2Split
- veryfi.w8s.W8s
- veryfi.w9s.W9s
Class variables
API_TIMEOUT
API_VERSION
BASE_URL
DEFAULT_CATEGORIES
Methods
add_line_item
def add_line_item(
self,
document_id: int,
payload: Dict
) -> Dict
Add a new line item on an existing document.
https://docs.veryfi.com/api/receipts-invoices/create-a-line-item/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to update | None |
payload | None | line item object to add | None |
Returns:
Type | Description |
---|---|
None | Added line item data |
View Source
def add_line_item(self, document_id: int, payload: Dict) -> Dict:
"""
Add a new line item on an existing document.
https://docs.veryfi.com/api/receipts-invoices/create-a-line-item/
:param document_id: ID of the document you'd like to update
:param payload: line item object to add
:return: Added line item data
"""
return self.client._request("POST", f"/documents/{document_id}/line-items/", payload)
add_tag
def add_tag(
self,
document_id,
tag_name
)
Add a new tag on an existing document.
https://docs.veryfi.com/api/receipts-invoices/add-a-tag-to-a-document/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to update | None |
tag_name | None | name of the new tag | None |
Returns:
Type | Description |
---|---|
None | Added tag data |
View Source
def add_tag(self, document_id, tag_name):
"""
Add a new tag on an existing document.
https://docs.veryfi.com/api/receipts-invoices/add-a-tag-to-a-document/
:param document_id: ID of the document you'd like to update
:param tag_name: name of the new tag
:return: Added tag data
"""
endpoint_name = f"/documents/{document_id}/tags/"
request_arguments = {"name": tag_name}
return self.client._request("PUT", endpoint_name, request_arguments)
add_tags
def add_tags(
self,
document_id,
tags
)
Add multiple tags on an existing document.
https://docs.veryfi.com/api/receipts-invoices/add-tags-to-a-document/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to update | None |
tags | None | array of strings | None |
Returns:
Type | Description |
---|---|
None | Added tags data |
View Source
def add_tags(self, document_id, tags):
"""
Add multiple tags on an existing document.
https://docs.veryfi.com/api/receipts-invoices/add-tags-to-a-document/
:param document_id: ID of the document you'd like to update
:param tags: array of strings
:return: Added tags data
"""
endpoint_name = f"/documents/{document_id}/tags/"
request_arguments = {"tags": tags}
return self.client._request("POST", endpoint_name, request_arguments)
delete_any_document
def delete_any_document(
self,
document_id: int
)
Delete a document.
https://docs.veryfi.com/api/anydocs/delete-a-A-doc/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | The unique identifier of the document. | None |
View Source
def delete_any_document(self, document_id: int):
"""
Delete a document.
https://docs.veryfi.com/api/anydocs/delete-a-A-doc/
:param document_id: The unique identifier of the document.
"""
endpoint_name = f"/any-documents/{document_id}/"
self.client._request("DELETE", endpoint_name, {})
delete_bank_statement
def delete_bank_statement(
self,
document_id: int
)
Delete a bank statement document.
https://docs.veryfi.com/api/bank-statements/delete-a-bank-statement/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | The unique identifier of the document. | None |
View Source
def delete_bank_statement(self, document_id: int):
"""
Delete a bank statement document.
https://docs.veryfi.com/api/bank-statements/delete-a-bank-statement/
:param document_id: The unique identifier of the document.
"""
endpoint_name = f"/bank-statements/{document_id}/"
self.client._request("DELETE", endpoint_name, {})
delete_business_card
def delete_business_card(
self,
document_id: int
)
Delete a business card document.
https://docs.veryfi.com/api/business-cards/delete-a-business-card/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | The unique identifier of the document. | None |
View Source
def delete_business_card(self, document_id: int):
"""
Delete a business card document.
https://docs.veryfi.com/api/business-cards/delete-a-business-card/
:param document_id: The unique identifier of the document.
"""
endpoint_name = f"/business-cards/{document_id}/"
self.client._request("DELETE", endpoint_name, {})
delete_check
def delete_check(
self,
document_id: int
)
Delete a check document from Veryfi
https://docs.veryfi.com/api/checks/delete-a-check/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the check document you'd like to delete | None |
View Source
def delete_check(self, document_id: int):
"""
Delete a check document from Veryfi
https://docs.veryfi.com/api/checks/delete-a-check/
:param document_id: ID of the check document you'd like to delete
"""
endpoint_name = f"/checks/{document_id}/"
self.client._request("DELETE", endpoint_name, {})
delete_document
def delete_document(
self,
document_id: int
)
Delete Document from Veryfi
https://docs.veryfi.com/api/receipts-invoices/delete-a-document/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to delete | None |
View Source
def delete_document(self, document_id: int):
"""
Delete Document from Veryfi
https://docs.veryfi.com/api/receipts-invoices/delete-a-document/
:param document_id: ID of the document you'd like to delete
"""
self.client._request("DELETE", f"/documents/{document_id}/", {"id": document_id})
delete_line_item
def delete_line_item(
self,
document_id: int,
line_item_id: int
)
Delete an existing line item on an existing document.
https://docs.veryfi.com/api/receipts-invoices/delete-a-line-item/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to delete | None |
line_item_id | None | ID of the line item you'd like to delete | None |
View Source
def delete_line_item(self, document_id: int, line_item_id: int):
"""
Delete an existing line item on an existing document.
https://docs.veryfi.com/api/receipts-invoices/delete-a-line-item/
:param document_id: ID of the document you'd like to delete
:param line_item_id: ID of the line item you'd like to delete
"""
self.client._request("DELETE", f"/documents/{document_id}/line-items/{line_item_id}")
delete_line_items
def delete_line_items(
self,
document_id: int
)
Delete all line items on an existing document.
https://docs.veryfi.com/api/receipts-invoices/delete-all-document-line-items/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to delete | None |
View Source
def delete_line_items(self, document_id: int):
"""
Delete all line items on an existing document.
https://docs.veryfi.com/api/receipts-invoices/delete-all-document-line-items/
:param document_id: ID of the document you'd like to delete
"""
self.client._request("DELETE", f"/documents/{document_id}/line-items/")
delete_tag
def delete_tag(
self,
document_id,
tag_id
)
Unlink a tag from the list of tags assigned to a specific Document.
https://docs.veryfi.com/api/receipts-invoices/unlink-a-tag-from-a-document/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document | None |
tag_id | None | ID of the tag you'd like to unlink | None |
View Source
def delete_tag(self, document_id, tag_id):
"""
Unlink a tag from the list of tags assigned to a specific Document.
https://docs.veryfi.com/api/receipts-invoices/unlink-a-tag-from-a-document/
:param document_id: ID of the document
:param tag_id: ID of the tag you'd like to unlink
"""
endpoint_name = f"/documents/{document_id}/tags/{tag_id}"
self.client._request("DELETE", endpoint_name, {})
delete_tags
def delete_tags(
self,
document_id
)
Unlink all tags assigned to a specific Document.
https://docs.veryfi.com/api/receipts-invoices/unlink-all-tags-from-a-document/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document | None |
View Source
def delete_tags(self, document_id):
"""
Unlink all tags assigned to a specific Document.
https://docs.veryfi.com/api/receipts-invoices/unlink-all-tags-from-a-document/
:param document_id: ID of the document
"""
endpoint_name = f"/documents/{document_id}/tags"
self.client._request("DELETE", endpoint_name, {})
delete_w2
def delete_w2(
self,
document_id: int
)
Delete a w2 document.
https://docs.veryfi.com/api/w2s/delete-a-w-2/
View Source
def delete_w2(self, document_id: int):
"""
Delete a w2 document.
https://docs.veryfi.com/api/w2s/delete-a-w-2/
"""
endpoint_name = f"/w2s/{document_id}/"
self.client._request("DELETE", endpoint_name, {})
delete_w8
def delete_w8(
self,
document_id
)
Delete Document from Veryfi
https://docs.veryfi.com/api/w-8ben-e/delete-a-w-8-ben-e/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to delete | None |
View Source
def delete_w8(self, document_id):
"""
Delete Document from Veryfi
https://docs.veryfi.com/api/w-8ben-e/delete-a-w-8-ben-e/
:param document_id: ID of the document you'd like to delete
"""
endpoint_name = f"/w-8ben-e/{document_id}/"
self.client._request("DELETE", endpoint_name, {})
delete_w9
def delete_w9(
self,
document_id: int
)
Delete a W-9 document.
https://docs.veryfi.com/api/w9s/delete-a-w-9/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | The unique identifier of the document. | None |
View Source
def delete_w9(self, document_id: int):
"""
Delete a W-9 document.
https://docs.veryfi.com/api/w9s/delete-a-w-9/
:param document_id: The unique identifier of the document.
"""
endpoint_name = f"/w9s/{document_id}/"
self.client._request("DELETE", endpoint_name, {})
get_any_document
def get_any_document(
self,
document_id: int,
**kwargs
) -> Dict
Get aDocs endpoint allows you to retrieve a previously processed any doc.
https://docs.veryfi.com/api/anydocs/get-a-A-doc/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | The unique identifier of the document. | None |
kwargs | None | Additional query parameters | None |
Returns:
Type | Description |
---|---|
None | Document Data |
View Source
def get_any_document(self, document_id: int, **kwargs) -> Dict:
"""
Get aDocs endpoint allows you to retrieve a previously processed any doc.
https://docs.veryfi.com/api/anydocs/get-a-A-doc/
:param document_id: The unique identifier of the document.
:param kwargs: Additional query parameters
:return: Document Data
"""
endpoint_name = f"/any-documents/{document_id}/"
return self.client._request("GET", endpoint_name, {}, kwargs)
get_any_documents
def get_any_documents(
self,
created_date__gt: Optional[str] = None,
created_date__gte: Optional[str] = None,
created_date__lt: Optional[str] = None,
created_date__lte: Optional[str] = None,
**kwargs
) -> List[Dict]
Get a list of documents
https://docs.veryfi.com/api/anydocs/get-A-docs/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
created_date__gt | None | Search for documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request. | None |
created_date__gte | None | Search for documents with a created date greater than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request. | None |
created_date__lt | None | Search for documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request. | None |
created_date__lte | None | Search for documents with a created date less than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request. | None |
kwargs | None | Additional query parameters | None |
Returns:
Type | Description |
---|---|
None | List of previously processed documents |
View Source
def get_any_documents(
self,
created_date__gt: Optional[str] = None,
created_date__gte: Optional[str] = None,
created_date__lt: Optional[str] = None,
created_date__lte: Optional[str] = None,
**kwargs,
) -> List[Dict]:
"""
Get a list of documents
https://docs.veryfi.com/api/anydocs/get-A-docs/
:param created_date__gt: Search for documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request.
:param created_date__gte: Search for documents with a created date greater than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request.
:param created_date__lt: Search for documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request.
:param created_date__lte: Search for documents with a created date less than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request.
:param kwargs: Additional query parameters
:return: List of previously processed documents
"""
query_params = {}
if created_date__gt:
query_params["created_date__gt"] = created_date__gt
if created_date__gte:
query_params["created_date__gte"] = created_date__gte
if created_date__lt:
query_params["created_date__lt"] = created_date__lt
if created_date__lte:
query_params["created_date__lte"] = created_date__lte
query_params.update(kwargs)
endpoint_name = "/any-documents/"
return self.client._request("GET", endpoint_name, {}, query_params)
get_bank_statement
def get_bank_statement(
self,
document_id: int,
**kwargs
) -> Dict
Get bank statement endpoint allows you to retrieve a previously processed bank statement.
https://docs.veryfi.com/api/bank-statements/get-a-bank-statement/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | The unique identifier of the document. | None |
kwargs | None | Additional query parameters. | None |
Returns:
Type | Description |
---|---|
None | Document Data |
View Source
def get_bank_statement(self, document_id: int, **kwargs) -> Dict:
"""
Get bank statement endpoint allows you to retrieve a previously processed bank statement.
https://docs.veryfi.com/api/bank-statements/get-a-bank-statement/
:param document_id: The unique identifier of the document.
:param kwargs: Additional query parameters.
:return: Document Data
"""
endpoint_name = f"/bank-statements/{document_id}/"
return self.client._request("GET", endpoint_name, {}, kwargs)
get_bank_statements
def get_bank_statements(
self,
created_date__gt: Optional[str] = None,
created_date__gte: Optional[str] = None,
created_date__lt: Optional[str] = None,
created_date__lte: Optional[str] = None,
**kwargs
)
Get list of bank statement documents.
https://docs.veryfi.com/api/bank-statements/get-bank-statements/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
created_date__gt | None | Search for bank statement documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created__gt and created__gte in a single request. | None |
created_date__gte | None | Search for bank statement documents with a created date greater than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created__gt and created__gte in a single request. | None |
created_date__lt | None | Search for bank statement documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created__lt and created__lte in a single request. | None |
created_date__lte | None | Search for bank statement documents with a created date less than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created__lt and created__lte in a single request. | None |
kwargs | None | Additional query parameters. | None |
Returns:
Type | Description |
---|---|
None | List of previously processed documents |
View Source
def get_bank_statements(
self,
created_date__gt: Optional[str] = None,
created_date__gte: Optional[str] = None,
created_date__lt: Optional[str] = None,
created_date__lte: Optional[str] = None,
**kwargs,
):
"""
Get list of bank statement documents.
https://docs.veryfi.com/api/bank-statements/get-bank-statements/
:param created_date__gt: Search for bank statement documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created__gt and created__gte in a single request.
:param created_date__gte: Search for bank statement documents with a created date greater than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created__gt and created__gte in a single request.
:param created_date__lt: Search for bank statement documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created__lt and created__lte in a single request.
:param created_date__lte: Search for bank statement documents with a created date less than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created__lt and created__lte in a single request.
:param kwargs: Additional query parameters.
:return: List of previously processed documents
"""
query_params = {}
if created_date__gt:
query_params["created_date__gt"] = created_date__gt
if created_date__gte:
query_params["created_date__gte"] = created_date__gte
if created_date__lt:
query_params["created_date__lt"] = created_date__lt
if created_date__lte:
query_params["created_date__lte"] = created_date__lte
query_params.update(kwargs)
endpoint_name = "/bank-statements/"
return self.client._request("GET", endpoint_name, {}, query_params)
get_business_card
def get_business_card(
self,
document_id: int,
**kwargs
) -> Dict
Get a business card document.
https://docs.veryfi.com/api/business-cards/get-a-business-card/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | The unique identifier of the document. | None |
kwargs | None | Additional query parameters | None |
View Source
def get_business_card(self, document_id: int, **kwargs) -> Dict:
"""
Get a business card document.
https://docs.veryfi.com/api/business-cards/get-a-business-card/
:param document_id: The unique identifier of the document.
:param kwargs: Additional query parameters
"""
endpoint_name = f"/business-cards/{document_id}/"
return self.client._request("GET", endpoint_name, {}, kwargs)
get_business_cards
def get_business_cards(
self,
**kwargs
)
Get list of business card documents.
https://docs.veryfi.com/api/business-cards/get-business-cards/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kwargs | None | Additional query parameters | None |
Returns:
Type | Description |
---|---|
None | List of previously processed documents |
View Source
def get_business_cards(self, **kwargs):
"""
Get list of business card documents.
https://docs.veryfi.com/api/business-cards/get-business-cards/
:param kwargs: Additional query parameters
:return: List of previously processed documents
"""
endpoint_name = "/business-cards/"
return self.client._request("GET", endpoint_name, {}, kwargs)
get_check
def get_check(
self,
document_id: int,
**kwargs
) -> Dict
Retrieve a check document by ID
https://docs.veryfi.com/api/checks/get-a-check/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to retrieve | None |
kwargs | None | Additional query parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the Document |
View Source
def get_check(self, document_id: int, **kwargs) -> Dict:
"""
Retrieve a check document by ID
https://docs.veryfi.com/api/checks/get-a-check/
:param document_id: ID of the document you'd like to retrieve
:param kwargs: Additional query parameters
:return: Data extracted from the Document
"""
endpoint_name = f"/checks/{document_id}/"
return self.client._request("GET", endpoint_name, {}, kwargs)
get_checks
def get_checks(
self,
created_date__gt: Optional[str] = None,
created_date__gte: Optional[str] = None,
created_date__lt: Optional[str] = None,
created_date__lte: Optional[str] = None,
**kwargs
)
Get list of checks
https://docs.veryfi.com/api/checks/get-checks/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
created_date__gt | None | Search for checks documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request. | None |
created_date__gte | None | Search for checks documents with a created date greater than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request. | None |
created_date__lt | None | Search for checks documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request. | None |
created_date__lte | None | Search for checks documents with a created date less than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request. | None |
kwargs | None | Additional query parameters | None |
Returns:
Type | Description |
---|---|
None | List of previously processed documents |
View Source
def get_checks(
self,
created_date__gt: Optional[str] = None,
created_date__gte: Optional[str] = None,
created_date__lt: Optional[str] = None,
created_date__lte: Optional[str] = None,
**kwargs,
):
"""
Get list of checks
https://docs.veryfi.com/api/checks/get-checks/
:param created_date__gt: Search for checks documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request.
:param created_date__gte: Search for checks documents with a created date greater than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request.
:param created_date__lt: Search for checks documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request.
:param created_date__lte: Search for checks documents with a created date less than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request.
:param kwargs: Additional query parameters
:return: List of previously processed documents
"""
query_params = {}
if created_date__gt:
query_params["created_date__gt"] = created_date__gt
if created_date__gte:
query_params["created_date__gte"] = created_date__gte
if created_date__lt:
query_params["created_date__lt"] = created_date__lt
if created_date__lte:
query_params["created_date__lte"] = created_date__lte
query_params.update(kwargs)
endpoint_name = "/checks/"
return self.client._request("GET", endpoint_name, {}, query_params)
get_document
def get_document(
self,
document_id: int,
**kwargs
) -> Dict
Retrieve document by ID
https://docs.veryfi.com/api/receipts-invoices/get-a-document/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to retrieve | None |
kwargs | None | Additional query parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the Document |
View Source
def get_document(self, document_id: int, **kwargs) -> Dict:
"""
Retrieve document by ID
https://docs.veryfi.com/api/receipts-invoices/get-a-document/
:param document_id: ID of the document you'd like to retrieve
:param kwargs: Additional query parameters
:return: Data extracted from the Document
"""
endpoint_name = f"/documents/{document_id}/"
return self.client._request("GET", endpoint_name, {}, kwargs)
get_documents
def get_documents(
self,
q: Optional[str] = None,
external_id: Optional[str] = None,
tag: Optional[str] = None,
created_gt: Optional[str] = None,
created_gte: Optional[str] = None,
created_lt: Optional[str] = None,
created_lte: Optional[str] = None,
**kwargs
) -> Dict
Get list of documents.
https://docs.veryfi.com/api/receipts-invoices/search-documents/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
q | None | Search query | None |
external_id | None | Search by external ID | None |
tag | None | Search by tag | None |
created_gt | None | Search by created date greater than | None |
created_gte | None | Search by created date greater than or equal to | None |
created_lt | None | Search by created date less than | None |
created_lte | None | Search by created date less than or equal to | None |
kwargs | None | Additional query parameters | None |
Returns:
Type | Description |
---|---|
None | List of previously processed documents |
View Source
def get_documents(
self,
q: Optional[str] = None,
external_id: Optional[str] = None,
tag: Optional[str] = None,
created_gt: Optional[str] = None,
created_gte: Optional[str] = None,
created_lt: Optional[str] = None,
created_lte: Optional[str] = None,
**kwargs,
) -> Dict:
"""
Get list of documents.
https://docs.veryfi.com/api/receipts-invoices/search-documents/
:param q: Search query
:param external_id: Search by external ID
:param tag: Search by tag
:param created_gt: Search by created date greater than
:param created_gte: Search by created date greater than or equal to
:param created_lt: Search by created date less than
:param created_lte: Search by created date less than or equal to
:param kwargs: Additional query parameters
:return: List of previously processed documents
"""
query_params = {}
if q:
query_params["q"] = q
if external_id:
query_params["external_id"] = external_id
if tag:
query_params["tag"] = tag
if created_gt:
query_params["created__gt"] = created_gt
if created_gte:
query_params["created__gte"] = created_gte
if created_lt:
query_params["created__lt"] = created_lt
if created_lte:
query_params["created__lte"] = created_lte
query_params.update(kwargs)
endpoint_name = "/documents/"
return self.client._request("GET", endpoint_name, {}, query_params)
get_documents_from_pdf
def get_documents_from_pdf(
self,
document_id: int
)
Get Documents from PDF endpoint allows you to retrieve a collection of previously processed documents.
https://docs.veryfi.com/api/receipts-invoices/get-documents-from-pdf/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to retrieve | None |
Returns:
Type | Description |
---|---|
None | The processed Document response. |
View Source
def get_documents_from_pdf(self, document_id: int):
"""
Get Documents from PDF endpoint allows you to retrieve a collection of previously processed documents.
https://docs.veryfi.com/api/receipts-invoices/get-documents-from-pdf/
:param document_id: ID of the document you'd like to retrieve
:return: The processed Document response.
"""
endpoint_name = f"/documents-set/{document_id}"
return self.client._request("GET", endpoint_name, {})
get_documents_from_w2
def get_documents_from_w2(
self,
document_id: int
) -> Dict
Veryfi's Get Documents from W-2 endpoint allows you to retrieve a collection of previously processed W-2s.
https://docs.veryfi.com/api/get-documents-from-w-2/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | The unique identifier of the document. | None |
Returns:
Type | Description |
---|---|
None | Document Response |
View Source
def get_documents_from_w2(self, document_id: int) -> Dict:
"""
Veryfi's Get Documents from W-2 endpoint allows you to retrieve a collection of previously processed W-2s.
https://docs.veryfi.com/api/get-documents-from-w-2/
:param document_id: The unique identifier of the document.
:return: Document Response
"""
endpoint_name = f"/w2s-set/{document_id}/"
return self.client._request("GET", endpoint_name, {})
get_line_item
def get_line_item(
self,
document_id: int,
line_item_id: int
)
Retrieve a line item for existing document by ID.
https://docs.veryfi.com/api/receipts-invoices/get-a-line-item/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to retrieve | None |
line_item_id | None | ID of the line item you'd like to retrieve | None |
Returns:
Type | Description |
---|---|
None | Line item extracted from the document |
View Source
def get_line_item(self, document_id: int, line_item_id: int):
"""
Retrieve a line item for existing document by ID.
https://docs.veryfi.com/api/receipts-invoices/get-a-line-item/
:param document_id: ID of the document you'd like to retrieve
:param line_item_id: ID of the line item you'd like to retrieve
:return: Line item extracted from the document
"""
return self.client._request("GET", f"/documents/{document_id}/line-items/{line_item_id}")
get_line_items
def get_line_items(
self,
document_id: int
)
Retrieve all line items for a document.
https://docs.veryfi.com/api/receipts-invoices/get-document-line-items/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to retrieve | None |
Returns:
Type | Description |
---|---|
None | List of line items extracted from the document |
View Source
def get_line_items(self, document_id: int):
"""
Retrieve all line items for a document.
https://docs.veryfi.com/api/receipts-invoices/get-document-line-items/
:param document_id: ID of the document you'd like to retrieve
:return: List of line items extracted from the document
"""
return self.client._request("GET", f"/documents/{document_id}/line-items/")
get_list_of_w2s
def get_list_of_w2s(
self,
**kwargs
) -> Dict
Veryfi's Get List of W-2s endpoint allows you to retrieve a collection of previously processed W-2s.
https://docs.veryfi.com/api/get-list-of-documents-from-w-2/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kwargs | None | Query parameters | None |
Returns:
Type | Description |
---|---|
None | List of W-2s |
View Source
def get_list_of_w2s(self, **kwargs) -> Dict:
"""
Veryfi's Get List of W-2s endpoint allows you to retrieve a collection of previously processed W-2s.
https://docs.veryfi.com/api/get-list-of-documents-from-w-2/
:param kwargs: Query parameters
:return: List of W-2s
"""
endpoint_name = "/w2s-set/"
return self.client._request("GET", endpoint_name, {}, kwargs)
get_pdf
def get_pdf(
self,
**kwargs
)
Get a Submitted PDF endpoint allows you to retrieve a collection of previously processed.
https://docs.veryfi.com/api/receipts-invoices/get-submitted-pdf/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kwargs | None | Additional query parameters. | None |
Returns:
Type | Description |
---|---|
None | The processed Document response. |
View Source
def get_pdf(self, **kwargs):
"""
Get a Submitted PDF endpoint allows you to retrieve a collection of previously processed.
https://docs.veryfi.com/api/receipts-invoices/get-submitted-pdf/
:param kwargs: Additional query parameters.
:return: The processed Document response.
"""
endpoint_name = "/documents-set/"
return self.client._request("GET", endpoint_name, {}, kwargs)
get_tags
def get_tags(
self,
document_id
)
Return all Tag assigned to a specific Document.
https://docs.veryfi.com/api/receipts-invoices/get-document-tags/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to get | None |
Returns:
Type | Description |
---|---|
None | Added tags data |
View Source
def get_tags(self, document_id):
"""
Return all Tag assigned to a specific Document.
https://docs.veryfi.com/api/receipts-invoices/get-document-tags/
:param document_id: ID of the document you'd like to get
:return: Added tags data
"""
endpoint_name = f"/documents/{document_id}/tags"
return self.client._request("GET", endpoint_name, {})
get_w2
def get_w2(
self,
document_id: int,
**kwargs
) -> Dict
Get W-2 endpoint allows you to retrieve a previously processed W-2
https://docs.veryfi.com/api/w2s/get-a-w-2/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | The unique identifier of the document. | None |
kwargs | None | Additional query parameters | None |
Returns:
Type | Description |
---|---|
None | Document Data |
View Source
def get_w2(self, document_id: int, **kwargs) -> Dict:
"""
Get W-2 endpoint allows you to retrieve a previously processed W-2
https://docs.veryfi.com/api/w2s/get-a-w-2/
:param document_id: The unique identifier of the document.
:param kwargs: Additional query parameters
:return: Document Data
"""
endpoint_name = f"/w2s/{document_id}/"
return self.client._request("GET", endpoint_name, {}, kwargs)
get_w2s
def get_w2s(
self,
created_date_gt: Optional[str] = None,
created_date_gte: Optional[str] = None,
created_date_lt: Optional[str] = None,
created_date_lte: Optional[str] = None,
**kwargs: Dict
)
Get list of w2s documents.
https://docs.veryfi.com/api/w2s/get-w-2-s/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
created_date__gt | None | Search for w2s documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request. | None |
created_date__gte | None | Search for w2s documents with a created date greater than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request. | None |
created_date__lt | None | Search for w2s documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request. | None |
created_date__lte | None | Search for w2s documents with a created date less than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request. | None |
kwargs | None | Additional query parameters | None |
Returns:
Type | Description |
---|---|
None | List of previously processed documents |
View Source
def get_w2s(
self,
created_date_gt: Optional[str] = None,
created_date_gte: Optional[str] = None,
created_date_lt: Optional[str] = None,
created_date_lte: Optional[str] = None,
**kwargs: Dict,
):
"""
Get list of w2s documents.
https://docs.veryfi.com/api/w2s/get-w-2-s/
:param created_date__gt: Search for w2s documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request.
:param created_date__gte: Search for w2s documents with a created date greater than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request.
:param created_date__lt: Search for w2s documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request.
:param created_date__lte: Search for w2s documents with a created date less than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request.
:param kwargs: Additional query parameters
:return: List of previously processed documents
"""
query_params = {}
if created_date_gt:
query_params["created_date__gt"] = created_date_gt
if created_date_gte:
query_params["created_date__gte"] = created_date_gte
if created_date_lt:
query_params["created_date__lt"] = created_date_lt
if created_date_lte:
query_params["created_date__lte"] = created_date_lte
query_params.update(kwargs)
endpoint_name = "/w2s/"
return self.client._request("GET", endpoint_name, {}, query_params)
get_w8
def get_w8(
self,
document_id: int,
**kwargs
) -> Dict
Get W-8 endpoint allows you to retrieve a previously processed W-8
https://docs.veryfi.com/api/w-8ben-e/get-a-w-8-ben-e/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | The unique identifier of the document. | None |
kwargs | None | Additional query parameters | None |
Returns:
Type | Description |
---|---|
None | Document Data |
View Source
def get_w8(self, document_id: int, **kwargs) -> Dict:
"""
Get W-8 endpoint allows you to retrieve a previously processed W-8
https://docs.veryfi.com/api/w-8ben-e/get-a-w-8-ben-e/
:param document_id: The unique identifier of the document.
:param kwargs: Additional query parameters
:return: Document Data
"""
endpoint_name = f"/w-8ben-e/{document_id}/"
return self.client._request("GET", endpoint_name, {}, kwargs)
get_w8s
def get_w8s(
self,
created_date_gt: Optional[str] = None,
created_date_gte: Optional[str] = None,
created_date_lt: Optional[str] = None,
created_date_lte: Optional[str] = None,
**kwargs
)
Get list of w8s documents
https://docs.veryfi.com/api/w-8ben-e/get-w-8-ben-es/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
created_date__gt | None | Search for w8s documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request. | None |
created_date__gte | None | Search for w8s documents with a created date greater than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request. | None |
created_date__lt | None | Search for w8s documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request. | None |
created_date__lte | None | Search for w8s documents with a created date less than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request. | None |
kwargs | None | Additional query parameters | None |
Returns:
Type | Description |
---|---|
None | List of previously processed documents |
View Source
def get_w8s(
self,
created_date_gt: Optional[str] = None,
created_date_gte: Optional[str] = None,
created_date_lt: Optional[str] = None,
created_date_lte: Optional[str] = None,
**kwargs,
):
"""
Get list of w8s documents
https://docs.veryfi.com/api/w-8ben-e/get-w-8-ben-es/
:param created_date__gt: Search for w8s documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request.
:param created_date__gte: Search for w8s documents with a created date greater than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request.
:param created_date__lt: Search for w8s documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request.
:param created_date__lte: Search for w8s documents with a created date less than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request.
:param kwargs: Additional query parameters
:return: List of previously processed documents
"""
query_params = {}
if created_date_gt:
query_params["created_date__gt"] = created_date_gt
if created_date_gte:
query_params["created_date__gte"] = created_date_gte
if created_date_lt:
query_params["created_date__lt"] = created_date_lt
if created_date_lte:
query_params["created_date__lte"] = created_date_lte
query_params.update(kwargs)
endpoint_name = "/w-8ben-e/"
return self.client._request("GET", endpoint_name, {}, query_params)
get_w9
def get_w9(
self,
document_id: int,
**kwargs
) -> Dict
Get a W-9 endpoint allows you to retrieve a previously processed W-9
https://docs.veryfi.com/api/w9s/get-a-w-9/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | The unique identifier of the document. | None |
bounding_boxes | None | A field used to determine whether or not to return bounding_box and bounding_region for extracted fields in the Document response. | None |
confidence_details | None | A field used to determine whether or not to return the score and ocr_score fields in the Document response. | None |
Returns:
Type | Description |
---|---|
None | Document Data |
View Source
def get_w9(self, document_id: int, **kwargs) -> Dict:
"""
Get a W-9 endpoint allows you to retrieve a previously processed W-9
https://docs.veryfi.com/api/w9s/get-a-w-9/
:param document_id: The unique identifier of the document.
:param bounding_boxes: A field used to determine whether or not to return bounding_box and bounding_region for extracted fields in the Document response.
:param confidence_details: A field used to determine whether or not to return the score and ocr_score fields in the Document response.
:return: Document Data
"""
endpoint_name = f"/w9s/{document_id}/"
return self.client._request("GET", endpoint_name, {}, kwargs)
get_w9s
def get_w9s(
self,
created_date_gt: Optional[str] = None,
created_date_gte: Optional[str] = None,
created_date_lt: Optional[str] = None,
created_date_lte: Optional[str] = None,
**kwargs
)
Get list of w9s documents
https://docs.veryfi.com/api/w9s/get-w-9-s/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
created_date__gt | None | Search for w9s documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request. | None |
created_date__gte | None | Search for w9s documents with a created date greater than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request. | None |
created_date__lt | None | Search for w9s documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request. | None |
created_date__lte | None | Search for w9s documents with a created date less than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request. | None |
kwargs | None | Additional request parameters | None |
Returns:
Type | Description |
---|---|
None | List of previously processed documents |
View Source
def get_w9s(
self,
created_date_gt: Optional[str] = None,
created_date_gte: Optional[str] = None,
created_date_lt: Optional[str] = None,
created_date_lte: Optional[str] = None,
**kwargs,
):
"""
Get list of w9s documents
https://docs.veryfi.com/api/w9s/get-w-9-s/
:param created_date__gt: Search for w9s documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request.
:param created_date__gte: Search for w9s documents with a created date greater than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__gt and created_date__gte in a single request.
:param created_date__lt: Search for w9s documents with a created date greater than this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request.
:param created_date__lte: Search for w9s documents with a created date less than or equal to this one. Format YYYY-MM-DD+HH:MM:SS. Don't send both created_date__lt and created_date__lte in a single request.
:param kwargs: Additional request parameters
:return: List of previously processed documents
"""
query_params = {}
if created_date_gt:
query_params["created_date__gt"] = created_date_gt
if created_date_gte:
query_params["created_date__gte"] = created_date_gte
if created_date_lt:
query_params["created_date__lt"] = created_date_lt
if created_date_lte:
query_params["created_date__lte"] = created_date_lte
query_params.update(kwargs)
endpoint_name = "/w9s/"
return self.client._request("GET", endpoint_name, {}, query_params)
process_any_document
def process_any_document(
self,
blueprint_name: str,
file_path: str,
file_name: Optional[str] = None,
**kwargs
) -> Dict
Process Any Document from url and extract all the fields from it.
https://docs.veryfi.com/api/anydocs/process-A-doc/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
blueprint_name | None | The blueprint name which was used to extract the data. Same as blueprint_name. | None |
file_path | None | Path on disk to a file to submit for data extraction | None |
file_name | None | Optional name of file, eg. receipt.jpg | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document. |
View Source
def process_any_document(
self, blueprint_name: str, file_path: str, file_name: Optional[str] = None, **kwargs
) -> Dict:
"""
Process Any Document from url and extract all the fields from it.
https://docs.veryfi.com/api/anydocs/process-A-doc/
:param blueprint_name: The blueprint name which was used to extract the data. Same as blueprint_name.
:param file_path: Path on disk to a file to submit for data extraction
:param file_name: Optional name of file, eg. receipt.jpg
:param kwargs: Additional body parameters
:return: Data extracted from the document.
"""
endpoint_name = "/any-documents/"
if file_name is None:
file_name = os.path.basename(file_path)
with open(file_path, "rb") as image_file:
base64_encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
request_arguments = {
"blueprint_name": blueprint_name,
"file_name": file_name,
"file_data": base64_encoded_string,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_any_document_url
def process_any_document_url(
self,
blueprint_name: str,
file_url: str,
file_name: Optional[str] = None,
**kwargs
) -> Dict
Process Any Document from url and extract all the fields from it.
https://docs.veryfi.com/api/anydocs/process-A-doc/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
blueprint_name | None | The blueprint name which was used to extract the data. Same as blueprint_name. | None |
file_url | None | Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg". | None |
file_name | None | Optional name of file, eg. receipt.jpg | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document. |
View Source
def process_any_document_url(
self, blueprint_name: str, file_url: str, file_name: Optional[str] = None, **kwargs
) -> Dict:
"""
Process Any Document from url and extract all the fields from it.
https://docs.veryfi.com/api/anydocs/process-A-doc/
:param blueprint_name: The blueprint name which was used to extract the data. Same as blueprint_name.
:param file_url: Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".
:param file_name: Optional name of file, eg. receipt.jpg
:param kwargs: Additional body parameters
:return: Data extracted from the document.
"""
if file_name is None:
file_name = os.path.basename(file_url)
endpoint_name = "/any-documents/"
request_arguments = {
"blueprint_name": blueprint_name,
"file_name": file_name,
"file_url": file_url,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_bank_statement_document
def process_bank_statement_document(
self,
file_path: str,
file_name: Optional[str] = None,
**kwargs
) -> Dict
Process bank statement document from url and extract all the fields from it.
https://docs.veryfi.com/api/bank-statements/process-a-bank-statement/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path | None | Path on disk to a file to submit for data extraction | None |
file_name | None | Optional name of file, eg. receipt.jpg | None |
kwargs | None | Additional body parameters. | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the bank statement. |
View Source
def process_bank_statement_document(
self, file_path: str, file_name: Optional[str] = None, **kwargs
) -> Dict:
"""
Process bank statement document from url and extract all the fields from it.
https://docs.veryfi.com/api/bank-statements/process-a-bank-statement/
:param file_path: Path on disk to a file to submit for data extraction
:param file_name: Optional name of file, eg. receipt.jpg
:param kwargs: Additional body parameters.
:return: Data extracted from the bank statement.
"""
endpoint_name = "/bank-statements/"
if file_name is None:
file_name = os.path.basename(file_path)
with open(file_path, "rb") as image_file:
base64_encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
request_arguments = {
"file_name": file_name,
"file_data": base64_encoded_string,
}
request_arguments.update(kwargs)
document = self.client._request("POST", endpoint_name, request_arguments)
return document
process_bank_statement_document_url
def process_bank_statement_document_url(
self,
file_url: str,
file_name: Optional[str] = None,
**kwargs
) -> Dict
Process bank statement document from url and extract all the fields from it.
https://docs.veryfi.com/api/bank-statements/process-a-bank-statement/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_url | None | Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg". | None |
file_name | None | Optional name of file, eg. receipt.jpg | None |
kwargs | None | Additional body parameters. | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the bank statement. |
View Source
def process_bank_statement_document_url(
self, file_url: str, file_name: Optional[str] = None, **kwargs
) -> Dict:
"""
Process bank statement document from url and extract all the fields from it.
https://docs.veryfi.com/api/bank-statements/process-a-bank-statement/
:param file_url: Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".
:param file_name: Optional name of file, eg. receipt.jpg
:param kwargs: Additional body parameters.
:return: Data extracted from the bank statement.
"""
if file_name is None:
file_name = os.path.basename(file_url)
endpoint_name = "/bank-statements/"
request_arguments = {
"file_name": file_name,
"file_url": file_url,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_bussines_card_document
def process_bussines_card_document(
self,
file_path: str,
file_name: Optional[str] = None,
**kwargs
) -> Dict
Process bussiness card from url and extract all the fields from it.
https://docs.veryfi.com/api/business-cards/process-a-business-card/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path | None | Path on disk to a file to submit for data extraction | None |
file_name | None | Optional name of file, eg. receipt.jpg | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the business card. |
View Source
def process_bussines_card_document(
self, file_path: str, file_name: Optional[str] = None, **kwargs
) -> Dict:
"""
Process bussiness card from url and extract all the fields from it.
https://docs.veryfi.com/api/business-cards/process-a-business-card/
:param file_path: Path on disk to a file to submit for data extraction
:param file_name: Optional name of file, eg. receipt.jpg
:param kwargs: Additional body parameters
:return: Data extracted from the business card.
"""
endpoint_name = "/business-cards/"
if file_name is None:
file_name = os.path.basename(file_path)
with open(file_path, "rb") as image_file:
base64_encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
request_arguments = {
"file_name": file_name,
"file_data": base64_encoded_string,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_bussines_card_document_url
def process_bussines_card_document_url(
self,
file_url: str,
file_name: Optional[str] = None,
**kwargs
) -> Dict
Process bussiness card from url and extract all the fields from it.
https://docs.veryfi.com/api/business-cards/process-a-business-card/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_url | None | Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg". | None |
file_name | None | Optional name of file, eg. receipt.jpg | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the business card. |
View Source
def process_bussines_card_document_url(
self, file_url: str, file_name: Optional[str] = None, **kwargs
) -> Dict:
"""
Process bussiness card from url and extract all the fields from it.
https://docs.veryfi.com/api/business-cards/process-a-business-card/
:param file_url: Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".
:param file_name: Optional name of file, eg. receipt.jpg
:param kwargs: Additional body parameters
:return: Data extracted from the business card.
"""
if file_name is None:
file_name = os.path.basename(file_url)
endpoint_name = "/business-cards/"
request_arguments = {
"file_name": file_name,
"file_url": file_url,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_check
def process_check(
self,
file_path: str,
**kwargs
) -> Dict
Process a check document and extract all the fields from it
https://docs.veryfi.com/api/checks/process-a-check/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path | None | Path on disk to a file to submit for data extraction | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document |
View Source
def process_check(
self,
file_path: str,
**kwargs,
) -> Dict:
"""
Process a check document and extract all the fields from it
https://docs.veryfi.com/api/checks/process-a-check/
:param file_path: Path on disk to a file to submit for data extraction
:param kwargs: Additional body parameters
:return: Data extracted from the document
"""
endpoint_name = "/checks/"
file_name = os.path.basename(file_path)
with open(file_path, "rb") as image_file:
base64_encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
request_arguments = {
"file_name": file_name,
"file_data": base64_encoded_string,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_check_url
def process_check_url(
self,
file_url: Optional[str] = None,
file_urls: Optional[List[str]] = None,
**kwargs
) -> Dict
Process a check document from url and extract all the fields from it.
https://docs.veryfi.com/api/checks/process-a-check/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_url | None | Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg". | None |
file_urls | None | 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"] | None |
kwargs | None | Additional body parameters. | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document. |
View Source
def process_check_url(
self,
file_url: Optional[str] = None,
file_urls: Optional[List[str]] = None,
**kwargs,
) -> Dict:
"""
Process a check document from url and extract all the fields from it.
https://docs.veryfi.com/api/checks/process-a-check/
:param file_url: Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".
:param file_urls: 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"]
:param kwargs: Additional body parameters.
:return: Data extracted from the document.
"""
endpoint_name = "/checks/"
request_arguments = {
"file_url": file_url,
"file_urls": file_urls,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_check_with_remittance
def process_check_with_remittance(
self,
file_path: str,
**kwargs
) -> Dict
Process a check document with remittance and extract all the fields from it
https://docs.veryfi.com/api/checks/process-a-check-with-remittance/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path | None | Path on disk to a file to submit for data extraction | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document and check |
View Source
def process_check_with_remittance(self, file_path: str, **kwargs) -> Dict:
"""
Process a check document with remittance and extract all the fields from it
https://docs.veryfi.com/api/checks/process-a-check-with-remittance/
:param file_path: Path on disk to a file to submit for data extraction
:param kwargs: Additional body parameters
:return: Data extracted from the document and check
"""
endpoint_name = "/check-with-document/"
file_name = os.path.basename(file_path)
with open(file_path, "rb") as image_file:
base64_encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
request_arguments = {
"file_name": file_name,
"file_data": base64_encoded_string,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_check_with_remittance_url
def process_check_with_remittance_url(
self,
file_url: str,
file_urls: Optional[List[str]] = None,
**kwargs
) -> Dict
Process a check document with remittance from url and extract all the fields from it
https://docs.veryfi.com/api/checks/process-a-check-with-remittance/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_url | None | Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg". | None |
file_urls | None | Optional list of publicly accessible URLs to multiple files, e.g. ["https://cdn.example.com/receipt1.jpg", "https://cdn.example.com/receipt2.jpg"] | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document and check |
View Source
def process_check_with_remittance_url(
self,
file_url: str,
file_urls: Optional[List[str]] = None,
**kwargs,
) -> Dict:
"""
Process a check document with remittance from url and extract all the fields from it
https://docs.veryfi.com/api/checks/process-a-check-with-remittance/
:param file_url: Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".
:param file_urls: Optional list of publicly accessible URLs to multiple files, e.g. ["https://cdn.example.com/receipt1.jpg", "https://cdn.example.com/receipt2.jpg"]
:param kwargs: Additional body parameters
:return: Data extracted from the document and check
"""
endpoint_name = "/check-with-document/"
request_arguments = {
"file_url": file_url,
"file_urls": file_urls,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_document
def process_document(
self,
file_path: str,
categories: Optional[List] = None,
delete_after_processing: bool = False,
**kwargs
) -> Dict
Process a document and extract all the fields from it.
https://docs.veryfi.com/api/receipts-invoices/process-a-document/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path | None | Path on disk to a file to submit for data extraction | None |
categories | None | List of categories Veryfi can use to categorize the document | None |
delete_after_processing | None | Delete this document from Veryfi after data has been extracted | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document |
View Source
def process_document(
self,
file_path: str,
categories: Optional[List] = None,
delete_after_processing: bool = False,
**kwargs,
) -> Dict:
"""
Process a document and extract all the fields from it.
https://docs.veryfi.com/api/receipts-invoices/process-a-document/
:param file_path: Path on disk to a file to submit for data extraction
:param categories: List of categories Veryfi can use to categorize the document
:param delete_after_processing: Delete this document from Veryfi after data has been extracted
:param kwargs: Additional body parameters
:return: Data extracted from the document
"""
if not categories:
categories = self.DEFAULT_CATEGORIES
file_name = os.path.basename(file_path)
with open(file_path, "rb") as image_file:
base64_encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
request_arguments = {
"file_name": file_name,
"file_data": base64_encoded_string,
"categories": categories,
"auto_delete": delete_after_processing,
}
request_arguments.update(kwargs)
return self.client._request("POST", "/documents/", request_arguments)
process_document_url
def process_document_url(
self,
file_url: Optional[str] = None,
categories: Optional[List[str]] = None,
delete_after_processing: bool = False,
boost_mode: bool = False,
external_id: Optional[str] = None,
max_pages_to_process: Optional[int] = None,
file_urls: Optional[List[str]] = None,
**kwargs
) -> Dict
Process Document from url and extract all the fields from it.
https://docs.veryfi.com/api/receipts-invoices/process-a-document/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_url | None | Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg". | None |
file_urls | None | 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"] | None |
categories | None | List of categories to use when categorizing the document | None |
delete_after_processing | None | Delete this document from Veryfi after data has been extracted | None |
max_pages_to_process | None | 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. | None |
boost_mode | None | 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 | None |
external_id | None | Optional custom document identifier. Use this if you would like to assign your own ID to documents | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document. |
View Source
def process_document_url(
self,
file_url: Optional[str] = None,
categories: Optional[List[str]] = None,
delete_after_processing: bool = False,
boost_mode: bool = False,
external_id: Optional[str] = None,
max_pages_to_process: Optional[int] = None,
file_urls: Optional[List[str]] = None,
**kwargs,
) -> Dict:
"""Process Document from url and extract all the fields from it.
https://docs.veryfi.com/api/receipts-invoices/process-a-document/
:param file_url: Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".
:param file_urls: 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"]
:param categories: List of categories to use when categorizing the document
:param delete_after_processing: Delete this document from Veryfi after data has been extracted
:param max_pages_to_process: 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.
:param boost_mode: 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
:param external_id: Optional custom document identifier. Use this if you would like to assign your own ID to documents
:param kwargs: Additional body parameters
:return: Data extracted from the document.
"""
endpoint_name = "/documents/"
request_arguments = {
"auto_delete": delete_after_processing,
"boost_mode": boost_mode,
"categories": categories,
"external_id": external_id,
"file_url": file_url,
"file_urls": file_urls,
"max_pages_to_process": max_pages_to_process,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_documents_bulk
def process_documents_bulk(
self,
file_urls: List[str]
) -> List[int]
Process multiple documents from urls and extract all the fields from it.
If you want to use this endpoint, please contact support@veryfi.com first. Veryfi's Bulk upload allows you to process multiple Documents. https://docs.veryfi.com/api/receipts-invoices/bulk-process-multiple-documents/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_urls | None | List of publicly accessible URLs to multiple files, e.g. ["https://cdn.example.com/receipt1.jpg", "https://cdn.example.com/receipt2.jpg"] | None |
Returns:
Type | Description |
---|---|
None | List of document IDs being processed |
View Source
def process_documents_bulk(self, file_urls: List[str]) -> List[int]:
"""
Process multiple documents from urls and extract all the fields from it.
If you want to use this endpoint, please contact support@veryfi.com first. Veryfi's Bulk upload allows you to process multiple Documents.
https://docs.veryfi.com/api/receipts-invoices/bulk-process-multiple-documents/
:param file_urls: List of publicly accessible URLs to multiple files, e.g. ["https://cdn.example.com/receipt1.jpg", "https://cdn.example.com/receipt2.jpg"]
:return: List of document IDs being processed
"""
endpoint_name = "/documents/bulk/"
request_arguments = {"file_urls": file_urls}
return self.client._request("POST", endpoint_name, request_arguments)
process_w2_document
def process_w2_document(
self,
file_path: str,
file_name: Optional[str] = None,
**kwargs
) -> Dict
Process W2 Document from url and extract all the fields from it.
https://docs.veryfi.com/api/w2s/process-a-w-2/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path | None | Path on disk to a file to submit for data extraction | None |
file_name | None | Optional name of file, eg. receipt.jpg | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the w2. |
View Source
def process_w2_document(
self, file_path: str, file_name: Optional[str] = None, **kwargs
) -> Dict:
"""
Process W2 Document from url and extract all the fields from it.
https://docs.veryfi.com/api/w2s/process-a-w-2/
:param file_path: Path on disk to a file to submit for data extraction
:param file_name: Optional name of file, eg. receipt.jpg
:param kwargs: Additional body parameters
:return: Data extracted from the w2.
"""
endpoint_name = "/w2s/"
if file_name is None:
file_name = os.path.basename(file_path)
with open(file_path, "rb") as image_file:
base64_encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
request_arguments = {
"file_name": file_name,
"file_data": base64_encoded_string,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_w2_document_url
def process_w2_document_url(
self,
file_url: str,
file_name: Optional[str] = None,
**kwargs
) -> Dict
Process W2 Document from url and extract all the fields from it.
https://docs.veryfi.com/api/w2s/process-a-w-2/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_url | None | Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg". | None |
file_name | None | Optional name of file, eg. receipt.jpg | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the w2. |
View Source
def process_w2_document_url(
self, file_url: str, file_name: Optional[str] = None, **kwargs
) -> Dict:
"""
Process W2 Document from url and extract all the fields from it.
https://docs.veryfi.com/api/w2s/process-a-w-2/
:param file_url: Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".
:param file_name: Optional name of file, eg. receipt.jpg
:param kwargs: Additional body parameters
:return: Data extracted from the w2.
"""
if file_name is None:
file_name = os.path.basename(file_url)
endpoint_name = "/w2s/"
request_arguments = {
"file_name": file_name,
"file_url": file_url,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_w8_document
def process_w8_document(
self,
file_path: str,
file_name: Optional[str] = None,
**kwargs
) -> Dict
Process W8 Document from url and extract all the fields from it.
https://docs.veryfi.com/api/w-8ben-e/process-a-w-8-ben-e/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path | None | Path on disk to a file to submit for data extraction | None |
file_name | None | Optional name of file, eg. receipt.jpg | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the w8. |
View Source
def process_w8_document(
self, file_path: str, file_name: Optional[str] = None, **kwargs
) -> Dict:
"""
Process W8 Document from url and extract all the fields from it.
https://docs.veryfi.com/api/w-8ben-e/process-a-w-8-ben-e/
:param file_path: Path on disk to a file to submit for data extraction
:param file_name: Optional name of file, eg. receipt.jpg
:param kwargs: Additional body parameters
:return: Data extracted from the w8.
"""
endpoint_name = "/w-8ben-e/"
if file_name is None:
file_name = os.path.basename(file_path)
with open(file_path, "rb") as image_file:
base64_encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
request_arguments = {
"file_name": file_name,
"file_data": base64_encoded_string,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_w8_document_url
def process_w8_document_url(
self,
file_url: str,
file_name: Optional[str] = None,
**kwargs
) -> Dict
Process W2 Document from url and extract all the fields from it.
https://docs.veryfi.com/api/w-8ben-e/process-a-w-8-ben-e/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_url | None | Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg". | None |
file_name | None | Optional name of file, eg. receipt.jpg | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the w8. |
View Source
def process_w8_document_url(
self, file_url: str, file_name: Optional[str] = None, **kwargs
) -> Dict:
"""
Process W2 Document from url and extract all the fields from it.
https://docs.veryfi.com/api/w-8ben-e/process-a-w-8-ben-e/
:param file_url: Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".
:param file_name: Optional name of file, eg. receipt.jpg
:param kwargs: Additional body parameters
:return: Data extracted from the w8.
"""
if file_name is None:
file_name = os.path.basename(file_url)
endpoint_name = "/w-8ben-e/"
request_arguments = {
"file_name": file_name,
"file_url": file_url,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_w9_document
def process_w9_document(
self,
file_path: str,
file_name: Optional[str] = None,
**kwargs
) -> Dict
Process W9 Document from url and extract all the fields from it.
https://docs.veryfi.com/api/w9s/process-a-w-9/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path | None | Path on disk to a file to submit for data extraction | None |
file_name | None | Optional name of file, eg. receipt.jpg | None |
kwargs | None | Additional request parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document. |
View Source
def process_w9_document(
self, file_path: str, file_name: Optional[str] = None, **kwargs
) -> Dict:
"""
Process W9 Document from url and extract all the fields from it.
https://docs.veryfi.com/api/w9s/process-a-w-9/
:param file_path: Path on disk to a file to submit for data extraction
:param file_name: Optional name of file, eg. receipt.jpg
:param kwargs: Additional request parameters
:return: Data extracted from the document.
"""
endpoint_name = "/w9s/"
if file_name is None:
file_name = os.path.basename(file_path)
with open(file_path, "rb") as image_file:
base64_encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
request_arguments = {
"file_name": file_name,
"file_data": base64_encoded_string,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
process_w9_document_url
def process_w9_document_url(
self,
file_url: str,
file_name: Optional[str] = None,
**kwargs
) -> Dict
Process W9 Document from url and extract all the fields from it.
https://docs.veryfi.com/api/w9s/process-a-w-9/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_url | None | Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg". | None |
file_name | None | Optional name of file, eg. receipt.jpg | None |
kwargs | None | Additional request parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document. |
View Source
def process_w9_document_url(
self, file_url: str, file_name: Optional[str] = None, **kwargs
) -> Dict:
"""
Process W9 Document from url and extract all the fields from it.
https://docs.veryfi.com/api/w9s/process-a-w-9/
:param file_url: Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".
:param file_name: Optional name of file, eg. receipt.jpg
:param kwargs: Additional request parameters
:return: Data extracted from the document.
"""
if file_name is None:
file_name = os.path.basename(file_url)
endpoint_name = "/w9s/"
request_arguments = {
"file_name": file_name,
"file_url": file_url,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
replace_tags
def replace_tags(
self,
document_id,
tags
)
Replace multiple tags on an existing document.
https://docs.veryfi.com/api/receipts-invoices/update-a-document/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to update | None |
tags | None | array of strings | None |
Returns:
Type | Description |
---|---|
None | Added tags data |
View Source
def replace_tags(self, document_id, tags):
"""
Replace multiple tags on an existing document.
https://docs.veryfi.com/api/receipts-invoices/update-a-document/
:param document_id: ID of the document you'd like to update
:param tags: array of strings
:return: Added tags data
"""
endpoint_name = f"/documents/{document_id}/"
request_arguments = {"tags": tags}
return self.client._request("PUT", endpoint_name, request_arguments)
split_and_process_pdf
def split_and_process_pdf(
self,
file_path: str,
categories: Optional[List] = None,
**kwargs
) -> Dict
Process a document and extract all the fields from it
https://docs.veryfi.com/api/receipts-invoices/split-and-process-a-pdf/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path | None | Path on disk to a file to submit for data extraction | None |
categories | None | List of categories Veryfi can use to categorize the document | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document |
View Source
def split_and_process_pdf(
self,
file_path: str,
categories: Optional[List] = None,
**kwargs,
) -> Dict:
"""
Process a document and extract all the fields from it
https://docs.veryfi.com/api/receipts-invoices/split-and-process-a-pdf/
:param file_path: Path on disk to a file to submit for data extraction
:param categories: List of categories Veryfi can use to categorize the document
:param kwargs: Additional body parameters
:return: Data extracted from the document
"""
endpoint_name = "/documents-set/"
categories = categories or []
file_name = os.path.basename(file_path)
with open(file_path, "rb") as image_file:
base64_encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
request_arguments = {
"file_name": file_name,
"file_data": base64_encoded_string,
"categories": categories,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
split_and_process_pdf_url
def split_and_process_pdf_url(
self,
file_url: Optional[str] = None,
categories: Optional[List[str]] = None,
max_pages_to_process: Optional[int] = None,
file_urls: Optional[List[str]] = None,
**kwargs
) -> Dict
Process Document from url and extract all the fields from it.
https://docs.veryfi.com/api/receipts-invoices/split-and-process-a-pdf/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_url | None | Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg". | None |
file_urls | None | 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"] | None |
categories | None | List of categories to use when categorizing the document | None |
max_pages_to_process | None | 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. | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document. |
View Source
def split_and_process_pdf_url(
self,
file_url: Optional[str] = None,
categories: Optional[List[str]] = None,
max_pages_to_process: Optional[int] = None,
file_urls: Optional[List[str]] = None,
**kwargs,
) -> Dict:
"""Process Document from url and extract all the fields from it.
https://docs.veryfi.com/api/receipts-invoices/split-and-process-a-pdf/
:param file_url: Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".
:param file_urls: 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"]
:param categories: List of categories to use when categorizing the document
:param max_pages_to_process: 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.
:param kwargs: Additional body parameters
:return: Data extracted from the document.
"""
endpoint_name = "/documents-set/"
categories = categories or []
request_arguments = {
"categories": categories,
"file_url": file_url,
"file_urls": file_urls,
"max_pages_to_process": max_pages_to_process,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
split_and_process_w2
def split_and_process_w2(
self,
file_path: str,
**kwargs
) -> Dict
Process a document and extract all the fields from it
https://docs.veryfi.com/api/split-and-process-a-w-2/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path | None | Path on disk to a file to submit for data extraction | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document |
View Source
def split_and_process_w2(self, file_path: str, **kwargs) -> Dict:
"""
Process a document and extract all the fields from it
https://docs.veryfi.com/api/split-and-process-a-w-2/
:param file_path: Path on disk to a file to submit for data extraction
:param kwargs: Additional body parameters
:return: Data extracted from the document
"""
endpoint_name = "/w2s-set/"
file_name = os.path.basename(file_path)
with open(file_path, "rb") as image_file:
base64_encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
request_arguments = {
"file_name": file_name,
"file_data": base64_encoded_string,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
split_and_process_w2_url
def split_and_process_w2_url(
self,
file_url: Optional[str] = None,
file_urls: Optional[List[str]] = None,
max_pages_to_process: Optional[int] = None,
**kwargs
) -> Dict
Process Document from url and extract all the fields from it.
https://docs.veryfi.com/api/split-and-process-a-w-2/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_url | None | Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg". | None |
file_urls | None | 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"] | None |
max_pages_to_process | None | 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. | None |
kwargs | None | Additional body parameters | None |
Returns:
Type | Description |
---|---|
None | Data extracted from the document. |
View Source
def split_and_process_w2_url(
self,
file_url: Optional[str] = None,
file_urls: Optional[List[str]] = None,
max_pages_to_process: Optional[int] = None,
**kwargs,
) -> Dict:
"""Process Document from url and extract all the fields from it.
https://docs.veryfi.com/api/split-and-process-a-w-2/
:param file_url: Required if file_urls isn't specified. Publicly accessible URL to a file, e.g. "https://cdn.example.com/receipt.jpg".
:param file_urls: 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"]
:param max_pages_to_process: 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.
:param kwargs: Additional body parameters
:return: Data extracted from the document.
"""
endpoint_name = "/w2s-set/"
request_arguments = {
"file_url": file_url,
"file_urls": file_urls,
"max_pages_to_process": max_pages_to_process,
}
request_arguments.update(kwargs)
return self.client._request("POST", endpoint_name, request_arguments)
update_check
def update_check(
self,
document_id: int,
**kwargs
) -> Dict
Update data for a previously processed document, including almost any field like vendor
, date
, notes
and etc.
https://docs.veryfi.com/api/checks/update-a-check/
veryfi_client.update_check(id, date="2021-01-01", notes="look what I did")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to update | None |
kwargs | None | fields to update | None |
Returns:
Type | Description |
---|---|
None | A document json with updated fields, if fields are writable. Otherwise a document with unchanged fields. |
View Source
def update_check(self, document_id: int, **kwargs) -> Dict:
"""
Update data for a previously processed document, including almost any field like `vendor`, `date`, `notes` and etc.
https://docs.veryfi.com/api/checks/update-a-check/
```veryfi_client.update_check(id, date="2021-01-01", notes="look what I did")```
:param document_id: ID of the document you'd like to update
:param kwargs: fields to update
:return: A document json with updated fields, if fields are writable. Otherwise a document with unchanged fields.
"""
endpoint_name = f"/checks/{document_id}/"
return self.client._request("PUT", endpoint_name, kwargs)
update_document
def update_document(
self,
document_id: int,
**kwargs
) -> Dict
Update data for a previously processed document, including almost any field like vendor
, date
, notes
and etc.
https://docs.veryfi.com/api/receipts-invoices/update-a-document/
veryfi_client.update_document(id, date="2021-01-01", notes="look what I did")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to update | None |
kwargs | None | fields to update | None |
Returns:
Type | Description |
---|---|
None | A document json with updated fields, if fields are writable. Otherwise a document with unchanged fields. |
View Source
def update_document(self, document_id: int, **kwargs) -> Dict:
"""
Update data for a previously processed document, including almost any field like `vendor`, `date`, `notes` and etc.
https://docs.veryfi.com/api/receipts-invoices/update-a-document/
```veryfi_client.update_document(id, date="2021-01-01", notes="look what I did")```
:param document_id: ID of the document you'd like to update
:param kwargs: fields to update
:return: A document json with updated fields, if fields are writable. Otherwise a document with unchanged fields.
"""
return self.client._request("PUT", f"/documents/{document_id}/", kwargs)
update_line_item
def update_line_item(
self,
document_id: int,
line_item_id: int,
payload: Dict
) -> Dict
Update an existing line item on an existing document.
https://docs.veryfi.com/api/receipts-invoices/update-a-line-item/
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | None | ID of the document you'd like to update | None |
line_item_id | None | ID of the line item you'd like to update | None |
payload | None | line item object to update | None |
Returns:
Type | Description |
---|---|
None | Line item data with updated fields, if fields are writable. Otherwise line item data with unchanged fields. |
View Source
def update_line_item(self, document_id: int, line_item_id: int, payload: Dict) -> Dict:
"""
Update an existing line item on an existing document.
https://docs.veryfi.com/api/receipts-invoices/update-a-line-item/
:param document_id: ID of the document you'd like to update
:param line_item_id: ID of the line item you'd like to update
:param payload: line item object to update
:return: Line item data with updated fields, if fields are writable. Otherwise line item data with unchanged fields.
"""
return self.client._request(
"PUT", f"/documents/{document_id}/line-items/{line_item_id}", payload
)