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": 9964, "suppliers": [{ "country": "country", "city": "city", "supplierExternalId": "supplierExternalId", "language": "language", "rate": 3291.5924675333617, "buyPriceShipment": 1485.5860527263965, "street": "street", "buyPriceMisc": 4049.47379909087, "currency": "currency", "id": 6897, "orgNumber": "orgNumber", "paymentTerms": "paymentTerms", "openOrders": 6473, "automaticOrder": false, "zip": "zip", "buyPrice": 4072.35409229645, "comments": "comments", "includePricesInOrders": false, "contactEmail": "contactEmail", "contactName": "contactName", "externalId": "externalId", "customerNumber": "customerNumber", "emailStatus": {}, "deliveryDays": 6009, "name": "name", "includeShipmentAndMiscInPrice": false, "countryName": "countryName", "contactPhone": "contactPhone", "vatNumber": "vatNumber" }], "pageSize": 3781, "page": 1961, "suppliersCount": 3029, "since": 392 }
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": 9575, "suppliers": [{ "country": "country", "city": "city", "supplierExternalId": "supplierExternalId", "language": "language", "rate": 1726.4582313739152, "buyPriceShipment": 3102.809874601621, "street": "street", "buyPriceMisc": 9240.739752676009, "currency": "currency", "id": 709, "orgNumber": "orgNumber", "paymentTerms": "paymentTerms", "openOrders": 2338, "automaticOrder": true, "zip": "zip", "buyPrice": 3301.7245650100945, "comments": "comments", "includePricesInOrders": false, "contactEmail": "contactEmail", "contactName": "contactName", "externalId": "externalId", "customerNumber": "customerNumber", "emailStatus": {}, "deliveryDays": 9885, "name": "name", "includeShipmentAndMiscInPrice": false, "countryName": "countryName", "contactPhone": "contactPhone", "vatNumber": "vatNumber" }], "pageSize": 209, "page": 4803, "suppliersCount": 8190, "since": 474 }
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": 9287.304665349795, "country": "country", "comments": "comments", "includePricesInOrders": false, "city": "city", "contactEmail": "contactEmail", "contactName": "contactName", "externalId": "externalId", "language": "language", "customerNumber": "customerNumber", "buyPriceShipment": 8337.773405740096, "deliveryDays": 8158, "street": "street", "buyPriceMisc": 7329.385258029438, "name": "name", "includeShipmentAndMiscInPrice": true, "currency": "currency", "orgNumber": "orgNumber", "contactPhone": "contactPhone", "paymentTerms": "paymentTerms", "vatNumber": "vatNumber", "automaticOrder": false }
Successfull response:
{ "country": "country", "city": "city", "supplierExternalId": "supplierExternalId", "language": "language", "rate": 8723.249547825664, "buyPriceShipment": 2207.8659719157145, "street": "street", "buyPriceMisc": 2042.971457008562, "currency": "currency", "id": 4868, "orgNumber": "orgNumber", "paymentTerms": "paymentTerms", "openOrders": 2387, "automaticOrder": true, "zip": "zip", "buyPrice": 6413.823468129562, "comments": "comments", "includePricesInOrders": false, "contactEmail": "contactEmail", "contactName": "contactName", "externalId": "externalId", "customerNumber": "customerNumber", "emailStatus": {}, "deliveryDays": 7540, "name": "name", "includeShipmentAndMiscInPrice": false, "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": 7055.143751843671, "buyPriceShipment": 812.1837438787082, "street": "street", "buyPriceMisc": 5122.882422635646, "currency": "currency", "id": 2348, "orgNumber": "orgNumber", "paymentTerms": "paymentTerms", "openOrders": 376, "automaticOrder": false, "zip": "zip", "buyPrice": 2926.721292827208, "comments": "comments", "includePricesInOrders": true, "contactEmail": "contactEmail", "contactName": "contactName", "externalId": "externalId", "customerNumber": "customerNumber", "emailStatus": {}, "deliveryDays": 9829, "name": "name", "includeShipmentAndMiscInPrice": true, "countryName": "countryName", "contactPhone": "contactPhone", "vatNumber": "vatNumber" }
Successfull response:
{ "country": "country", "city": "city", "supplierExternalId": "supplierExternalId", "language": "language", "rate": 4711.335104768957, "buyPriceShipment": 1526.5005450912206, "street": "street", "buyPriceMisc": 3789.499546785217, "currency": "currency", "id": 6227, "orgNumber": "orgNumber", "paymentTerms": "paymentTerms", "openOrders": 4119, "automaticOrder": false, "zip": "zip", "buyPrice": 6121.860346041616, "comments": "comments", "includePricesInOrders": true, "contactEmail": "contactEmail", "contactName": "contactName", "externalId": "externalId", "customerNumber": "customerNumber", "emailStatus": {}, "deliveryDays": 9912, "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:
Supplier
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 |
SuppliersResponse
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 |