Check readiness to start a session
Checks whether the signed-in user can start a session such as a van sales day or a POS shift, and returns any blocking issues, for example a missing route plan, vehicle or register, or a day already open.
How to use it
- Send sessionType and businessDate, plus registerId for a POS_SHIFT, or storeId/venueId for an ECOM_BATCH.
- For a DAY_CYCLE, send routePlanId and vehicleId, or omit them to use the user's assigned vehicle and its paired route plan.
- If blockingIssues is empty, start the session (for a van sales day, Start a day cycle). Nothing is changed by this check.
BearerAuthAuthorizationBearer <JWT>application/json- body
sessionType*stringSession to check: DAY_CYCLE (van sales day), POS_SHIFT (till shift), ECOM_BATCH (online order batch) or OTHER_APP. Required.
"DAY_CYCLE""POS_SHIFT""ECOM_BATCH""OTHER_APP"businessDate*stringBusiness date the session would start on (YYYY-MM-DD). Required.
dateregisterId?|Register to use; required for POS_SHIFT. From List registers.
int64storeId?|Store for an ECOM_BATCH; storeId or venueId is required for that type. From List stores.
int64venueId?|Venue for an ECOM_BATCH; storeId or venueId is required for that type. From List venues.
int64routePlanId?|Route plan for a DAY_CYCLE. Optional if the user's vehicle is paired with a route plan.
uuidvehicleId?|Vehicle for a DAY_CYCLE. Optional if a vehicle is assigned to the user.
uuiddeviceId?|Optional identifier of the device making the check.
clientApp?|Optional name of the calling app.
clientVersion?|Optional version of the calling app.
lastSyncAt?|When the device last synced data (ISO 8601 date-time). Omit to be told which feeds to sync.
date-timeOK
*/*- response
status*stringOutcome of the request: SUCCESS when it worked; errors return an error status with the reason in message.
message*stringShort human-readable message describing the outcome.
data?The readiness check result, including any blocking issues.
curl -X POST 'https://beta.iotoms.com/api/v1/ops/sessions/preflight' \ -H 'Content-Type: application/json' \ -d '{ "sessionType": "DAY_CYCLE", "businessDate": "2019-08-24"}'{ "status": "string", "message": "string", "data": { "sessionType": "DAY_CYCLE", "businessDate": "2019-08-24", "expectedOpeningCash": 0, "currencyCode": "string", "assignedVehicle": { "vehicleId": "c406adf4-e700-4483-ad7a-e7447a2941cb", "vehicleNumber": "string", "vehicleLabel": "string", "vehicleType": "VAN", "status": "ACTIVE", "lastOdometerKm": 0 }, "routePlan": { "routePlanId": "b7d64f28-bbfd-4033-80f5-b73a04c2781d", "planName": "string", "totalStores": 0, "coverageTarget": 0 }, "inventoryPreview": { "sessionId": "f6567dd8-e069-418e-8893-7d22fcf12459", "totalSkuCount": 0, "totalValue": 0, "highValueItems": [ { "itemId": "string", "itemName": "string", "quantity": 0, "value": 0 } ] }, "lastSessionSummary": { "lastBusinessDate": "2019-08-24", "status": "string", "cashVariance": 0, "inventoryVariance": 0 }, "requiredChecks": [ "GPS_ENABLED" ], "blockingIssues": [ { "code": "string", "message": "string" } ], "syncNeeds": [ { "feed": "string", "reason": "string", "lastUpdatedAt": "2019-08-24T14:15:22Z" } ] }}