Invoices API

The Node.js SDK supports the invoice API for extracting data from invoice.

const { Client } = require("mindee");

const mindeeClient = new Client({
  invoiceToken: "yourInvoiceToken"
});

mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
  console.log(res.invoice);
})
.catch((err) => {
  console.error(err);
});

📘

Info

You can also use an environment variable for the token

Client Invoice Parse Parameters

Parameter nameDescriptionDefault value
inputDocument object
inputTypepath: File path
stream: From file object
base64: From a base64 encoded file
path
cutPdf(Boolean) If set to true, when sending a multi pages PDF of more than 5 pages, the library create a new PDF by concatenating the first 4 pages and the last page.true
includeWords(Boolean) If set to true, the raw_http response will include all the words in the document associated to their positions.false
filename(String) Specify a filename of your input.undefined

Using this sample invoice below, we are going to illustrate how to extract the data that we want using the SDK.
sample invoicesample invoice

Invoice Data Structure

To access a invoice object, you need to create a mindee.Client and call the Client.receipt.parse method.

The invoice object JSON data structure consists of:

Document level prediction

For document level prediction, we construct the document class by combining the different pages in a single document. This method used for creating a single invoice object from multiple pages relies on field confidence scores.

Basically, we iterate over each page, and for each field, we keep the one that has the highest probability.

For example, if you send a three-page invoice, document level will provide you one tax, one total, and so on.

res.invoice

Code Example

mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
  console.log(res.invoice);
})
.catch((err) => {
  console.error(err);
});

Output

invoice {
  filepath: '/var/folders/cf/06c5ln2s71jdwhb2r1cb82yh0000gn/T/upload_bcacef3504bc9e51e6aa10f9bbe60ef6invoice.pdf',
  filename: 'upload_bcacef3504bc9e51e6aa10f9bbe60ef6invoice.pdf',
  fileExtension: 'application/pdf',
  checklist: {
    taxesMatchTotalIncl: true,
    taxesMatchTotalExcl: false,
    taxesPlusTotalExclMatchTotalIncl: false
  },
  words: [],
  locale: {
    pageNumber: 0,
    reconstructed: false,
    probability: 0,
    bbox: [],
    language: 'en',
    currency: 'CAD'
  },
  totalIncl: {
    pageNumber: 0,
    reconstructed: false,
    value: 2608.2,
    probability: 1,
    bbox: [ [Array], [Array], [Array], [Array] ]
  },
  totalTax: {
    pageNumber: 0,
    reconstructed: true,
    value: 193.2,
    probability: 1,
    bbox: []
  },
  totalExcl: {
    pageNumber: 0,
    reconstructed: true,
    value: 2415,
    probability: 1,
    bbox: []
  },
  date: {
    pageNumber: 0,
    reconstructed: false,
    value: '2018-09-25',
    probability: 0.99,
    bbox: [ [Array], [Array], [Array], [Array] ],
    dateObject: '2018-09-25T00:00:00.000Z'
  },
  invoiceDate: {
    pageNumber: 0,
    reconstructed: false,
    value: '2018-09-25',
    probability: 0.99,
    bbox: [ [Array], [Array], [Array], [Array] ],
    dateObject: '2018-09-25T00:00:00.000Z'
  },
  taxes: [
    {
      pageNumber: 0,
      reconstructed: false,
      value: 193.2,
      probability: 1,
      bbox: [Array],
      rate: 8
    }
  ],
  orientation: {
    pageNumber: 0,
    reconstructed: false,
    value: 0,
    probability: 0.99,
    bbox: []
  },
  companyNumber: [],
  dueDate: {
    pageNumber: 0,
    reconstructed: false,
    value: '2018-09-25',
    probability: 0.86,
    bbox: [ [Array], [Array], [Array], [Array] ],
    dateObject: '2018-09-25T00:00:00.000Z'
  },
  invoiceNumber: {
    pageNumber: 0,
    reconstructed: false,
    value: '14',
    probability: 0.99,
    bbox: [ [Array], [Array], [Array], [Array] ]
  },
  supplier: {
    pageNumber: 0,
    reconstructed: false,
    value: 'TURNPIKE DESIGNS CO',
    probability: 0.74,
    bbox: [ [Array], [Array], [Array], [Array] ]
  },
  paymentDetails: []
}

Page level prediction

We create the document class by iterating over each page one by one. Each page in the pdf is treated as a unique page.

For example, if you send a three-page invoice, page level prediction will provide you with three tax, three total and so on.

res.invoices

Code Example

mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
  console.log(res.invoices);
})
.catch((err) => {
  console.error(err);
});

Output

[
  Invoice {
    filepath: '/Users/fharper/Documents/code/mindee/datasets/invoices/00da35ce-0827-4f2f-b094-6021c04e3457.pdf',
    filename: '00da35ce-0827-4f2f-b094-6021c04e3457.pdf',
    fileExtension: 'application/pdf',
    checklist: {
      taxesMatchTotalIncl: false,
      taxesMatchTotalExcl: false,
      taxesPlusTotalExclMatchTotalIncl: false
    },
    level: 'page',
    constructPrediction: [Function (anonymous)],
    words: [],
    locale: Locale {
      pageNumber: 0,
      reconstructed: false,
      value: undefined,
      probability: 0.83,
      bbox: [],
      language: 'fr',
      country: undefined,
      currency: 'EUR'
    },
    totalIncl: Amount {
      pageNumber: 0,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    totalTax: Amount {
      pageNumber: 0,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    totalExcl: Amount {
      pageNumber: 0,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    date: DateField {
      pageNumber: 0,
      reconstructed: false,
      value: '2020-06-30',
      probability: 0.99,
      bbox: [Array],
      dateObject: 2020-06-30T00:00:00.000Z
    },
    invoiceDate: DateField {
      pageNumber: 0,
      reconstructed: false,
      value: '2020-06-30',
      probability: 0.99,
      bbox: [Array],
      dateObject: 2020-06-30T00:00:00.000Z
    },
    taxes: [],
    companyNumber: [ [Field], [Field], [Field] ],
    dueDate: DateField {
      pageNumber: 0,
      reconstructed: false,
      value: '2020-07-30',
      probability: 0.99,
      bbox: [Array],
      dateObject: 2020-07-30T00:00:00.000Z
    },
    invoiceNumber: Field {
      pageNumber: 0,
      reconstructed: false,
      value: '0660',
      probability: 0.99,
      bbox: [Array]
    },
    supplier: Field {
      pageNumber: 0,
      reconstructed: false,
      value: 'SOMONIAN',
      probability: 0.89,
      bbox: [Array]
    },
    supplierAddress: Field {
      pageNumber: 0,
      reconstructed: false,
      value: '9, Rue Buffault 75009 Paris',
      probability: 0.73,
      bbox: [Array]
    },
    customerName: Field {
      pageNumber: 0,
      reconstructed: false,
      value: 'CELINNI',
      probability: 0.9,
      bbox: [Array]
    },
    customerAddress: Field {
      pageNumber: 0,
      reconstructed: false,
      value: '9, Rue Buffault 75009 Paris',
      probability: 0.73,
      bbox: [Array]
    },
    customerCompanyRegistration: [],
    paymentDetails: [],
    orientation: Orientation {
      pageNumber: 0,
      reconstructed: false,
      value: 0,
      probability: 0.99,
      bbox: []
    }
  },
  Invoice {
    filepath: '/Users/fharper/Documents/code/mindee/datasets/invoices/00da35ce-0827-4f2f-b094-6021c04e3457.pdf',
    filename: '00da35ce-0827-4f2f-b094-6021c04e3457.pdf',
    fileExtension: 'application/pdf',
    checklist: {
      taxesMatchTotalIncl: false,
      taxesMatchTotalExcl: false,
      taxesPlusTotalExclMatchTotalIncl: false
    },
    level: 'page',
    constructPrediction: [Function (anonymous)],
    words: [],
    locale: Locale {
      pageNumber: 1,
      reconstructed: false,
      value: undefined,
      probability: 0.83,
      bbox: [],
      language: 'fr',
      country: undefined,
      currency: 'EUR'
    },
    totalIncl: Amount {
      pageNumber: 1,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    totalTax: Amount {
      pageNumber: 1,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    totalExcl: Amount {
      pageNumber: 1,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    date: DateField {
      pageNumber: 1,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: [],
      dateObject: undefined
    },
    invoiceDate: DateField {
      pageNumber: 1,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: [],
      dateObject: undefined
    },
    taxes: [],
    companyNumber: [],
    dueDate: DateField {
      pageNumber: 1,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: [],
      dateObject: undefined
    },
    invoiceNumber: Field {
      pageNumber: 1,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    supplier: Field {
      pageNumber: 1,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    supplierAddress: Field {
      pageNumber: 1,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    customerName: Field {
      pageNumber: 1,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    customerAddress: Field {
      pageNumber: 1,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    customerCompanyRegistration: [],
    paymentDetails: [],
    orientation: Orientation {
      pageNumber: 1,
      reconstructed: false,
      value: 0,
      probability: 0.99,
      bbox: []
    }
  },
  Invoice {
    filepath: '/Users/fharper/Documents/code/mindee/datasets/invoices/00da35ce-0827-4f2f-b094-6021c04e3457.pdf',
    filename: '00da35ce-0827-4f2f-b094-6021c04e3457.pdf',
    fileExtension: 'application/pdf',
    checklist: {
      taxesMatchTotalIncl: true,
      taxesMatchTotalExcl: true,
      taxesPlusTotalExclMatchTotalIncl: true
    },
    level: 'page',
    constructPrediction: [Function (anonymous)],
    words: [],
    locale: Locale {
      pageNumber: 2,
      reconstructed: false,
      value: undefined,
      probability: 0.83,
      bbox: [],
      language: 'fr',
      country: undefined,
      currency: 'EUR'
    },
    totalIncl: Amount {
      pageNumber: 2,
      reconstructed: false,
      value: 13200,
      probability: 1,
      bbox: [Array]
    },
    totalTax: Amount {
      pageNumber: 0,
      reconstructed: true,
      value: 2200,
      probability: 1,
      bbox: []
    },
    totalExcl: Amount {
      pageNumber: 2,
      reconstructed: false,
      value: 11000,
      probability: 1,
      bbox: [Array]
    },
    date: DateField {
      pageNumber: 2,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: [],
      dateObject: undefined
    },
    invoiceDate: DateField {
      pageNumber: 2,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: [],
      dateObject: undefined
    },
    taxes: [ [Object] ],
    companyNumber: [],
    dueDate: DateField {
      pageNumber: 2,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: [],
      dateObject: undefined
    },
    invoiceNumber: Field {
      pageNumber: 2,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    supplier: Field {
      pageNumber: 2,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    supplierAddress: Field {
      pageNumber: 2,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    customerName: Field {
      pageNumber: 2,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    customerAddress: Field {
      pageNumber: 2,
      reconstructed: false,
      value: undefined,
      probability: 0,
      bbox: []
    },
    customerCompanyRegistration: [],
    paymentDetails: [],
    orientation: Orientation {
      pageNumber: 2,
      reconstructed: false,
      value: 0,
      probability: 0.99,
      bbox: []
    }
  }
]

Raw HTTP response

Get the full API response as a Node.js HTTP Response object

const { Client } = require("mindee");

const mindeeClient = new Client({
  invoiceToken: "yourInvoiceToken"
});

mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
  console.log(res.httpResponse);
})
.catch((err) => {
  console.error(err);
});

Extracted Fields

Each invoice object contains a set of different fields. Each field contains the four following attributes:

  • value (String or Float depending on the field type): corresponds to the field value. Set to None if the field was not extracted.
  • probability (Float): the confidence score of the field prediction.
  • bbox (Array[Float]): contains the relative vertices coordinates of the bounding box containing the field in the image. If the field is not written, the bbox is an empty array.
  • reconstructed (Boolean): True if the field was reconstructed using other fields.

Additional Attributes

Depending on the field type specified, additional attributes can be extracted in the invoice object. Using the above invoice example, the following are the basic fields that can be extracted.

Customer Information

  • invoice.customerAddress (string): customer address.
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.customerAddress);
})
.catch((err) => {
  console.error(err);
});

Output

Field {
  pageNumber: 3,
  reconstructed: false,
  value: '20, Rue DuMago 75009 Paris',
  probability: 0.73,
  bbox: [[ 0.484, 0.202 ], [ 0.606, 0.202 ], [ 0.606, 0.25 ], [ 0.484, 0.25 ]],
}
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.customerCompanyRegistration);
})
.catch((err) => {
  console.error(err);
});

Output

[
  Field {
    pageNumber: 2,
    reconstructed: false,
    value: '00442070926',
    probability: 1,
    bbox: [ [Array], [Array], [Array], [Array] ],
    type: 'CF'
  }
]
  • invoice.customerName (string): customer name.
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.customerName);
})
.catch((err) => {
  console.error(err);
});

Output

Field {
  pageNumber: 1,
  reconstructed: false,
  value: 'JIRO DOI',
  probability: 0.84,
  bbox: [[ 0.035, 0.284 ], [ 0.098, 0.284 ], [ 0.098, 0.296 ], [ 0.035, 0.296 ]]
}

Dates

  • invoice.invoiceDate (string): Issuance date of the invoice. Each date field comes with an extra attribute.
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.invoiceDate);
})
.catch((err) => {
  console.error(err);
});

Output

DateField {
  pageNumber: 0,
  reconstructed: false,
  value: '2018-09-25',
  probability: 0.99,
  bbox: [[ 0.84, 0.305 ], [ 0.932, 0.305 ], [ 0.932, 0.318 ], [ 0.84, 0.318 ]],
  dateObject: '2018-09-25T00:00:00.000Z'
}
  • invoice.dueDate (string): Due date of payment of the invoice.
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.dueDate);
})
.catch((err) => {
  console.error(err);
});

Output

DateField {
  pageNumber: 0,
  reconstructed: false,
  value: '2018-09-25',
  probability: 0.86,
  bbox: [[ 0.841, 0.323 ], [ 0.941, 0.323 ], [ 0.941, 0.338 ], [ 0.841, 0.338 ]],
  dateObject: '2018-09-25T00:00:00.000Z'
}

Invoice Number

  • invoice.invoiceNumber (string): unique number that is assigned to the invoice.
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.invoiceNumber);
})
.catch((err) => {
  console.error(err);
});

Output

Field {
  pageNumber: 0,
  reconstructed: false,
  value: '14',
  probability: 0.99,
  bbox: [[ 0.841, 0.264 ], [ 0.864, 0.264 ], [ 0.864, 0.279 ], [ 0.841, 0.279 ]],
}

Locale

  • invoice.locale (string): Language and country ISO code.
    • language (String): Language code in ISO 639-1 format as seen on the invoice. The following language codes are supported: ca, de, en, es, fr, it, nl and pt.
    • country (String): Country code in ISO 3166-1 alpha-2 format as seen on the invoice. The following country codes are supported: CA, CH, DE, ES, FR, GB, IT, NL, PT and US.
    • currency (String): Currency code in ISO 4217 format as seen on the invoice. The following country codes are supported: CAD, CHF, GBP, EUR, USD.
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.locale);
})
.catch((err) => {
  console.error(err);
});

Output

Locale {
  pageNumber: 0,
  reconstructed: false,
  probability: 0,
  bbox: [],
  language: 'en',
  country: undefined,
  currency: 'CAD'
}

Orientation

  • invoice.orientation (number): The orientation field is only available at the page level as it describes whether the page image should be rotated to be upright. The rotation value is also conveniently available in the JSON response at: document > inference > pages [ ] > orientation > value.
    If the page requires rotation for correct display, the orientation field gives a prediction among these 3 possible outputs:
    • 0 degree: the page is already upright
    • 90 degrees: the page must be rotated clockwise to be upright
    • 270 degrees: the page must be rotated counterclockwise to be upright
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.orientation);
})
.catch((err) => {
  console.error(err);
});

Output

Orientation {
  pageNumber: 1,
  reconstructed: false,
  value: 0,
  probability: 0.99,
  bbox: []
}

Supplier Informations

  • invoice.supplierAddress (string): supplier address.
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.supplierAddress);
})
.catch((err) => {
  console.error(err);
});

Output

Field {
  pageNumber: 3,
  reconstructed: false,
  value: '99, Duperné 75011 Paris',
  probability: 0.73,
  bbox: [[ 0.051, 0.039 ], [ 0.202, 0.039 ], [ 0.202, 0.095 ], [ 0.051, 0.095]],
}
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.companyNumber);
})
.catch((err) => {
  console.error(err);
});

Output

Supplier Company Number [
  Field {
    pageNumber: 3,
    reconstructed: false,
    value: '52747908301026',
    probability: 0.99,
    bbox: [ [Array], [Array], [Array], [Array] ],
    type: 'SIRET'
  },
  Field {
    pageNumber: 3,
    reconstructed: false,
    value: 'FR18527479083',
    probability: 0.99,
    bbox: [ [Array], [Array], [Array], [Array] ],
    type: 'VAT NUMBER'
  },
  Field {
    pageNumber: 3,
    reconstructed: false,
    value: '527479583',
    probability: 0.99,
    bbox: [ [Array], [Array], [Array], [Array] ],
    type: 'SIREN'
  }
]
  • invoice.supplier (string): Supplier name as written in the invoice.
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.supplier);
})
.catch((err) => {
  console.error(err);
});

Output

Supplier Name {
  pageNumber: 0,
  reconstructed: false,
  value: 'TURNPIKE DESIGNS CO',
  probability: 0.74,
  bbox: [[ 0.159, 0.085 ], [ 0.391, 0.085 ], [ 0.391, 0.15 ], [ 0.159, 0.15 ]],
}
  • invoice.paymentDetails: List of Supplier's payment details written in the invoice. Each payment details object contains extra attributes:
    • accountNumber (String)
    • iban (String)
    • routingNumber (String)
    • swift (String)
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.paymentDetails);
})
.catch((err) => {
  console.error(err);
});

Output

Supplier Payment Details
[
  PaymentDetails {
    pageNumber: 1,
    reconstructed: false,
    value: undefined,
    probability: 0.76,
    bbox: [ [Array], [Array], [Array], [Array] ],
    accountNumber: '0500013M026',
    iban: 'FR14 2004 **** **** **** 3M02 606',
    routingNumber: undefined,
    swift: 'CTBAAU2S'
  }
]

Taxes

  • receipt.taxes (string): Contains tax fields as seen on the receipt.
    • value (number): The tax amount.
    • code (string): The tax code (HST, GST... for Canadian; City Tax, State tax for US, etc..).
    • rate (number): The tax rate.
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.taxes);
})
.catch((err) => {
  console.error(err);
});

Output

[
  {
    pageNumber: 1,
    reconstructed: false,
    value: 193.2,
    probability: 1,
    bbox: [ [Array], [Array], [Array], [Array] ],
    rate: 8,
    code: 'GST'
  }
]

Tests

A checklist of three Boolean attributes that check the extracted total amounts and taxes data is correct with some basic tests.

📘

Info

A false value does not mean inaccurate extraction, but true is another confirmation of accurate data extraction.

  • taxesMatchTotalIncl (Boolean): returns true if taxes.rate * totalExcl + totalExcl = totalIncl
  • taxesMatchTotalExcl (Boolean): returns true if (all taxes) * 100 / taxes.rate = totalExcl
  • taxesPlusTotalExclMatchTotalIncl (Boolean): returns true if (all taxes) + totalexcl = totalIncl
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.checklist);
})
.catch((err) => {
  console.error(err);
});

Output

{
  taxesMatchTotalIncl: true,
  taxesMatchTotalExcl: false,
  taxesPlusTotalExclMatchTotalIncl: false
}

Total Amounts

  • invoice.totalIncl (number): Total amount including taxes.
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.totalIncl);
})
.catch((err) => {
  console.error(err);
});

Output

Amount {
  pageNumber: 0,
  reconstructed: false,
  value: 2608.2,
  probability: 1,
  bbox: [[ 0.886, 0.839 ], [ 0.971, 0.839 ], [ 0.971, 0.858 ], [ 0.886, 0.858 ]],
}
  • invoice.totalExcl (number): Total amount excluding taxes.
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.totalExcl);
})
.catch((err) => {
  console.error(err);
});

Output

Amount {
  pageNumber: 0,
  reconstructed: true,
  value: 2415,
  probability: 1,
  bbox: []
}
  • invoice.totalTax (number): Total taxes reconstructed from tax lines.
mindeeClient.invoice.parse({
    input : "invoice.pdf",
    inputType : 'path',
    filename : undefined,
    cutPdf : true,
    includeWords : false
})
.then((res) => {
    console.log(res.invoice.totalTax);
})
.catch((err) => {
  console.error(err);
});

Output

Amount {
  pageNumber: 0,
  reconstructed: true,
  value: 193.2,
  probability: 1,
  bbox: []
}

 

Questions?
Slack Logo IconSlack Logo Icon  Join our Slack


Did this page help you?