Skip to content

Work shifts

Allows you to upload planned of punched work shifts. This is interesting when combined with number of visitors or receipts - are the sales people working during the busiest times?

If you are also recording breaks, you should send multiple entries per shift and just have suitable absence codes in place. We'll combine the shifts based on shift ids.

Operations

Upload list of work shifts

Request

POST https://api.zoined.com/workShifts?dryRun=false&separator=%3B&encoding=utf-8

Security
bearerAuth
Query
dryRunbooleanrequired

Only validate the request without storing the data

Example:dryRun=false
separatorstringrequired

Column separator used when loading CSV data

Example:separator=;
encodingstringrequired

Character encoding used in the CSV data (default is utf-8)

Example:encoding=utf-8
Body
Any of:
One of:
shift_idstringrequired

Unique identifier for the workshift

Example:"123"
organisation_idstringrequired

Organisation unit where shift will take place

Example:"234"
salesperson_idstring

Identifier of sales person / employee working. Required for punched shifts

Example:"345"
department_idstring

Store department ID

Example:"5401"
scheduledboolean

Whether this is scheduled or punched shift, default is false

Example:false
productiveboolean

Whether this is productive or administrative work, default is true

Example:true
active_work_timeboolean

Whether this shift is calculated in active work time, default is true

Example:true
start_datestringrequired

Shift date (yyyy-mm-dd)

Example:"2016-01-01"
start_timestringrequired

Shift starting time (HH:mm:ss)

Example:"15:00:00"
shift_typestring

Type of the shift. Freeform, will be available as dimension in portal.

Example:"Chef"
salary_typestring

Type of compensation for the shift.

Example:"Evening compensation"
staff_costnumber

Cost associated with this shift

Example:500
breaks_durationnumber

Total hours of breaks during this shift

Example:0.5
breaks_costnumber

Total salary cost associated for paid breaks during this shift

Example:40
overtime_durationnumber

Total overtime hours during this shift

Example:2
overtime_costnumber

Total salary cost associated for overtime hours

Example:120
absence_codestring

Code for the absence if this entry describes absence.

Example:"BREAK"
currencystring

Currency for the purchase price as ISO 4217 currency code. Required if multiple currencies are used.

Example:"EUR"
custom_field_1string

Field that can be used for custom dimensions

Example:"XYZ"
custom_field_2string

Field that can be used for custom dimensions

Example:"XYZ"
custom_field_3string

Field that can be used for custom dimensions

Example:"XYZ"
custom_field_4string

Field that can be used for custom dimensions

Example:"XYZ"
custom_field_5string

Field that can be used for custom dimensions

Example:"XYZ"
custom_metric_1number

Custom metric 1

Example:1
custom_metric_2number

Custom metric 2

Example:100
custom_metric_3number

Custom metric 3

Example:2.2
custom_metric_4number

Custom metric 4

Example:1.05
custom_metric_5number

Custom metric 5

Example:10000
source_systemstring

Identifier of the source system this data is from. Needed when mapping between source system identifiers and master identifiers are used.

Example:"ABCDEF"
durationnumberrequired

Duration of the shift in hours.

Example:8.15
curl -i -X POST \
  'https://zapi-api.zoined.com/_mock/workShifts?dryRun=false&separator=%3B&encoding=utf-8' \
  -H 'Authorization: Bearer <YOUR_token_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "shift_id": "123",
    "organisation_id": "234",
    "salesperson_id": "345",
    "department_id": "5401",
    "scheduled": false,
    "productive": true,
    "active_work_time": true,
    "start_date": "2016-01-01",
    "start_time": "15:00:00",
    "shift_type": "Chef",
    "salary_type": "Evening compensation",
    "staff_cost": 500,
    "breaks_duration": 0.5,
    "breaks_cost": 40,
    "overtime_duration": 2,
    "overtime_cost": 120,
    "absence_code": "BREAK",
    "currency": "EUR",
    "custom_field_1": "XYZ",
    "custom_field_2": "XYZ",
    "custom_field_3": "XYZ",
    "custom_field_4": "XYZ",
    "custom_field_5": "XYZ",
    "custom_metric_1": 1,
    "custom_metric_2": 100,
    "custom_metric_3": 2.2,
    "custom_metric_4": 1.05,
    "custom_metric_5": 10000,
    "source_system": "ABCDEF",
    "duration": 8.15
  }'

Responses

Request has been processed successfully.

Headers

  • Content-Type: application/json
Bodyapplication/json
statusstringrequired

Status of the operation OK / Not OK

Example:"OK"
msgstringrequired

Message describing result of operation

Example:"1 entity added"
Response
{ "status": "OK", "msg": "1 entity added" }