Expense - Post outlay
API Url
Used for creating single outlay registration.
http://localhost:16010/ProMarkREST/rest/Mileage/employees/{emp_id}/outlays
Permissions: user
Path parameters
| Field | Type | Description |
|---|---|---|
| emp_id | String | Employee ID. |
Parameter
| Field | Type | Description |
|---|---|---|
| request | Object | Main object containing the request data. |
| data | Object | Object containg data to be uploaded. |
| outlays | Object[] | Outlay registration to be created. |
| date | Date | Registration date. |
descriptionoptional | String | Description |
questionsoptional | Object[] | Collection of questions. |
| answer | String | The answer to the question. |
answerDescriptionoptional | String | The answer description for those questions that are supplied also with a list of values. |
| id | String | Unique identifier for the question. |
| receipts | Object[] | Collection of receipts. |
| accountId | String | Account ID. |
commentoptional | String | Remarks in connection with the receipt. |
| date | Date | Receipt date. |
| entry | Number | Entry number. |
| id | String | Receipt identifier/number. |
| value | Number | Value on the receipt. |
Request example:
{"request": {"data": {"outlays": [{"date": "2017-11-09","receipts": [{"entry": 1,"id": "12345","date": "2017-11-08","value": 1000,"comment": "External meal in connection to sales","accountId": "S100"},{"entry": 2,"id": "56789","date": "2017-11-09","value": 2000,"comment": "Fun with team","accountId": "B010"}]}]}}}
Success 200
| Field | Type | Description |
|---|---|---|
| response | Object | Main object containing the response data. |
| data | Object | Object containing the requested data. |
| dataType | Number | Data type of the question (0: Text, 1: Integer, 2: Decimal, 3: Boolean: 4: Date. 5: Time of day, 6: Date and time, 7: Time duration, 8: Time interval, 9: Date interval, 10: Date and time interval). Not to be changed on the client! 0-10 |
| id | String | Unique identifier for the question. |
| inputType | Number | Suggestion with controll type to display on the client (0: Standard input, depends on 'dataType', 1: Fill-in, 2: Drop-down, 3: Combo-box, 4: Text area, 5: Radio-set, 6: Check-box, 7: Selection list, 8: Calendar, 9: Calendar drop-down, 10: External lookup URI). Not to be changed on the client! 0-10 |
| isMandatory | Boolean | true = It is mandatory to enter an answer (select a value) on the question. Not to be changed on the client! |
| label | String | Label to display on the question. Not to be changed on the client! |
| maxValue | Number | Maximum value. Not to be changed on the client! |
| minValue | Number | Minimum value. Not to be changed on the client! |
valueoptional | Object[] | Collection of question values. |
| description | String | Description value. |
| id | String | Id of value. |
| outlays | Object[] | Collection of outlays registrations. |
| date | Date | Registration date. |
descriptionoptional | String | Description |
| empId | String | Employee ID. |
| questions | Object[] | Collection of questions. |
| readOnly | Boolean | TRUE if the registration is read-only. |
| receipts | Object[] | Collection of receipts. |
| accountDesc | String | Account description. |
| accountId | String | Account ID. |
commentoptional | String | Remarks in connection with the receipt. |
| date | Date | Receipt date. |
| entry | Number | Entry number. |
| id | String | Receipt identifier/number. |
| value | Number | Value on the receipt. |
| transSeq | Number | Unique registration identifier. |
messageoptional | Object | Object containing response messages. |
| code | Number | Message code. |
| text | String | Message text. |
| type | String | Type of message. "warning""info" |
Success example:
HTTP/1.1 200 OK{"response": {"data": {"outlays": [{"transSeq": 2349214,"date": "2017-11-09","empId": "414","readOnly": false,"receipts": [{"entry": 1,"id": "12345","date": "2017-11-08","value": 1000,"comment": "External meal in connection to sales","accountId": "S100","accountDesc": "Sale expenses"},{"entry": 2,"id": "56789","date": "2017-11-09","value": 2000,"comment": "Fun with team","accountId": "B010","accountDesc": "Other expenses"}]}]},"errorCode": 0,"errorMessage": ""}}
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. |