Suppliers API
General:
Basics:
Base-URL: https://capi.lagerkoll.com/v1/suppliers/
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 |
900601 | Error when getting supplier |
900602 | Error when creating supplier |
900603 | Error when updating supplier |
900604 | Error when deleting supplier |
900624 | Error when importing suppliers |
{ "errorCode" : 900101, "errorMessage" : "Something went wrong on the server", "errorField" : null, "errorData" : null }
Suppliers API:
Suppliers
Get supplier
GETUrl: /{id}
Headers:
Accept: application/json or application/xml
Get a single supplier based on supplier id
Valid parameters:
Parameter | Description | Default value | Allowed values |
---|---|---|---|
open_orders | false | ||
article |
Body:
Successfull response:
{ "pages": 4, "suppliers": [{ "country": "country", "city": "city", "supplierExternalId": "supplierExternalId", "language": "language", "rate": 8933.744156707771, "buyPriceShipment": 4453.752093409938, "street": "street", "buyPriceMisc": 2646.9048087404103, "currency": "currency", "id": 8903, "orgNumber": "orgNumber", "paymentTerms": "paymentTerms", "openOrders": 144, "automaticOrder": true, "zip": "zip", "buyPrice": 3375.0602811681506, "comments": "comments", "includePricesInOrders": false, "contactEmail": "contactEmail", "contactName": "contactName", "externalId": "externalId", "customerNumber": "customerNumber", "emailStatus": {}, "deliveryDays": 1846, "name": "name", "includeShipmentAndMiscInPrice": false, "countryName": "countryName", "contactPhone": "contactPhone", "vatNumber": "vatNumber" }], "pageSize": 7604, "page": 2587, "suppliersCount": 4168, "since": 7439 }
Get suppliers
GETUrl:
Headers:
Accept: application/json or application/xml
Get a list of suppliers based on query
Valid parameters:
Parameter | Description | Default value | Allowed values |
---|---|---|---|
query | |||
since | 0 | ||
page | 0 | ||
limit | 100 | ||
order | asc | ||
sort_column | name | ||
open_orders | false | ||
article |
Body:
Successfull response:
{ "pages": 8768, "suppliers": [{ "country": "country", "city": "city", "supplierExternalId": "supplierExternalId", "language": "language", "rate": 6888.688508306849, "buyPriceShipment": 8409.046133830838, "street": "street", "buyPriceMisc": 5692.096263860344, "currency": "currency", "id": 2090, "orgNumber": "orgNumber", "paymentTerms": "paymentTerms", "openOrders": 5320, "automaticOrder": true, "zip": "zip", "buyPrice": 3368.873193531987, "comments": "comments", "includePricesInOrders": false, "contactEmail": "contactEmail", "contactName": "contactName", "externalId": "externalId", "customerNumber": "customerNumber", "emailStatus": {}, "deliveryDays": 521, "name": "name", "includeShipmentAndMiscInPrice": false, "countryName": "countryName", "contactPhone": "contactPhone", "vatNumber": "vatNumber" }], "pageSize": 1997, "page": 1516, "suppliersCount": 481, "since": 7724 }
Add supplier
POSTUrl:
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Content-type: application/json or application/xml
Add a new supplier
Body:
{ "zip": "zip", "buyPrice": 3565.880808350954, "country": "country", "comments": "comments", "includePricesInOrders": false, "city": "city", "contactEmail": "contactEmail", "contactName": "contactName", "externalId": "externalId", "language": "language", "customerNumber": "customerNumber", "buyPriceShipment": 2577.5572583608255, "deliveryDays": 3570, "street": "street", "buyPriceMisc": 3847.8361167295993, "name": "name", "includeShipmentAndMiscInPrice": true, "currency": "currency", "orgNumber": "orgNumber", "contactPhone": "contactPhone", "paymentTerms": "paymentTerms", "vatNumber": "vatNumber", "automaticOrder": true }
Successfull response:
{ "country": "country", "city": "city", "supplierExternalId": "supplierExternalId", "language": "language", "rate": 8405.3740938747, "buyPriceShipment": 8048.927408223556, "street": "street", "buyPriceMisc": 9578.198299340329, "currency": "currency", "id": 1311, "orgNumber": "orgNumber", "paymentTerms": "paymentTerms", "openOrders": 7482, "automaticOrder": true, "zip": "zip", "buyPrice": 6378.755037208115, "comments": "comments", "includePricesInOrders": true, "contactEmail": "contactEmail", "contactName": "contactName", "externalId": "externalId", "customerNumber": "customerNumber", "emailStatus": {}, "deliveryDays": 9455, "name": "name", "includeShipmentAndMiscInPrice": true, "countryName": "countryName", "contactPhone": "contactPhone", "vatNumber": "vatNumber" }
Update supplier
PUTUrl: /{id}
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Content-type: application/json or application/xml
Update an existing supplier
Body:
{ "country": "country", "city": "city", "supplierExternalId": "supplierExternalId", "language": "language", "rate": 1767.708605426016, "buyPriceShipment": 1246.8839687616362, "street": "street", "buyPriceMisc": 3871.6867595519834, "currency": "currency", "id": 1089, "orgNumber": "orgNumber", "paymentTerms": "paymentTerms", "openOrders": 9344, "automaticOrder": false, "zip": "zip", "buyPrice": 9008.186075743324, "comments": "comments", "includePricesInOrders": false, "contactEmail": "contactEmail", "contactName": "contactName", "externalId": "externalId", "customerNumber": "customerNumber", "emailStatus": {}, "deliveryDays": 805, "name": "name", "includeShipmentAndMiscInPrice": false, "countryName": "countryName", "contactPhone": "contactPhone", "vatNumber": "vatNumber" }
Successfull response:
{ "country": "country", "city": "city", "supplierExternalId": "supplierExternalId", "language": "language", "rate": 5217.543065295328, "buyPriceShipment": 6413.351839731634, "street": "street", "buyPriceMisc": 6185.550690551842, "currency": "currency", "id": 7844, "orgNumber": "orgNumber", "paymentTerms": "paymentTerms", "openOrders": 6983, "automaticOrder": false, "zip": "zip", "buyPrice": 5702.284848609182, "comments": "comments", "includePricesInOrders": true, "contactEmail": "contactEmail", "contactName": "contactName", "externalId": "externalId", "customerNumber": "customerNumber", "emailStatus": {}, "deliveryDays": 5719, "name": "name", "includeShipmentAndMiscInPrice": true, "countryName": "countryName", "contactPhone": "contactPhone", "vatNumber": "vatNumber" }
Delete supplier
DELETEUrl: /{id}
Headers:
Accept: application/json or application/xml
Delete an existing supplier
Body:
Successfull response:
Classes:
SupplierDto
Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
---|---|---|---|---|---|---|---|
id | long | R | |||||
externalId | String | Write only with POST | R,W | ||||
supplierExternalId | String | R | |||||
name | String | POST | R,W | ||||
orgNumber | String | If omitted, vatNumber is used. If vatNumber begins with SE and ends with 01 (SE551234567801) orgNumber is set to 5512345678 | R,W | ||||
vatNumber | String | R,W | |||||
comments | String | R,W | |||||
street | String | POST | R,W | ||||
zip | String | POST | R,W | ||||
city | String | POST | R,W | ||||
country | String | POST | if not null, must point to an existing country | R,W | |||
countryName | String | R | |||||
contactName | String | R,W | |||||
contactPhone | String | R,W | |||||
contactEmail | String | POST | R,W | ||||
customerNumber | String | R,W | |||||
includePricesInOrders | Boolean | R,W | |||||
includeShipmentAndMiscInPrice | Boolean | R,W | |||||
currency | String | POST | if not null, must point to an existing currency | R,W | |||
rate | double | R | |||||
buyPrice | Double | Total buy price including shipment and misc costs | R,W | ||||
buyPriceShipment | Double | R,W | |||||
buyPriceMisc | Double | R,W | |||||
language | String | POST | sv, en | R,W | |||
automaticOrder | Boolean | R,W | |||||
paymentTerms | String | if not null, must point to an existing payment-term | R,W | ||||
deliveryDays | Integer | number of days for supplier to make delivery | R,W | ||||
emailStatus | HashMap | R | |||||
openOrders | Integer | R |
SuppliersResponseDto
Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
---|---|---|---|---|---|---|---|
page | int | R | |||||
pages | int | R | |||||
pageSize | int | R | |||||
suppliersCount | int | R | |||||
since | long | R | |||||
suppliers | List | R |