Invoice V4
Sample Code:
#
# Install the Python client library by running:
# pip install mindee
#
from mindee import Client, product, AsyncPredictResponse
# Init a new client
mindee_client = Client(api_key="my-api-key")
# Load a file from disk
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")
# Load a file from disk and enqueue it.
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
product.InvoiceV4,
input_doc,
)
# Print a brief summary of the parsed data
print(result.document)
- class InvoiceV4(raw_prediction)
Invoice API version 4 inference prediction.
- Parameters:
raw_prediction (Dict[str, Any])
- static get_endpoint_info(klass)
Retrieves the endpoint information for an Inference.
Should never retrieve info for CustomV1, as a custom endpoint should be created to use CustomV1.
- Parameters:
klass (
Type[Inference]) – product subclass to access endpoint information.- Return type:
Dict[str,str]
- endpoint_name: Optional[str] = 'invoices'
Name of the endpoint.
- endpoint_version: Optional[str] = '4'
Version of the endpoint.
- extras: Optional[Extras] = None
Potential Extras fields sent back along with the prediction.
- is_rotation_applied: Optional[bool]
Whether the document has had any rotation applied to it.
- page_id: Optional[int]
Optional page id for page-level predictions.
-
pages:
List[Page[InvoiceV4Document]] Page-level prediction(s).
-
prediction:
InvoiceV4Document Document-level prediction.
- product: Product
Name and version of a given product, as sent back by the API.
- class InvoiceV4Document(raw_prediction, page_id=None)
Invoice API version 4.11 document data.
- Parameters:
raw_prediction (Dict[str, Any])
page_id (int | None)
-
billing_address:
AddressField The customer billing address.
-
category:
ClassificationField The purchase category.
-
customer_address:
AddressField The address of the customer.
-
customer_company_registrations:
List[CompanyRegistrationField] List of company registration numbers associated to the customer.
-
customer_id:
StringField The customer account number or identifier from the supplier.
-
customer_name:
StringField The name of the customer or client.
-
document_type:
ClassificationField Document type: INVOICE or CREDIT NOTE.
-
document_type_extended:
ClassificationField Document type extended.
-
invoice_number:
StringField The invoice number or identifier.
-
line_items:
List[InvoiceV4LineItem] List of all the line items present on the invoice.
-
locale:
LocaleField The locale of the document.
-
po_number:
StringField The purchase order number.
-
reference_numbers:
List[StringField] List of all reference numbers on the invoice, including the purchase order number.
-
shipping_address:
AddressField Customer’s delivery address.
-
subcategory:
ClassificationField The purchase subcategory for transport, food and shopping.
-
supplier_address:
AddressField The address of the supplier or merchant.
-
supplier_company_registrations:
List[CompanyRegistrationField] List of company registration numbers associated to the supplier.
-
supplier_email:
StringField The email address of the supplier or merchant.
-
supplier_name:
StringField The name of the supplier or merchant.
-
supplier_payment_details:
List[PaymentDetailsField] List of payment details associated to the supplier of the invoice.
-
supplier_phone_number:
StringField The phone number of the supplier or merchant.
-
supplier_website:
StringField The website URL of the supplier or merchant.
-
total_amount:
AmountField The total amount of the invoice: includes taxes, tips, fees, and other charges.
-
total_net:
AmountField The net amount of the invoice: does not include taxes, fees, and discounts.
-
total_tax:
AmountField The total tax: the sum of all the taxes for this invoice.
- class InvoiceV4LineItem(raw_prediction, page_id=None)
List of all the line items present on the invoice.
- Parameters:
raw_prediction (Dict[str, Any])
page_id (int | None)
- to_table_line()
Output in a format suitable for inclusion in an rST table.
- Return type:
str
- bounding_box: Optional[Quadrilateral]
A right rectangle containing the word in the document.
- confidence: float
The confidence score.
-
description:
Optional[str] The item description.
-
page_n:
int The document page on which the information was found.
- polygon: Polygon
A polygon containing the word in the document.
-
product_code:
Optional[str] The product code of the item.
-
quantity:
Optional[float] The item quantity
-
tax_amount:
Optional[float] The item tax amount.
-
tax_rate:
Optional[float] The item tax rate in percentage.
-
total_amount:
Optional[float] The item total amount.
-
unit_measure:
Optional[str] The item unit of measure.
-
unit_price:
Optional[float] The item unit price.