Goto APIs

Interpreter API

Interpret uploaded files, e.g. invoice pdf or delivery note pdf

General:

Basics:

Base-URL: https://capi.lagerkoll.com/v1/interpreter/
Parameters in the url should all be encoded and all data sent should be UTF-8

MAX number of requests per minute is set to 200.
When the limit is hit an error with code 429 is returned, with the header "Retry-After" containing the number of seconds you have to wait for your next request.

Headers:

There are 2 ways to be authenticated when using this API. in both ways you add headers to the request.
1) Use an API-key together with store-id. This would be used when communicating machine to machine and no real person is involved. The API-key is available from where you activated the API. The store-id is also available in the same place.
2) Use a user_id and user_token together with a store-id. You get these values from the login-request. The values are connected to a person and are gained when an actual login to the system has been made.
store: <<STORE>>
user_id: <<USER_ID>>
user_token: <<USER_TOKEN>>
api_key: <<API_KEY>>
Accept: application/json
Content-Type: application/json

Errors:

Code Description
900001 Credentials don't match
900101 Common error
900429 Too many requests
909001 Supplier not found
909002 PurchaserOrder not found
909003 Interpreter featuer missing
{
  "errorCode" : 900101,
  "errorMessage" : "Something went wrong on the server",
  "errorField" : null,
  "errorData" : null
}

Interpreter API:

DeliveryNote

Intrepret delivery note

POSTUrl: /deliverynote
Headers:
Accept: application/json
Content-type: multipart/form-data
Interpret delivery note PDF

Valid parameters:

Parameter Description Default value Allowed values
file Inputstream to be uploaded
file

Body:
Successfull response:

{ "deliveryFrom": { "country": "country", "city": "city", "phone": "phone", "address1": "address1", "postalCode": "postalCode", "name": "name", "attention": "attention" }, "deliveryTo": { "country": "country", "city": "city", "phone": "phone", "address1": "address1", "postalCode": "postalCode", "name": "name" }, "deliveryTerms": "deliveryTerms", "orderNumber": "orderNumber", "customersOrderNumber": "customersOrderNumber", "company": { "orgNumber": "orgNumber", "vatNumber": "vatNumber" }, "deliveryDate": "deliveryDate", "lines": [{ "articleName": "articleName", "orderedQuantity": { "unit": "unit", "value": 155.76194183388625 }, "articleNumber": "articleNumber", "deliveredQuantity": { "unit": "unit", "value": 9840.898233411826 }, "description": "description", "vatPercent": 2256.184942106809, "extraLines": [{ "orderedQuantity": { "unit": "unit", "value": 8840.980205726024 }, "deliveredQuantity": { "unit": "unit", "value": 4225.7678874907115 }, "type": "type", "value": "value" }] }], "orderDate": "orderDate", "customer": { "reference": "reference", "phone": "phone", "name": "name" } }

Receive delivery

PUTUrl: /deliverynote
Headers:
Accept: application/json
Content-type: application/json
Receive delivery from delivery note. If no purchase order is given a new order will be created and set to sent

Valid parameters:

Parameter Description Default value Allowed values
order_id Existing purchase order id

Body:

{ "deliveryFrom": { "country": "country", "city": "city", "phone": "phone", "address1": "address1", "postalCode": "postalCode", "name": "name", "attention": "attention" }, "deliveryTo": { "country": "country", "city": "city", "phone": "phone", "address1": "address1", "postalCode": "postalCode", "name": "name" }, "deliveryTerms": "deliveryTerms", "orderNumber": "orderNumber", "customersOrderNumber": "customersOrderNumber", "company": { "orgNumber": "orgNumber", "vatNumber": "vatNumber" }, "deliveryDate": "deliveryDate", "lines": [{ "articleName": "articleName", "orderedQuantity": { "unit": "unit", "value": 7223.93547230982 }, "articleNumber": "articleNumber", "deliveredQuantity": { "unit": "unit", "value": 3674.8376708842943 }, "description": "description", "vatPercent": 3685.4843409464697, "extraLines": [{ "orderedQuantity": { "unit": "unit", "value": 2888.7801262274393 }, "deliveredQuantity": { "unit": "unit", "value": 9931.259577071603 }, "type": "type", "value": "value" }] }], "orderDate": "orderDate", "customer": { "reference": "reference", "phone": "phone", "name": "name" } }
Successfull response:

{ "paymentTermsDescription": "paymentTermsDescription", "deliveryPhone": "deliveryPhone", "supplierOrderId": "supplierOrderId", "supplierId": 5542, "productionOrderId": 1722, "deliveryTermsDescription": "deliveryTermsDescription", "customerOrderId": 4720, "contactPerson": "contactPerson", "deliveryZip": "deliveryZip", "productCount": 1032, "orderValue": 2203.812810322313, "confirmedDeliveryDate": 1772868885619, "externalInvoiceReference": "externalInvoiceReference", "orderValueCurrency": "orderValueCurrency", "deliveredDate": 1772868885619, "deliveryAddress": "deliveryAddress", "orderSentDate": 1772868885619, "deliveryContact": "deliveryContact", "id": 1159, "state": 4208, "deliveryDate": 1772868885619, "paymentTerms": "paymentTerms", "supplierName": "supplierName", "deliveryCity": "deliveryCity", "deliveryTerms": "deliveryTerms", "goodsMarking": "goodsMarking", "contactEmail": "contactEmail", "isPickNPack": "false", "deliveryAddress2": "deliveryAddress2", "orderValueStore": 9901.386491234629, "storeId": 3531, "deliveryCompany": "deliveryCompany", "message": "message", "deliveryNoteId": "deliveryNoteId", "deliveryCountry": "deliveryCountry", "comment": "comment", "articles": [{ "deliveredAmount": "0", "articleName": "articleName", "purchasePriceMisc": "0", "barcodeType": "EAN", "articleId": "articleId", "description": "description", "purchasePrice": "0", "units": [{ "unit": { "name": "name", "externalId": "externalId", "id": 1594 }, "articleId": "articleId", "storegroupId": 9641, "convert": 6378.199662612953, "barcode": "barcode" }], "type": "type", "batches": [{ "deliveredAmount": "1", "serialNr": "serialNr", "bestBefore": 7284, "batchId": "batchId", "orderedAmount": "1" }], "unit": "unit", "availableAmount": "0", "rate": 3799.203315228975, "supplierArticleId": "supplierArticleId", "purchasePriceShipment": "0", "id": 7611, "orderedAmount": "0", "stock": false, "barcode": "barcode", "orderedAmountWithUnits": "orderedAmountWithUnits", "stockWarning": "0" }], "poReference": "poReference" }

Invoice

Interpret invoice

POSTUrl: /invoice
Headers:
Accept: application/json
Content-type: multipart/form-data
Interpret invoice PDF

Valid parameters:

Parameter Description Default value Allowed values
file Inputstream to be uploaded
file

Body:
Successfull response:

{ "lineItems": [{ "unitPrice": 6157.792324898493, "unit": "unit", "productCode": "productCode", "quantity": 5850.834995580636, "freight": 3240.819320660955, "description": "description", "title": "title", "lineAmount": 6801.3553243940105 }], "notes": { "interestTerms": "interestTerms", "complaintTerms": "complaintTerms" }, "supplier": { "address": { "country": "country", "city": "city" }, "bankgiro": "bankgiro", "vatRegistrationNumber": "vatRegistrationNumber", "organizationNumber": "organizationNumber", "contact": { "phone": "phone", "email": "email" }, "name": "name" }, "payment": { "toBankgiro": "toBankgiro", "ocrNumber": "ocrNumber", "referenceNumber": "referenceNumber" }, "invoice": { "ourReference": "ourReference", "orderId": "orderId", "dueDate": "dueDate", "customerReference": "customerReference", "invoiceNumber": "invoiceNumber", "currency": "currency", "invoiceDate": "invoiceDate", "customerNumber": "customerNumber", "paymentTerms": "paymentTerms" }, "totals": { "vatRatePercent": 4164.95366517185, "totalWithVat": 9276.566514468786, "freight": 5591.062110277589, "rounding": 5559.803119355303, "totalBeforeVat": 3926.0667809609895, "vatAmount": 7986.653467669661 }, "customer": { "address": { "country": "country", "city": "city", "street": "street", "postalCode": "postalCode" }, "name": "name" } }

Update purchase prices

PUTUrl: /invoice
Headers:
Accept: application/json
Content-type: application/json
Update purchase prices from invoice
Body:

{ "lineItems": [{ "unitPrice": 9066.450055167152, "unit": "unit", "productCode": "productCode", "quantity": 8454.28271758878, "freight": 5404.274302928902, "description": "description", "title": "title", "lineAmount": 4800.201110936417 }], "notes": { "interestTerms": "interestTerms", "complaintTerms": "complaintTerms" }, "supplier": { "address": { "country": "country", "city": "city" }, "bankgiro": "bankgiro", "vatRegistrationNumber": "vatRegistrationNumber", "organizationNumber": "organizationNumber", "contact": { "phone": "phone", "email": "email" }, "name": "name" }, "payment": { "toBankgiro": "toBankgiro", "ocrNumber": "ocrNumber", "referenceNumber": "referenceNumber" }, "invoice": { "ourReference": "ourReference", "orderId": "orderId", "dueDate": "dueDate", "customerReference": "customerReference", "invoiceNumber": "invoiceNumber", "currency": "currency", "invoiceDate": "invoiceDate", "customerNumber": "customerNumber", "paymentTerms": "paymentTerms" }, "totals": { "vatRatePercent": 17.260351557347732, "totalWithVat": 5419.880490028796, "freight": 9232.42161329551, "rounding": 73.35117263214896, "totalBeforeVat": 7376.02889038215, "vatAmount": 463.9066257750901 }, "customer": { "address": { "country": "country", "city": "city", "street": "street", "postalCode": "postalCode" }, "name": "name" } }
Successfull response:

{ "paymentTermsDescription": "paymentTermsDescription", "deliveryPhone": "deliveryPhone", "supplierOrderId": "supplierOrderId", "supplierId": 7837, "productionOrderId": 8999, "deliveryTermsDescription": "deliveryTermsDescription", "customerOrderId": 8100, "contactPerson": "contactPerson", "deliveryZip": "deliveryZip", "productCount": 7630, "orderValue": 7926.867209303814, "confirmedDeliveryDate": 1772868885620, "externalInvoiceReference": "externalInvoiceReference", "orderValueCurrency": "orderValueCurrency", "deliveredDate": 1772868885620, "deliveryAddress": "deliveryAddress", "orderSentDate": 1772868885620, "deliveryContact": "deliveryContact", "id": 2963, "state": 814, "deliveryDate": 1772868885620, "paymentTerms": "paymentTerms", "supplierName": "supplierName", "deliveryCity": "deliveryCity", "deliveryTerms": "deliveryTerms", "goodsMarking": "goodsMarking", "contactEmail": "contactEmail", "isPickNPack": "false", "deliveryAddress2": "deliveryAddress2", "orderValueStore": 6013.463237342908, "storeId": 5634, "deliveryCompany": "deliveryCompany", "message": "message", "deliveryNoteId": "deliveryNoteId", "deliveryCountry": "deliveryCountry", "comment": "comment", "articles": [{ "deliveredAmount": "0", "articleName": "articleName", "purchasePriceMisc": "0", "barcodeType": "EAN", "articleId": "articleId", "description": "description", "purchasePrice": "0", "units": [{ "unit": { "name": "name", "externalId": "externalId", "id": 6749 }, "articleId": "articleId", "storegroupId": 31, "convert": 4334.234905004253, "barcode": "barcode" }], "type": "type", "batches": [{ "deliveredAmount": "1", "serialNr": "serialNr", "bestBefore": 7969, "batchId": "batchId", "orderedAmount": "1" }], "unit": "unit", "availableAmount": "0", "rate": 222.44373971205823, "supplierArticleId": "supplierArticleId", "purchasePriceShipment": "0", "id": 850, "orderedAmount": "0", "stock": false, "barcode": "barcode", "orderedAmountWithUnits": "orderedAmountWithUnits", "stockWarning": "0" }], "poReference": "poReference" }

Classes:

Address

Field Type Description Default Mandatory Accepted values Example values Access
street String R,W
postalCode String R,W
city String R,W
country String R,W

Address

Field Type Description Default Mandatory Accepted values Example values Access
city String R,W
country String R,W

ArticleUnitDto

Field Type Description Default Mandatory Accepted values Example values Access
storegroupId long R
articleId String Article id R
unit UnitDto Unit id true R,W
convert Double Conversion coefficient between unit and the article base unit true R,W
barcode String Barcode conected to unit R,W

Company

Field Type Description Default Mandatory Accepted values Example values Access
orgNumber String R,W
vatNumber String R,W

Contact

Field Type Description Default Mandatory Accepted values Example values Access
phone String R,W
email String R,W

Customer

Field Type Description Default Mandatory Accepted values Example values Access
name String R,W
address InvoiceInterpreterResponseDto$Customer$Address R,W

Customer

Field Type Description Default Mandatory Accepted values Example values Access
name String R,W
phone String R,W
reference String R,W

DeliveryFrom

Field Type Description Default Mandatory Accepted values Example values Access
name String R,W
attention String R,W
address1 String R,W
postalCode String R,W
city String R,W
country String R,W
phone String R,W

DeliveryNoteInterpreterResponseDto

Field Type Description Default Mandatory Accepted values Example values Access
orderNumber String R,W
customersOrderNumber String R,W
customer DeliveryNoteInterpreterResponseDto$Customer R,W
deliveryFrom DeliveryNoteInterpreterResponseDto$DeliveryFrom R,W
deliveryTo DeliveryNoteInterpreterResponseDto$DeliveryTo R,W
orderDate String R,W
deliveryDate String R,W
deliveryTerms String R,W
company DeliveryNoteInterpreterResponseDto$Company R,W
lines List R,W

DeliveryTo

Field Type Description Default Mandatory Accepted values Example values Access
name String R,W
address1 String R,W
postalCode String R,W
city String R,W
country String R,W
phone String R,W

ExtraLine

Field Type Description Default Mandatory Accepted values Example values Access
type String R,W
value String R,W
orderedQuantity DeliveryNoteInterpreterResponseDto$Quantity R,W
deliveredQuantity DeliveryNoteInterpreterResponseDto$Quantity R,W

InvoiceInfo

Field Type Description Default Mandatory Accepted values Example values Access
invoiceNumber String R,W
invoiceDate String R,W
dueDate String R,W
paymentTerms String R,W
customerNumber String R,W
customerReference String R,W
ourReference String R,W
currency String R,W
orderId String R,W

InvoiceInterpreterResponseDto

Field Type Description Default Mandatory Accepted values Example values Access
invoice InvoiceInterpreterResponseDto$InvoiceInfo R,W
customer InvoiceInterpreterResponseDto$Customer R,W
supplier InvoiceInterpreterResponseDto$Supplier R,W
lineItems List R,W
totals InvoiceInterpreterResponseDto$Totals R,W
payment InvoiceInterpreterResponseDto$Payment R,W
notes InvoiceInterpreterResponseDto$Notes R,W

Line

Field Type Description Default Mandatory Accepted values Example values Access
articleNumber String R,W
articleName String R,W
description String R,W
vatPercent Double R,W
orderedQuantity DeliveryNoteInterpreterResponseDto$Quantity R,W
deliveredQuantity DeliveryNoteInterpreterResponseDto$Quantity R,W
extraLines List R,W

LineItem

Field Type Description Default Mandatory Accepted values Example values Access
productCode String R,W
title String R,W
description String R,W
quantity Double R,W
unit String R,W
unitPrice Double R,W
lineAmount Double R,W
freight Double R,W

Notes

Field Type Description Default Mandatory Accepted values Example values Access
interestTerms String R,W
complaintTerms String R,W

Payment

Field Type Description Default Mandatory Accepted values Example values Access
toBankgiro String R,W
ocrNumber String R,W
referenceNumber String R,W

PurchaseOrderArticleBatchDto

Field Type Description Default Mandatory Accepted values Example values Access
batchId String batch-id or serial-nr must be set, Write only with POST Post R,W
serialNr String batch-id or serial-nr must be set, Write only with POST Post R,W
orderedAmount Double 1 R,W
deliveredAmount Double 1 R,W
bestBefore Long ms since 1970, Write only with POST R,W

PurchaseOrderArticleDto

Field Type Description Default Mandatory Accepted values Example values Access
id Long id is created by system, but must be supplied when updating order or matching product row won´t be found PUT R
articleId String Mandatory if this is not a freetext row. If this is a freetext row all fields except articleName is ignored POST, DELETE R,W
articleName String Name of article, or freetext row if articleId is missing R,W
supplierArticleId String If omitted, article id from supplier is used R,W
orderedAmount Double 0 R,W
deliveredAmount Double 0 R,W
availableAmount Double 0 R
stockWarning Double 0 R
barcode String R
barcodeType String EAN EAN, CODE128, QR, UPC R
purchasePrice Double If omitted, price from supplier is used 0 R,W
purchasePriceMisc Double If omitted, price from supplier is used 0 R,W
purchasePriceShipment Double If omitted, price from supplier is used 0 R,W
rate Double R
description String R,W
unit String R
type String Stock means it's a physical product and service means it's work and lacks stock-amount Stock, Service R
stock Boolean True means it's a physical article in stock and false means it's an article that needs to be ordered from supplier R
batches List If an article contains batches or serial numbers and this should be defined in the purchase order this list contains that information. If this list is null, no updates are done. Otherwise the content of this list replaces existing list R,W
units List List of units connected to the article, with factor and barcode. This does not contain information about the main unit on the article R
orderedAmountWithUnits String If article contains multiple units this string represents the most optimal package variants R

PurchaseOrderDto

Field Type Description Default Mandatory Accepted values Example values Access
id long R
storeId long R
poReference String Must be a unique id POST R,W
supplierId Long POST R,W
supplierName String R
orderSentDate Date R
deliveryDate Date POST R,W
confirmedDeliveryDate Date R,W
deliveredDate Date R
paymentTerms String Payment terms code R,W
paymentTermsDescription String Payment terms description R
deliveryTerms String Delivery terms code R,W
deliveryTermsDescription String Delivery terms description R
deliveryContact String R,W
deliveryCompany String R,W
deliveryPhone String R,W
deliveryAddress String POST R,W
deliveryAddress2 String R,W
deliveryCity String POST R,W
deliveryZip String POST R,W
deliveryCountry String POST R,W
contactPerson String POST R,W
contactEmail String POST R,W
productCount Integer R
state Integer NEW = 0,
SENT = 1,
RECEIVED = 2,
FINISHED = 3,
CANCELLED = 4
R,W
supplierOrderId String R,W
customerOrderId Long R,W
productionOrderId Long R,W
message String R,W
isPickNPack Boolean false R,W
comment String R,W
deliveryNoteId String R,W
externalInvoiceReference String R,W
goodsMarking String R,W
orderValue Double Order value based on the supplier's currency R
orderValueCurrency String Supplier's currency for the order value R
orderValueStore Double Order value based on the store's currency R
articles List List of PurchaseOrderArticles R,W

Quantity

Field Type Description Default Mandatory Accepted values Example values Access
value Double R,W
unit String R,W

Supplier

Field Type Description Default Mandatory Accepted values Example values Access
name String R,W
organizationNumber String R,W
vatRegistrationNumber String R,W
address InvoiceInterpreterResponseDto$Supplier$Address R,W
contact InvoiceInterpreterResponseDto$Supplier$Contact R,W
bankgiro String R,W

Totals

Field Type Description Default Mandatory Accepted values Example values Access
totalBeforeVat Double R,W
vatRatePercent Double R,W
vatAmount Double R,W
rounding Double R,W
freight Double R,W
totalWithVat Double R,W

UnitDto

Field Type Description Default Mandatory Accepted values Example values Access
id Long R,W
externalId String R
name String Name of unit R,W