Travel

Entity that works like an inbetween between external system and our backend. This gives the user the opportunity to control the travels and choose where to send them next(PayrollRun/SupplierInvoice).

Name Type Description Expected
TravelIdentificator string(256) Remote system identificator for travel. Content is left-truncated if more than 256 characters Yes
SourceSystem string(256) Texttdescription of remote system. Should be used to identify the remote system.(case sensitive) Yes
Description string(1024) Description field opt
Purpose string(1024) Purpose of the travel opt
Comment string(1024) Comments opt
Name string(512) Name of the travel reporter (in most cases the employee) opt
Email string(512) E-mail to the reporter (used to try to couple user with employee) opt
Phone string(256) Phone number opt
PersonID string(256) Person identification in remote system. yes
EmployeeNumber int EmployeeNumber. Api will infer this based on other tavels with equal source system and PersonID opt
SupplierID int SupplierID. Api will infer this based on other travel with equal source system and PersonID opt
TravelLines TravelLine[] List of travel/expenselines opt
State state(Received = 0, Processed = 1, PartlyProcessed = 2, Rejected = 3) State of the travel/expense. This is handled by our backend, but is handy for checking where the travel/expense is in the process. no(handled by our backend)

Travel Routes

Route Methods Description
/api/biz/travels GET, PUT, DELETE, POST Travels. Can also expand lines here.

TravelLine

Sub entity of Travel. Here we have information regarding all the details regarding travel/expense

Name Type Description expected
TravelID int relation to Travel yes(unless travel line is created with complex put/post)
paytransID int (loose) pointer to payment transaction id(handled by the api) no(handled by backend)
From DateTime From DateTime(format: “yyyy-MM-ddThh:mm:ss”) yes
To DateTime To DateTime yes
Amount decimal The amount on the line yes
Rate decimal the rate on the line, where sum is Amount * Rate yes
Description string(1024) Line description yes
TravelIdentificator string(256) Travelidentification in foreign system. Fields is left truncated. yes
LineState state(Received = 0, Processed = 1, Rejected = 3) State of the line. Handled by backend. no(handled by backend)
CostType costtype(Travel = 0, Expense = 1) tells us if the TravelLine is an expense or in relation to a travel is travel if not set
TypeID int ID for TravelType. Needed for importing travel to pay, because TravelType maps to a WageType. (Travel type is a map type between your travel type id and our wage types) yes
AccountNumber int ledger account yes
VatTypeID int ID for VatType opt

Travel lines routes

Route Methods Description
/api/biz/travellines GET,PUT,DELETE,POST TravelLines.

TravelType

Link between external travel type and WageType in backend. We use this to set WageType on salary transaction when sending travels to salary.

Name Type Description
ForeignDescription string(256) Description in external system
ForeignTypeID string(256) Reference to external system travel type
Description string(256) description in backend. Can be name of wage type
WageTypeNumber int number on Wage type. NB: not ID on WageType, but WageTypeNumber on WageType.

Travel type routes

Route Methods Description
/api/biz/traveltype GET,PUT,DELETE,POST TravelTypes.

Example

creating a travel type

before you send in any travels, it is a good idea to create the travel types you need. We have functionallity for the user to fill in the blanks in our front end, but it is a better experience if this is already taken care of.

you do this by posting to api/biz/traveltype with something like this in body

{
    "ForeignDescription": "Hotel",
    "ForeignTypeID": "1",
    "WageTypeNumber": 380
}

wich will give this result

{
    "ForeignDescription": "Hotel",
    "ForeignTypeID": "1",
    "Description": null,
    "WageTypeNumber": 380,
    "StatusCode": null,
    "CustomValues": null,
    "ID": 72,
    "Deleted": false,
    "CreatedAt": "2019-01-23T13:15:46.3851458Z",
    "UpdatedAt": null,
    "CreatedBy": "f8da20ad-fa6d-43d4-a0ad-39431b00dbd1",
    "UpdatedBy": null,
    "_validationResults": {}
}

creating a travel

we need to send in a travel report where the employee has sendt a bill for his hotel. The way we do it is by posting a travel with the needed info and a travelline where the amount and rate is. Also we use the travel type we just created.

so we POST to api/biz/travels with this in body

{
    "Comment": "",
    "Description": "Travel bill 24.04.2018",
    "Email": "employee@mail.com",
    "Name": "Employee Test UE",
    "PersonID": "10224",
    "Purpose": "My report 24.04.2018",
    "SourceSystem": "ExternalSystemNameHere",
    "TravelIdentificator": "99917",
    "TravelLines": [
        {
            "CustomValues": {},
            "Amount": 1,
            "Description": "Hotell",
            "From": "2018-04-24T15:05:00Z",
            "Rate": 1200,
            "To": "2018-04-24T15:05:00Z",
            "_createguid": "{some random guid(see complex put)}",
            "TravelIdentificator": "536936",
            "TypeID": 72
        }
    ]
}

and get the result

{
    "TravelIdentificator": "99917",
    "SourceSystem": "ExternalSystemNameHere",
    "Description": "Travel bill 24.04.2018",
    "Purpose": "My report 24.04.2018",
    "Comment": "",
    "Name": "Employee Test UE",
    "Email": "employee@mail.com",
    "Phone": null,
    "PersonID": "10224",
    "TravelLines": [
        {
            "Travel": null,
            "TravelID": 61,
            "paytransID": null,
            "AccountNumber": null,
            "VatType": null,
            "VatTypeID": null,
            "From": "2018-04-24T15:05:00Z",
            "To": "2018-04-24T15:05:00Z",
            "Amount": 1,
            "Rate": 1200,
            "Description": "Hotell",
            "TravelIdentificator": "536936",
            "LineState": 0,
            "CostType": 0,
            "TypeID": 72,
            "travelType": null,
            "StatusCode": null,
            "CustomValues": null,
            "ID": 31,
            "Deleted": false,
            "CreatedAt": "2019-01-23T13:03:33.8379454Z",
            "UpdatedAt": null,
            "CreatedBy": "f8da20ad-fa6d-43d4-a0ad-39431b00dbd1",
            "UpdatedBy": null,
            "_createguid": "eb4ff54b-5437-4699-93c7-65f02908caeb",
            "_validationResults": {}
        }
    ],
    "State": 0,
    "EmployeeNumber": null,
    "SupplierID": null,
    "StatusCode": null,
    "CustomValues": null,
    "ID": 61,
    "Deleted": false,
    "CreatedAt": "2019-01-23T13:03:33.8079601Z",
    "UpdatedAt": null,
    "CreatedBy": "f8da20ad-fa6d-43d4-a0ad-39431b00dbd1",
    "UpdatedBy": null,
    "_validationResults": {}
}