schedule.trade

Management of individual trades.

SUPPORTED METHODS:

GET

ParametersTypeDecription
token (required)Valid token
id (required)integerTrade id

CREATE

ParametersTypeDescription
token (required)Valid token
shift (required)integerShift id
tradewith (required)varcharTrade with - traders id

Array of traders ids (eg. "145,567")
reason (required)varcharReason

UPDATE

ParametersTypeDescription
token (required)Valid token
trade (required)integerTrade id
action (required)enum (activate, deactivate, cancel, accept, reject)required: Require trade
deactivate: Deactivate trade
cancel: Cancel trade
accept: Accept trade
reject: Reject trade
user (accepted)integerUser id

DOCUMENTATION

GET
Retrieves an individual trades.
Level 5 is required (all users can fetch this module)

--

Example Request:

{
   "module":"schedule.trade",
   "method":"GET",
   "request":{
      "id":"159"
   }
}

Example Response:

{
   "status":"1",
   "data":{
      "id":"265",
      "status":"0",
      "user":"654",
      "shift":"97250",
      "store":"11",
      "reference":"",
      "reason":"No big reason",
      "date":"1339498178",
      "confirm_before":"0",
      "confirm_after":"0",
      "trade_to":"0",
      "shift_start_date":{
         "id":"1110",
         "month":"5",
         "day":"13",
         "year":"2017",
         "weekday":"Sun",
         "mname":"May",
         "week":"20",
         "dayid":"1",
         "formatted":"May 13, 2017"
      },
      "shift_start":"33",
      "shift_end":"73",
      "shift_schedule":"33499",
      "schedule_name":"Budget 1",
      "user_name":"Andy",
      "requested":{
         "id":"1110",
         "month":"5",
         "day":"13",
         "year":"2017",
         "weekday":"Sun",
         "mname":"May",
         "week":"20",
         "dayid":"1",
         "formatted":"May 13, 2017"
      },
      "shift_start_time":"8 am",
      "shift_end_time":"6 pm",
      "traders":{
         "count":"2",
         "data":[
            {
               "id":"2265",
               "trade_id":"245",
               "shift":"94220",
               "user":"5123",
               "confirmed":"0",
               "approved":"0",
               "sms":"0",
               "email":"0",
               "online":"0",
               "user_name":"Azra"
            },
            {
               "id":"2267",
               "trade_id":"245",
               "shift":"94220",
               "user":"5188",
               "confirmed":"0",
               "approved":"0",
               "sms":"0",
               "email":"0",
               "online":"0",
               "user_name":"Johny"
            }
         ]
      }
   },
   "token":"xxxxxxxx"
}

CREATE
Creates an individual trades.
Level 5 is required (all users can fetch this module)

--

Example Request:

{
   "module":"schedule.trade",
   "method":"CREATE",
   "request":{
      "shift":"97250",
      "reason":"No big reason",
      "tradewith":"1110"
   }
}

Example Response:

{
   "status":"1",
   "data":{
      "id":"265",
      "status":"0",
      "user":"654",
      "shift":"97250",
      "store":"11",
      "reference":"",
      "reason":"No big reason",
      "date":"1339498178",
      "confirm_before":"0",
      "confirm_after":"0",
      "trade_to":"0",
      "shift_start_date":{
         "id":"1110",
         "month":"5",
         "day":"13",
         "year":"2017",
         "weekday":"Sun",
         "mname":"May",
         "week":"20",
         "dayid":"1",
         "formatted":"May 13, 2017"
      },
      "shift_start":"33",
      "shift_end":"73",
      "shift_schedule":"33499",
      "schedule_name":"Budget 1",
      "user_name":"Andy",
      "requested":{
         "id":"1110",
         "month":"5",
         "day":"13",
         "year":"2017",
         "weekday":"Sun",
         "mname":"May",
         "week":"20",
         "dayid":"1",
         "formatted":"May 13, 2017"
      },
      "shift_start_time":"8 am",
      "shift_end_time":"6 pm",
      "traders":{
         "count":"2",
         "data":[
            {
               "id":"2265",
               "trade_id":"245",
               "shift":"94220",
               "user":"5123",
               "confirmed":"0",
               "approved":"1",
               "sms":"0",
               "email":"0",
               "online":"0",
               "user_name":"Azra"
            },
            {
               "id":"2267",
               "trade_id":"245",
               "shift":"94220",
               "user":"5188",
               "confirmed":"0",
               "approved":"0",
               "sms":"0",
               "email":"0",
               "online":"0",
               "user_name":"Johny"
            }
         ]
      }
   },
   "token":"xxxxxxxx"
}

UPDATE
Updates an individual trades.
Level 5 is required (all users can fetch this module)

--

Parameters:

Example Request:

{
   "module":"schedule.trade",
   "method":"GET",
   "request":{
      "trade":"265",
      "action":"accept"
   }
}

Example Response:

{
   "status":"1",
   "data":{
      "id":"265",
      "status":"0",
      "user":"654",
      "shift":"97250",
      "store":"11",
      "reference":"",
      "reason":"No big reason",
      "date":"1339498178",
      "confirm_before":"0",
      "confirm_after":"0",
      "trade_to":"0",
      "shift_start_date":{
         "id":"1110",
         "month":"5",
         "day":"13",
         "year":"2017",
         "weekday":"Sun",
         "mname":"May",
         "week":"20",
         "dayid":"1",
         "formatted":"May 13, 2017"
      },
      "shift_start":"33",
      "shift_end":"73",
      "shift_schedule":"33499",
      "schedule_name":"Budget 1",
      "user_name":"Andy",
      "requested":{
         "id":"1110",
         "month":"5",
         "day":"13",
         "year":"2017",
         "weekday":"Sun",
         "mname":"May",
         "week":"20",
         "dayid":"1",
         "formatted":"May 13, 2017"
      },
      "shift_start_time":"8 am",
      "shift_end_time":"6 pm",
      "traders":{
         "count":"2",
         "data":[
            {
               "id":"2265",
               "trade_id":"245",
               "shift":"94220",
               "user":"5123",
               "confirmed":"0",
               "approved":"1",
               "sms":"0",
               "email":"0",
               "online":"0",
               "user_name":"Azra"
            },
            {
               "id":"2267",
               "trade_id":"245",
               "shift":"94220",
               "user":"5188",
               "confirmed":"0",
               "approved":"0",
               "sms":"0",
               "email":"0",
               "online":"0",
               "user_name":"Johny"
            }
         ]
      }
   },
   "token":"xxxxxxxx"
}