Invoice Splitter

The Ruby Client Library supports the Invoice Splitter API.

πŸ“

Product Specs

SpecificationDetails
Endpoint Nameinvoice_splitter
Recommended Versionv1.2
Supports Polling/Webhooksβœ”οΈ Yes
Support Synchronous HTTP Calls❌ No
Geography🌐 Global

πŸ”

Polling Limitations

SettingParameter nameDefault Value
Initial Delay Before Pollinginitial_delay_seconds2 seconds
Default Delay Between Callsdelay_sec1.5 seconds
Polling Attempts Before Timeoutmax_retries80 retries

Using this sample, we are going to illustrate detect the pages of multiple invoices within the same document using the
Ruby Client Library.

Quick-Start

require 'mindee'

# Init a new client
mindee_client = Mindee::Client.new(api_key: 'my-api-key')

# Load a file from disk
input_source = mindee_client.source_from_path('/path/to/the/file.ext')

result = mindee_client.parse(
  input_source,
  Mindee::Product::InvoiceSplitter::InvoiceSplitterV1
)

# Print a full summary of the parsed data in RST format
puts result.document

# Print the document-level parsed data
# puts result.document.inference.prediction

Output (RST):

########
Document
########
:Mindee ID: 15ad7a19-7b75-43d0-b0c6-9a641a12b49b
:Filename: default_sample.pdf

Inference
#########
:Product: mindee/invoice_splitter v1.1
:Rotation applied: No

Prediction
==========
:Invoice Page Groups:
  :Page indexes: 0
  :Page indexes: 1

Page Predictions
================

Page 0
------
:Invoice Page Groups:

Page 1
------
:Invoice Page Groups:

Field Types

Specific Fields

Invoice Splitter V1 Page Group

List of page group indexes.

An InvoiceSplitterV1PageGroup implements the following attributes:

  • page_indexes (Array<Integer>): List of indexes of the pages of a single invoice.
  • confidence (Float): The confidence of the prediction.

Attributes

The following fields are extracted for Invoice Splitter V1:

Invoice Page Groups

invoice_page_groups (Array<InvoiceSplitterV1PageGroup>): List of page indexes that belong to the same invoice in the PDF.

result.document.inference.prediction.invoice_page_groups.each do |invoice_page_groups_elem|
  puts invoice_page_groups_elem.page_indexes.join(', ')
end

Questions?

Join our Slack