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.
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
Content-type: application/json or application/xml
Get a valid webtoken to use for automatic login to web-app
Reset password
POSTUrl: /reset
Headers:
Accept: application/json or application/xml
Content-type: 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"}
Get app version
POSTUrl: /version
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Content-type: application/json or application/xml
Get mobile application version
Login using a mobile device
POSTUrl: /login
Headers:
Accept: application/json or application/xml
Content-type: 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": 8635, "groupId": 1028, "name": "name", "integration": "integration", "storePermissions": [{ "role": { "storeGroupId": 97, "paths": {}, "name": "name", "id": 9284, "fields": {}, "portal": "portal", "users": 8055 }, "capabilities": [{}], "storeGroupId": 4637, "isMaster": true, "name": "name", "currency": "currency", "language": "language", "storeId": 8653 }] }], "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
Content-type: application/json or application/xml
Update mobile device's push-id
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 | |||||
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 |
---|---|---|---|---|---|---|---|
String | true | R,W |
MobileResetPasswordResponse
Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
---|---|---|---|---|---|---|---|
String | R |
MobileVersionRequest
Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
---|---|---|---|---|---|---|---|
version | String | R,W | |||||
build | String | R,W |
Role
Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
---|---|---|---|---|---|---|---|
id | Long | R | |||||
storeGroupId | Long | R | |||||
name | String | R,W | |||||
paths | ArrayList | 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 |