Budgets - Create a budget period
API Url
Use it to create a new budget period
POST
http://localhost:16010/ProMarkREST/web/System/Budgets/{id}/periods
Permissions: user
Request headers
| Field | Type | Description |
|---|---|---|
Accept-Languageoptional | String | =en-GB Language use for localization. |
X-Clientoptional | String | =Client type. "Portal""Mobile""Admin" |
X-Roleoptional | Number | ProMark role (1: Employee, 2: User). {12} |
X-WebPart-Idoptional | Number | Unique web-part identifier. |
Path parameters
| Field | Type | Description |
|---|---|---|
| id | Number | Budget id. |
Parameter
| Field | Type | Description |
|---|---|---|
| request | Object | Main object containing the request data. |
| data | Object | Object containg data to be uploaded. |
| budgetPeriods | Object[] | |
| budgetId | String | The budget ID for which the period is created |
| budgetValue | Number | The budget value. |
| contextId | String | The parent id of the budget. |
| contextType | Number | The parent type of the budget. |
| from | Date | Start date of the new period |
| periodDays | Object[] | Array with information about the days in the period. |
| calculatedValue | Number | The calculated value for the day. |
| day | Date | Date of a day in period |
| factor | Number | Factor of the day |
| rotationLength | Number | The length of the period. |
Request example:
{"request": {"data": {"budgetPeriods": [{"budgetId": "123","from": "2020-05-12","rotationLength": 7,"budgetValue": 2000,"contextType": 1,"contextId": "Dept1","periodDays": [{"periodId": 44452,"day": "2020-05-12","factor": 1,"calculatedValue": 100,"actualValue": 200},{"periodId": 44452,"day": "2020-05-13","factor": 1,"calculatedValue": 200},{"periodId": 4452,"day": "2020-05-14","factor": 1,"calculatedValue": 200},{"periodId": 44452,"day": "2020-05-15","factor": 1,"calculatedValue": 200},{"periodId": 44452,"day": "2020-05-16","factor": 2,"calculatedValue": 400},{"periodId": 44452,"day": "2020-05-17","factor": 2,"calculatedValue": 400},{"periodId": 44452,"day": "2020-05-18","factor": 2,"calculatedValue": 400}]}]}}}
Error 4xx
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data (empty). |
| errorCode | Number | Error code. |
| errorMessage | String | Error description. |