PSOHub API - Expenses
Learn how to retrieve and create expenses in PSOhub
With this endpoint, you can find expenses that are related to a project and/or user and it will allow you to create expenses on a project.
Let's get started with seeing how you can retrieve expenses for a project and/or users
Get all expenses (filtered)
To get all timesheets, you can use the following endpoint
GET https://www.psohubapp.com/rest/psohubapi/v1/expenses?projectid=693467340
You can use the limit parameter to determine the number of records to return. If you don't send this, we will send back 50 expenses.
IMPORTANT: Because the expenses are always connected to a project and a user, it is required to filter on at least 1 of 2 parameters. Please see the mapping table below to understand which can be used.
If successful, the response will be this:
[
{
"AccountID": 39406496739494241,
"ProjectID": 13229323905419233,
"ContractLineID": 7036874417785905,
"ProjectName": "Apple App Development",
"ContractLineName": "20.002 - Expenses ",
"Description": "NYC hotel ",
"AmountExVAT": 991.73553719,
"VATAmount": 208.26446281,
"TotalAmount": 1200
},
{
"AccountID": 39406496739494241,
"ProjectID": 13229323905421635,
"ContractLineID": 7036874417787659,
"ProjectName": "Development Website and Marketing Automation",
"ContractLineName": "90.001 - Travel Expenses",
"Description": "nyc - amsterdam",
"AmountExVAT": 743.80165289,
"VATAmount": 156.19834711,
"TotalAmount": 900
}]
The following fields will be returned to you
Name |
Type |
Description |
DateTimeFrom |
DateTime |
Start date and time of the booking |
DateTimeTo |
DateTime |
End date and time of the booking |
NumberOfHours |
Decimal |
the email of the contact |
AccountID |
Integer/long |
the PSOHub ID of the company |
ProjectID |
Integer/long |
The ID of the project |
ContractLineID |
Integer/long |
The ID of the contract line |
RoleID |
Integer/long |
The ID of the project role for the user |
AccountName |
String |
The name of the user that booked the hours |
ProjectName |
String |
The name of the project, for easy reference |
ContractLineName |
String |
The name of the contract line, for easy reference |
RoleName |
String |
The name of the project role, for easy reference |
Description |
String |
The description the user added for the booking |
Create a timesheet
Creating a timesheet in PSOhub requires several mandatory fields to be filled to make sure the timesheet ends up in the correct place. Please see the table below for the fields and how to retrieve them in PSOhub.
Name |
Required |
Type |
Description |
DateTimeFrom |
Yes |
DateTime |
Start date and time of the booking |
DateTimeTo |
Yes |
DateTime |
End date and time of the booking |
NumberOfHours |
Yes |
Decimal |
Total number of hours booked |
AccountID |
Yes |
Integer/long |
the PSOHub ID of the company |
ProjectID |
Yes |
Integer/long |
The ID of the project |
ContractLineID |
Yes |
Integer/long |
The ID of the contract line |
RoleID |
Yes |
Integer/long |
The ID of the project role for the user |
Description |
No |
String |
The description the user added for the booking |
POST https://www.psohubapp.com/rest/psohubapi/v1/timesheets
An example of this is
{
"DateTimeFrom": "2024-09-23T08:00:00.000Z",
"DateTimeTo": "2024-09-23T16:00:00.000Z",
"NumberOfHours": 8,
"AccountID": 39406496739494241,
"ProjectID": 13229323915858894,
"ContractLineID": 7036874429341080,
"RoleID": 9851624184876568,
"Description": "Booked via API"
}
If created successfully, you will get a response like below
{"TimesheetID":"ef2e44e2-9126-4012-9e02-25c1eb12e98d"}