Goto APIs

Mobile API

General:

Basics:

Base-URL: https://capi.lagerkoll.com/v1/mobile/
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:

Accept: application/json
Content-Type: application/json

Errors:

Code Description
900001 Credentials don't match
900101 Common error
900429 Too many requests
901302 Error when login in from mobile device
901303 Error when resetting password from mobile device
{
  "errorCode" : 900101,
  "errorMessage" : "Something went wrong on the server",
  "errorField" : null,
  "errorData" : null
}

Mobile API:

Login

Get webtoken

GETUrl: /webtoken
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Get a valid webtoken to use for automatic login to web-app
Body:
Successfull response:

{ "accountId": 7813, "storeId": 6114, "token": "token" }

Get app version

GETUrl: /version
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Get mobile application version
Body:
Successfull response:

Reset password

POSTUrl: /reset
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Sends an email to provided user with instructions on how to reset password
Body:

{"email": "email"}
Successfull response:

{"email": "email"}

Login using a mobile device

POSTUrl: /login
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Logging in using a mobile device either registers a new device for the account or updates the device with latest push-id. A list of accessible stores are returned
Body:

{ "pushId": "pushId", "deviceType": "deviceType", "password": "password", "deviceKey": "deviceKey", "userAgent": "userAgent", "clientVersion": "clientVersion", "deviceId": "deviceId", "username": "username", "token": "token" }
Successfull response:

{ "phone": "phone", "name": "name", "storeGroups": [{ "stores": 3676, "groupId": 7840, "name": "name", "integration": "integration", "storePermissions": [{ "role": { "storeGroupId": 1037, "paths": [{ "path": "path", "action": "action" }], "name": "name", "id": 6604, "fields": {}, "portal": "portal", "users": 3790 }, "capabilities": [{}], "storeGroupId": 2516, "isMaster": false, "name": "name", "currency": "currency", "language": "language", "storeId": 7745 }] }], "deviceKey": "deviceKey", "deviceId": "deviceId", "email": "email" }

Update push-id

PUTUrl: /push
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Update mobile device's push-id
Body:

{"pushId": "pushId"}
Successfull response:

Classes:

MobileLogin

Field Type Description Default Mandatory Accepted values Example values Access
deviceId String true R,W
userAgent String true R,W
username String Login using username/password or deviceId/deviceKey combination. If deviceKey is missing username/password are mandatory true R,W
password String Login using username/password or deviceId/deviceKey combination. If deviceKey is missing username/password are mandatory true R,W
token String If a user has previously logged in and gained a webtoken, this token can be used instead of username and password true R,W
deviceKey String Mandatory if username and password are missing. If device has already been registered the deviceId and deviceKey can be used to login true R,W
pushId String Id used for sending push message from server to client true R,W
deviceType String Describes if this is Android or iOS true inventory_android, inventory_ios R,W
clientVersion String Version of the installed client on the device true R,W

MobileLoginResponse

Field Type Description Default Mandatory Accepted values Example values Access
name String R
email String R
phone String R
deviceId String R
deviceKey String R
storeGroups List R

MobilePushData

Field Type Description Default Mandatory Accepted values Example values Access
pushId String Id used for sending push message from server to client true R,W

MobileResetPassword

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

MobileResetPasswordResponse

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

Role

Field Type Description Default Mandatory Accepted values Example values Access
id Long R
storeGroupId Long R
name String R,W
paths List List of paths role has access to R,W
fields HashMap List of objects and fields that is filtered out when sending data to api and request data from api R,W
portal String What part of Lagerkoll is the role used ADMIN, SHOP R,W
users int Number of users connected to role R

StoreGroup

Field Type Description Default Mandatory Accepted values Example values Access
groupId long R
name String R
stores int R
storePermissions List R
integration String R

StorePermission

Field Type Description Default Mandatory Accepted values Example values Access
storeId long R
storeGroupId long R
name String R
currency String R
language String R
role Role Role current user has access to R
capabilities List List of capabilities current user has access to MAIN_INVENTORY(1), INVENTORY_CREATE_NEW(101), INVENTORY_FINISH_LIST(102), MAIN_PRODUCT(2), PRODUCT_CREATE_NEW(201), PRODUCT_EDIT_EXISTING(202), PRODUCT_VIEW_PRICES(203), PRODUCT_UNIT_CREATE_NEW(204), MAIN_ORDER(5), ORDER_CREATE_NEW(501), MAIN_DELIVERY(6), DELIVERY_CLOSE_ORDER(601), MAIN_PICKING_LISTS(7), PICKING_LISTS_PICK(701), PICKING_LISTS_FINISH(702), MAIN_CHECKOUT(8), CHECKOUT(801), CHECKIN(802), MAIN_CUSTOMER_ORDER(9), CUSTOMER_ORDER_CREATE_NEW(901), BATCHES(1001) R
isMaster Boolean True if this is the master stock R

WebToken

Field Type Description Default Mandatory Accepted values Example values Access
accountId long R
storeId long R
token String R