Skip to content

Finalize an item for training

Background

This document describes how to report back the correct values for an item that was interpreted by Aiida. When this endpoint is called, the item will be moved to the archive column and will be in a read only state allowing the item to be trained by the algorithms. That means that this is a preparation step for the item to be able to be trained. The actual training will happen automatically at a later stage.

Note: This endpoint should only be called once per item.

Note: You need to send back all values that should be trained even those values that have not been changed.

Note: At all costs avoid reporting back of unsupervised(unseen) and non correct values. That means that all values that are sent back should be seen and validated by a human. The values that are not supervised should be ignored and not be sent back in the item finalization step.

Finalize an item

Finalize is called after the item is uploaded. We can finalize the item by a call to

POST ​/items/{id}/finalize

Example

{
 "values": [
    {"field_name": "Supplier Name", "value:": "Acme Inc."},
    {"field_id": "153a4d4a-bec2-11eb-bc90-528c3b9e15df", "value": "115.50"}
  ],
  "accounting": [
  {
    "account": "5410",
    "debit": "230.00",
    "credit": "0.00",
    "dimensions": {"cost_center": "99", "project": "Project 1"},
    "transaction_information": "string",
  }
 ],
  "classification": "SUPPLIER_INVOICE"
}

Body parameters

Parameter Comment
values List of field values (json, optional)
accounting List of accountings (json, optional)
classification Classification of item (string, optional). Must match one of the classifications of your workflows. Skip if not applicable.

Schema for values

field_name Field name (must match an existing field) (optional)
field_id Field id (must match an existing field) (optional)
value The correct value (optional)

One of either field_name or field_id must be present.

Schema for accounting
account Account number (4 digits)
debit Amount for debit (string)
credit Amount for credit (string)
dimensions project and/or cost_center (json, optional)
transaction_information Transaction information (optional)

Usage

In the request body, include all those values (for values, accountings, and classification) that you have seen and validated (both correct and incorrect).

Example 1: If Aiida reports a value for “Supplier Name”, but nobody on your end has seen and validated the value, then do not include it in the payload.

Example 2: If Aiida reports a value for “VAT”, and you have verified that it was correct, then include it in the payload.

Example 3: If Aiida reports a value for “Total”, and you find that it is incorrect, then include the correct value in the payload.

Example 4: If Aiida did not report a value for “BG”, but there is a correct value, then include the correct value in the payload.

Example 5: If Aiida reported a value for “PG”, but there is no correct value (i.e. the PG field should be empty), then return an empty value for PG in the payload: {“field_name”: “PG”}