API Reference
Time

Calculate total leave days

post post /api/calculate total days calculates the total number of leave days in a given leave request, based on the start and end date the calculation takes into account the weekend days and public holidays for a given country request body parameters body parameters country string required string required the country where the leave will be taken, formatted as an iso alpha 2 code the information will be used to account for the weekend days and public holidays in the calculation 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 is half start date boolean boolean required required whether the start date will be taken as a half day leave default false is half end date boolean boolean required required whether the end date will be taken as a half day leave default false example requests curl x post 'https //api marcopayroll com/api\ benkock8/api/calculate total days' \\ h 'content type application/json' \\ h 'authorization $auth token' \\ d '{ "country" "cn", "start date" "2023/11/11", "end date" "2023/11/21", "is half start date" "false", "is half end date" "false" }'import requests url = "https //api marcopayroll com/api\ benkock8/api/calculate total days" payload={ "country" "cn", "start date" "2023/11/11", "end date" "2023/11/21", "is half start date" "false", "is half end date" "false" } headers = { "accept" "application/json", "authorization" "your auth token" } response = requests post(url, headers=headers, data=payload) print(response text){ "totaldays" 7 } response (200) totaldays integer integer the total number of leave days in a given leave request