Interpreter API
General:
Basics:
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.
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.
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 |
{
"errorCode" : 900101,
"errorMessage" : "Something went wrong on the server",
"errorField" : null,
"errorData" : null
}
Interpreter API:
DeliveryNote
Delivery note
POSTUrl: /deliverynote
Headers:
Accept: application/json
Content-type: multipart/form-data
Content-type: multipart/form-data
Interpret delivery note PDF
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| file | Inputstream to be uploaded | ||
| file | |||
| order_id | Existing purchase order id |
Body:
Successfull response:
{ "paymentTermsDescription": "paymentTermsDescription", "deliveryPhone": "deliveryPhone", "supplierOrderId": "supplierOrderId", "supplierId": 9543, "productionOrderId": 4003, "deliveryTermsDescription": "deliveryTermsDescription", "customerOrderId": 4824, "contactPerson": "contactPerson", "deliveryZip": "deliveryZip", "productCount": 8656, "orderValue": 4705.212691352853, "confirmedDeliveryDate": 1767103347340, "externalInvoiceReference": "externalInvoiceReference", "orderValueCurrency": "orderValueCurrency", "deliveredDate": 1767103347340, "deliveryAddress": "deliveryAddress", "orderSentDate": 1767103347340, "deliveryContact": "deliveryContact", "id": 3557, "state": 1501, "deliveryDate": 1767103347340, "paymentTerms": "paymentTerms", "supplierName": "supplierName", "deliveryCity": "deliveryCity", "deliveryTerms": "deliveryTerms", "goodsMarking": "goodsMarking", "contactEmail": "contactEmail", "isPickNPack": "false", "deliveryAddress2": "deliveryAddress2", "orderValueStore": 8622.779058187465, "storeId": 3546, "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": 1962 }, "articleId": "articleId", "storegroupId": 6250, "convert": 8713.96748652522, "barcode": "barcode" }], "type": "type", "batches": [{ "deliveredAmount": "1", "serialNr": "serialNr", "bestBefore": 9079, "batchId": "batchId", "orderedAmount": "1" }], "unit": "unit", "availableAmount": "0", "rate": 2863.4495570807208, "supplierArticleId": "supplierArticleId", "purchasePriceShipment": "0", "id": 3730, "orderedAmount": "0", "stock": false, "barcode": "barcode", "orderedAmountWithUnits": "orderedAmountWithUnits", "stockWarning": "0" }], "poReference": "poReference" }
Invoice
Invoice
POSTUrl: /invoice
Headers:
Accept: application/json
Content-type: multipart/form-data
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:
{ "paymentTermsDescription": "paymentTermsDescription", "deliveryPhone": "deliveryPhone", "supplierOrderId": "supplierOrderId", "supplierId": 858, "productionOrderId": 4196, "deliveryTermsDescription": "deliveryTermsDescription", "customerOrderId": 4476, "contactPerson": "contactPerson", "deliveryZip": "deliveryZip", "productCount": 6970, "orderValue": 5235.189727329933, "confirmedDeliveryDate": 1767103347340, "externalInvoiceReference": "externalInvoiceReference", "orderValueCurrency": "orderValueCurrency", "deliveredDate": 1767103347340, "deliveryAddress": "deliveryAddress", "orderSentDate": 1767103347340, "deliveryContact": "deliveryContact", "id": 7214, "state": 7685, "deliveryDate": 1767103347340, "paymentTerms": "paymentTerms", "supplierName": "supplierName", "deliveryCity": "deliveryCity", "deliveryTerms": "deliveryTerms", "goodsMarking": "goodsMarking", "contactEmail": "contactEmail", "isPickNPack": "false", "deliveryAddress2": "deliveryAddress2", "orderValueStore": 860.2898582227591, "storeId": 9360, "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": 2417 }, "articleId": "articleId", "storegroupId": 307, "convert": 2544.231151702502, "barcode": "barcode" }], "type": "type", "batches": [{ "deliveredAmount": "1", "serialNr": "serialNr", "bestBefore": 2787, "batchId": "batchId", "orderedAmount": "1" }], "unit": "unit", "availableAmount": "0", "rate": 6339.5941108740235, "supplierArticleId": "supplierArticleId", "purchasePriceShipment": "0", "id": 7763, "orderedAmount": "0", "stock": false, "barcode": "barcode", "orderedAmountWithUnits": "orderedAmountWithUnits", "stockWarning": "0" }], "poReference": "poReference" }
Classes:
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 |
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 |
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 |