API calls to check fiscal year transition

Are you using an API connection? To ensure that process numberings and postings occur in the correct fiscal year, you can perform API calls to check which fiscal year the API user is currently in and to switch fiscal years. This article contains an example API call for both situations.

 


 

Within MKG, process numberings are based on the fiscal year currently in use. If a user is working in fiscal year 2025 and, for example, creates a new sales order, the sales order number starts with 3025. After creating a new fiscal year, the sales order number will start with 3026, once you have switched to fiscal year 2026 and create a new sales order.

The API performs actions via an API user who also operates within a specific fiscal year. To ensure that process numberings and postings continue to occur in the correct fiscal year, you can perform API calls to check which fiscal year the API user is currently in and to switch fiscal years. Two examples of API calls:

 

Example 1: Check current API user

 

GET {{restUrl}} /Settings?Settings=Administration,FiscalYear,Language

Response:


{
    "response": {
        "ResultData": [
            {
                "t_setting":[
                    {
                        "t_name": "Administration",
                        "t_value": "1"
                    },
                    {
                        "t_name": "FiscalYear",
                        "t_value": "2025"
                    },
                    {
                        "t_name": "Language",
                        "t_value": "1043"
                    }
                ]
            }
        ]
    }
}


 

Example 2: Switch fiscal year

 

PUT {{restUrl}} /Settings

Body:


{
    "request": {
        "InputData": {
            "t_setting": [
                {
                    "t_name": "Administration",
                    "t_value": "1"
                },
                {
                    "t_name": "FiscalYear",
                    "t_value": "2026"
                }
            ]
        }
    }
}


 

Response:


{
    "response": {
        "ResultData": [
            {
                "t_setting": [
                    {
                        "t_name": "Administration",
                        "t_value": "1"
                    },
                    {
                        "t_name": "FiscalYear",
                        "t_value": "2026"
                    }
                ]
            }
        ]
    }
}


 

 

Kan afbeelding niet inladen

Please note!
If the API MKG user in the Users module is only authorized for the current fiscal year, this restriction is automatically applied in the processing of all API calls. This means the user only has access to data within that active fiscal year. Therefore, the fiscal year selection does not need to be manually set or adjusted via the API. This prevents error-prone manual interventions and ensures the API automatically operates within the correct context, based on the rights of the linked MKG user.