Delivery note
The Ruby Client Library supports the Delivery note API.
Product Specifications
Endpoint Name
delivery_notes
Recommended Version
v1.2
Supports Polling/Webhooks
✔️ Yes
Support Synchronous HTTP Calls
❌ No
Geography
🌐 Global
Quick-Start
Using the sample below, we are going to illustrate how to extract the data that we want using the SDK.

Sample Code
#
# Install the Ruby client library by running:
# gem install mindee
#
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')
# Parse the file
result = mindee_client.parse(
input_source,
Mindee::Product::DeliveryNote::DeliveryNoteV1
)
# Print a full summary of the parsed data in RST format
puts result.document
# Print the document-level parsed data
# puts result.document.inference.predictionSample Output (rST)
########
Document
########
:Mindee ID: d5ead821-edec-4d31-a69a-cf3998d9a506
:Filename: default_sample.jpg
Inference
#########
:Product: mindee/delivery_notes v1.0
:Rotation applied: Yes
Prediction
==========
:Delivery Date: 2019-10-02
:Delivery Number: INT-001
:Supplier Name: John Smith
:Supplier Address: 4490 Oak Drive, Albany, NY 12210
:Customer Name: Jessie M Horne
:Customer Address: 4312 Wood Road, New York, NY 10031
:Total Amount: 204.75Standard 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 (
String,Float,Integer,bool): corresponds to the field value. Can benilif no value was extracted.confidence (Float, nil): the confidence score of the field prediction.
bounding_box (
Mindee::Geometry::Quadrilateral,nil): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.polygon (
Mindee::Geometry::Polygon,nil): contains the relative vertices coordinates (Point) of a polygon containing the field in the image.page_id (
Integer,nil): the ID of the page, alwaysnilwhen at document-level.reconstructed (
bool): 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 to_s 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 Float (or nil).
Date Field
Aside from the basic Field attributes, the date field DateField also implements the following:
date_object (
Date): an accessible representation of the value as a JavaScript object.
String Field
The text field StringField only has one constraint: it's value is a String (or nil).
Attributes
The following fields are extracted for Delivery note V1:
Customer Address
customer_address (StringField): The address of the customer receiving the goods.
puts result.document.inference.prediction.customer_address.valueCustomer Name
customer_name (StringField): The name of the customer receiving the goods.
puts result.document.inference.prediction.customer_name.valueDelivery Date
delivery_date (DateField): The date on which the delivery is scheduled to arrive.
puts result.document.inference.prediction.delivery_date.valueDelivery Number
delivery_number (StringField): A unique identifier for the delivery note.
puts result.document.inference.prediction.delivery_number.valueSupplier Address
supplier_address (StringField): The address of the supplier providing the goods.
puts result.document.inference.prediction.supplier_address.valueSupplier Name
supplier_name (StringField): The name of the supplier providing the goods.
puts result.document.inference.prediction.supplier_name.valueTotal Amount
total_amount (AmountField): The total monetary value of the goods being delivered.
puts result.document.inference.prediction.total_amount.valueLast updated
Was this helpful?

