FR Energy Bill
The Node.js SDK supports the Mindee V1 Energy Bill API.
Product Specifications
Endpoint Name
energy_bill_fra
Recommended Version
v1.2
Supports Polling/Webhooks
✔️ Yes
Support Synchronous HTTP Calls
❌ No
Geography
🇫🇷 France
Quick-Start
Using the sample below, we are going to illustrate how to extract the data that we want using the SDK.
Sample Code
const mindee = require("mindee");
// for TS or modules:
// import * as mindee from "mindee";
// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });
// Load a file from disk
const inputSource = mindeeClient.docFromPath("/path/to/the/file.ext");
// Parse the file
const apiResponse = mindeeClient.enqueueAndParse(
mindee.product.fr.EnergyBillV1,
inputSource
);
// Handle the response Promise
apiResponse.then((resp) => {
// print a string summary
console.log(resp.document.toString());
});Sample Output (rST)
########
Document
########
:Mindee ID: ff1f2ca8-4d29-44d8-a564-599a982a4ef7
:Filename: default_sample.pdf
Inference
#########
:Product: mindee/energy_bill_fra v1.2
:Rotation applied: Yes
Prediction
==========
:Invoice Number: 1234567890
:Contract ID: 9876543210
:Delivery Point: 98765432109876
:Invoice Date: 2021-01-29
:Due Date: 2021-02-15
:Total Before Taxes: 1241.03
:Total Taxes: 238.82
:Total Amount: 1479.85
:Energy Supplier:
:Address: TSA 12345, 12345 DEMOCITY CEDEX
:Name: EDF
:Energy Consumer:
:Address: 123 RUE DE L'IMAGINAIRE, 75001 PARIS
:Name: JOHN DOE
:Subscription:
+--------------------------------------+------------+------------+----------+-----------+------------+
| Description | End Date | Start Date | Tax Rate | Total | Unit Price |
+======================================+============+============+==========+===========+============+
| Abonnement électricité | 2021-02-28 | 2021-01-01 | 5.50 | 59.00 | 29.50 |
+--------------------------------------+------------+------------+----------+-----------+------------+
:Energy Usage:
+-------------+--------------------------------------+------------+------------+----------+-----------+-----------------+------------+
| Consumption | Description | End Date | Start Date | Tax Rate | Total | Unit of Measure | Unit Price |
+=============+======================================+============+============+==========+===========+=================+============+
| 8581.00 | Consommation électricité | 2021-01-27 | 2020-11-28 | 20.00 | 898.43 | kWh | 0.1047 |
+-------------+--------------------------------------+------------+------------+----------+-----------+-----------------+------------+
:Taxes and Contributions:
+--------------------------------------+------------+------------+----------+-----------+------------+
| Description | End Date | Start Date | Tax Rate | Total | Unit Price |
+======================================+============+============+==========+===========+============+
| Contribution au Service Public de... | 2021-01-27 | 2020-11-28 | 20.00 | 193.07 | 0.0225 |
+--------------------------------------+------------+------------+----------+-----------+------------+
| Taxe Départementale sur la Conso ... | 2021-01-27 | 2020-11-28 | 20.00 | 13.98 | 0.003315 |
+--------------------------------------+------------+------------+----------+-----------+------------+
| Taxe Communale sur la Conso Final... | 2021-01-27 | 2020-11-28 | 20.00 | 28.56 | 0.006545 |
+--------------------------------------+------------+------------+----------+-----------+------------+
| Taxe Communale sur la Conso Final... | 2021-01-27 | 2020-11-28 | 20.00 | 27.96 | 0.00663 |
+--------------------------------------+------------+------------+----------+-----------+------------+
:Meter Details:
:Meter Number: 620
:Meter Type: electricity
:Unit of Power: 36kVAStandard Fields
These fields are generic and used in several products.
Basic Field
Each prediction object contains a set of fields that inherit from the generic Field class.
A typical Field object will have the following attributes:
value (
number | string): corresponds to the field value. Can beundefinedif no value was extracted.confidence (
number): the confidence score of the field prediction.boundingBox (
[Point, Point, Point, Point]): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.polygon (
Point[]): contains the relative vertices coordinates (Point) of a polygon containing the field in the image.pageId (
number): the ID of the page, alwaysundefinedwhen at document-level.reconstructed (
boolean): indicates whether an object was reconstructed (not extracted as the API gave it).
Aside from the previous attributes, all basic fields have access to a toString() method that can be used to print their value as a string.
Amount Field
The amount field AmountField only has one constraint: its value is a number (or undefined).
Date Field
Aside from the basic Field attributes, the date field DateField also implements the following:
dateObject (
Date): an accessible representation of the value as a JavaScript object.
String Field
The text field StringField only has one constraint: its value is a string (or undefined).
Specific Fields
Fields which are specific to this product; they are not used in any other product.
Energy Consumer Field
The entity that consumes the energy.
A EnergyBillV1EnergyConsumer implements the following attributes:
address(string): The address of the energy consumer.name(string): The name of the energy consumer.
Energy Supplier Field
The company that supplies the energy.
A EnergyBillV1EnergySupplier implements the following attributes:
address(string): The address of the energy supplier.name(string): The name of the energy supplier.
Energy Usage Field
Details of energy consumption.
A EnergyBillV1EnergyUsage implements the following attributes:
consumption(number): The price per unit of energy consumed.description(string): Description or details of the energy usage.endDate(string): The end date of the energy usage.startDate(string): The start date of the energy usage.taxRate(number): The rate of tax applied to the total cost.total(number): The total cost of energy consumed.unit(string): The unit of measurement for energy consumption. Possible values include:kWh
m3
L
unitPrice(number): The price per unit of energy consumed.
Meter Details Field
Information about the energy meter.
A EnergyBillV1MeterDetail implements the following attributes:
meterNumber(string): The unique identifier of the energy meter.meterType(string): The type of energy meter. Possible values include:electricity
gas
water
None
unit(string): The unit of power for energy consumption.
Subscription Field
The subscription details fee for the energy service.
A EnergyBillV1Subscription implements the following attributes:
description(string): Description or details of the subscription.endDate(string): The end date of the subscription.startDate(string): The start date of the subscription.taxRate(number): The rate of tax applied to the total cost.total(number): The total cost of subscription.unitPrice(number): The price per unit of subscription.
Taxes and Contributions Field
Details of Taxes and Contributions.
A EnergyBillV1TaxesAndContribution implements the following attributes:
description(string): Description or details of the Taxes and Contributions.endDate(string): The end date of the Taxes and Contributions.startDate(string): The start date of the Taxes and Contributions.taxRate(number): The rate of tax applied to the total cost.total(number): The total cost of Taxes and Contributions.unitPrice(number): The price per unit of Taxes and Contributions.
Attributes
The following fields are extracted for Energy Bill V1:
Contract ID
contractId (StringField): The unique identifier associated with a specific contract.
console.log(result.document.inference.prediction.contractId.value);Delivery Point
deliveryPoint (StringField): The unique identifier assigned to each electricity or gas consumption point. It specifies the exact location where the energy is delivered.
console.log(result.document.inference.prediction.deliveryPoint.value);Due Date
dueDate (DateField): The date by which the payment for the energy invoice is due.
console.log(result.document.inference.prediction.dueDate.value);Energy Consumer
energyConsumer (EnergyBillV1EnergyConsumer): The entity that consumes the energy.
console.log(result.document.inference.prediction.energyConsumer.value);Energy Supplier
energySupplier (EnergyBillV1EnergySupplier): The company that supplies the energy.
console.log(result.document.inference.prediction.energySupplier.value);Energy Usage
energyUsage (EnergyBillV1EnergyUsage[]): Details of energy consumption.
for (const energyUsageElem of result.document.inference.prediction.energyUsage) {
console.log(energyUsageElem.value);
}Invoice Date
invoiceDate (DateField): The date when the energy invoice was issued.
console.log(result.document.inference.prediction.invoiceDate.value);Invoice Number
invoiceNumber (StringField): The unique identifier of the energy invoice.
console.log(result.document.inference.prediction.invoiceNumber.value);Meter Details
meterDetails (EnergyBillV1MeterDetail): Information about the energy meter.
console.log(result.document.inference.prediction.meterDetails.value);Subscription
subscription (EnergyBillV1Subscription[]): The subscription details fee for the energy service.
for (const subscriptionElem of result.document.inference.prediction.subscription) {
console.log(subscriptionElem.value);
}Taxes and Contributions
taxesAndContributions (EnergyBillV1TaxesAndContribution[]): Details of Taxes and Contributions.
for (const taxesAndContributionsElem of result.document.inference.prediction.taxesAndContributions) {
console.log(taxesAndContributionsElem.value);
}Total Amount
totalAmount (AmountField): The total amount to be paid for the energy invoice.
console.log(result.document.inference.prediction.totalAmount.value);Total Before Taxes
totalBeforeTaxes (AmountField): The total amount to be paid for the energy invoice before taxes.
console.log(result.document.inference.prediction.totalBeforeTaxes.value);Total Taxes
totalTaxes (AmountField): Total of taxes applied to the invoice.
console.log(result.document.inference.prediction.totalTaxes.value);Last updated
Was this helpful?

