API Reference
Time
Add time-off record
post post /api/apply ee time off adds a time off record to one staff, using the user id in your system (external id) the time off record can be added in your language of choice request body parameters body parameters customer id integer required integer required the unique marco identifier for your company customer system id string required string required the staff's unique identifier in your company's system example 50 leave type string required string required the leave type example sick leave lang string required string required the language settings, formatted as an uppercase iso 639 1 code the leave type information should be sent in the selected language valid values en, zh country string required string required the country where the leave will be taken, formatted as an iso alpha 2 code example jp start date string required string required the start date of the leave request, formatted as yyyy mm dd example 2023 12 31 end date string required string required the end date of the leave request, formatted as yyyy mm dd total days string required string required the total number of days in the leave request notes string optional string optional the notes for the time off record typically contains the reason for the leave application decision string string optional optional the decision for the leave request valid values approve, reject example requests curl x post 'https //api marcopayroll com/api\ benkock8/api/apply ee time off' \\ h 'content type application/json' \\ h 'authorization $auth token' \\ d '{ "customer id" "99", "customer system id" "5555", "leave type" "sick leave", "lang" "en", "country" "my", "start date" "2022 10 08", "end date" "2022 10 09", "total days" "2", "notes" "stomach\ infection", "decision" "" }'import requests url = "https //api marcopayroll com/api\ benkock8/api/apply ee time off" payload={ "customer id" "99", "customer system id" "5555", "leave type" "sick leave", "lang" "en", "country" "my", "start date" "2022 10 08", "end date" "2022 10 09", "total days" "2", "notes" "stomach\ infection", "decision" "" } headers = { "accept" "application/json", "authorization" "your auth token" } response = requests post(url, headers=headers, data=payload) print(response text){ "time off data" { "id" 1111, "user" 55, "customer id" 99, "leave type" 2, "approver" 0, "total days" 2, "start date" "2022 10 08", "end date" "2022 10 09", "notes" "stomach\ infection", "reject notes" "", "decision time" 1665564058828, "decision" "", "doc list" \[], "created at" 1665564058831, "updated at" 1665564058831, "deleted at" null, "last modified by" 123 }, "message" "successfully added" } response (200) {time off data} object object t he time off record details {time off data} id integer integer the unique marco identifier for the staff's time off record {time off data} user integer integer the unique marco identifier for the staff {time off data} customer id integer integer the staff's unique identifier in your company's system example 50 {time off data} leave type integer integer the unique marco identifier for the leave type {time off data} approver integer integer the unique marco identifier for the approver {time off data} total days integer integer the total number of days in the leave request {time off data} start date string string the start date of the leave request, formatted as yyyy mm dd example 2023 12 31 {time off data} end date string string the end date of the leave request, formatted as yyyy mm dd {time off data} notes string string the notes for the time off record typically contains the reason for the leave application {time off data} reject notes string string the rejection notes for the time off record, if rejected {time off data} decision string string the decision for the leave request valid values approve, reject {time off data} doc list array\[string] array\[string] the supporting documents for the leave application {time off data} created at integer integer unix timestamp for the time off record's creation date {time off data} updated at integer integer unix timestamp for the time off record's update date {time off data} deleted at integer integer unix timestamp for the time off record's deletion date {time off data} last modified by integer integer the unique marco identifier for the user who last modified the leave item details message string string the endpoint response status