Add new time off record

Before you add new time off record:

  • The applicant must have this leave type in the country.

  • There must be no existing time record for the requested period.

  • Before invoking this interface, call the Calculate time off total days interface. Make sure the application period includes valid days.

Add time off record

POST /add-ee-time-off

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Required
Description

customer_id

string

The unique Marco identifier for your company.

email

string

Account email of the user

leave_type_name

string

Leave type name

leave_type_country

string

Leave type country

lang

string

Leave type language

start_date

date

Start date of the date range filter, only time-off records after the selected date will be returned

end_date

date

End Date of the date range filter, only time off records after the selected date will be returned

start_date_day_type

string

Format as "Full"/"First Half"/"Second Half"

end_date_day_type

string

Format as "Full"/"First Half"/"Second Half"

notes

string

Time off notes

decision

string

Time off approval decision Format as "Approve" or "Reject"

decision_time

datetime

yyyyMMdd HHmmss

reject_notes

string

If manager reject this time off ,need to fill up rejected notes

unit_type

string

which calculate unit type do you want to add? Format as: "Hours" or "Days" If it is empty, default as "Days". *1 day = 8 hours

total_hours

float

If balance_type is "Hours", here need to fill up the total hours

files

list of file resource

Time off related files

*If you want to add a hourly time off, the start_date and end_date must to be a same day, and the start_date_day_type and end_date_day_type must to be "Full".

Parameter Example

{
  "customer_id": "1",
  "vendor_id": "162",
  "email": "[email protected]",
  "leave_type_name": "Bereavement Leave",
  "leave_type_country": "AR",
  "lang": "EN",
  "start_date": "2024-10-06",
  "end_date": "2024-10-06",
  "start_date_day_type": "Full",
  "end_date_day_type": "Full",
  "notes": "",
  "decision": "",
  "decision_time": null,
  "reject_notes": "",
  "unit_type": "Days",
  "total_hours": ""
}

Response

{
    "id": 1235,
    "customer_id": 1,
    "leave_type": 10,
    "start_date": "2024-10-06",
    "end_date": "2024-10-06",
    "notes": "",
    "doc_list": [],
    "approver": 0,
    "decision_time": null,
    "decision": "",
    "reject_notes": "",
    "user": 7,
    "unit_type": "Days",
    "platform_email": "[email protected]"
}

Last updated