Expense - Post outlay

API Url

Used for creating single outlay registration.

POST
http://localhost:16010/ProMarkREST/rest/Mileage/employees/{emp_id}/outlays

Permissions: user

Path parameters

FieldTypeDescription
emp_idString

Employee ID.

Parameter

FieldTypeDescription
requestObject

Main object containing the request data.

  dataObject

Object containg data to be uploaded.

    outlaysObject[]

Outlay registration to be created.

      dateDate

Registration date.

      descriptionoptionalString

Description

      questionsoptionalObject[]

Collection of questions.

        answerString

The answer to the question.

        answerDescriptionoptionalString

The answer description for those questions that are supplied also with a list of values.

        idString

Unique identifier for the question.

      receiptsObject[]

Collection of receipts.

        accountIdString

Account ID.

        commentoptionalString

Remarks in connection with the receipt.

        dateDate

Receipt date.

        entryNumber

Entry number.

        idString

Receipt identifier/number.

        valueNumber

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

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data.

          dataTypeNumber

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!

Size range: 0-10
          idString

Unique identifier for the question.

          inputTypeNumber

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!

Size range: 0-10
          isMandatoryBoolean

true = It is mandatory to enter an answer (select a value) on the question. Not to be changed on the client!

          labelString

Label to display on the question. Not to be changed on the client!

          maxValueNumber

Maximum value. Not to be changed on the client!

          minValueNumber

Minimum value. Not to be changed on the client!

          valueoptionalObject[]

Collection of question values.

            descriptionString

Description value.

            idString

Id of value.

    outlaysObject[]

Collection of outlays registrations.

      dateDate

Registration date.

      descriptionoptionalString

Description

      empIdString

Employee ID.

      questionsObject[]

Collection of questions.

      readOnlyBoolean

TRUE if the registration is read-only.

      receiptsObject[]

Collection of receipts.

        accountDescString

Account description.

        accountIdString

Account ID.

        commentoptionalString

Remarks in connection with the receipt.

        dateDate

Receipt date.

        entryNumber

Entry number.

        idString

Receipt identifier/number.

        valueNumber

Value on the receipt.

      transSeqNumber

Unique registration identifier.

  messageoptionalObject

Object containing response messages.

    codeNumber

Message code.

    textString

Message text.

    typeString

Type of message.

Allowed values:"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

FieldTypeDescription
responseObject

Main object containing the response data.

  dataObject

Object containing the requested data (empty).

  errorCodeNumber

Error code.

  errorMessageString

Error description.