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
Body:
Successfull response:
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": 2737, "groupId": 678, "name": "name", "integration": "integration", "storePermissions": [{ "capabilities": [{}], "storeGroupId": 4397, "permissions": [{}], "isMaster": true, "name": "name", "currency": "currency", "language": "language", "storeId": 7416 }] }], "deviceKey": "deviceKey", "deviceId": "deviceId", "email": "email" }
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"}
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 |
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 | |||||
permissions | List | List of permissions current user has access to | READ_ITEMS(1), UPDATE_ITEMS(2), DELETE_ITEMS(4), READ_STORES(8), UPDATE_STORES(16), DELETE_STORES(32), READ_ADMINS(64), UPDATE_ADMINS(128), DELETE_ADMINS(256), SYSTEM_ADMIN(512), READ_CUSTOMER_ORDERS(1024), UPDATE_CUSTOMER_ORDERS(2048), DELETE_CUSTOMER_ORDERS(4096), FILTER_OUT_PRICES(8192), READ_INVENTORY(16384), UPDATE_INVENTORY(32768), HANDLE_INVENTORY(65536), FINISH_INVENTORY(131072), READ_SUPPLIER_ORDERS(262144), UPDATE_SUPPLIER_ORDERS(524288), DELETE_SUPPLIER_ORDERS(1048576), HANDLE_DELIVERY(2097152), FINISH_DELIVERY(4194304), READ_PICKING_LISTS(8388608), PICK_PICKING_LIST(16777216), FINISH_PICKING_LIST(33554432), CHECKOUT(67108864) | 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 |