Skip to content

Time Entries

Manage time entries in Moneybird.

Working with Time Entries

This section covers how to interact with Moneybird’s Time Entries API. You can create, retrieve, update, and delete time entries.

Basic Operations

Get a Time Entry

Retrieve a time entry by its ID.

$timeEntry = $client->timeEntries()->get('123456789');

List Time Entries

Get a paginated list of time entries.

$timeEntries = $client->timeEntries()->paginate();
// Iterate through the pages
foreach ($timeEntries as $timeEntry) {
echo $timeEntry->description . ': ' . $timeEntry->started_at . ' to ' . $timeEntry->ended_at;
}

Create a Time Entry

Create a new time entry.

$data = [
'contact_id' => '123456789', // Optional
'project_id' => '987654321', // Optional
'started_at' => '2023-01-01T09:00:00.000Z',
'ended_at' => '2023-01-01T10:30:00.000Z',
'description' => 'Client meeting',
'billable' => true,
'paused_duration' => 0
];
$timeEntry = $client->timeEntries()->create($data);

Update a Time Entry

Update an existing time entry.

$updateData = [
'description' => 'Updated client meeting',
'billable' => false
];
$timeEntry = $client->timeEntries()->update('123456789', $updateData);

Delete a Time Entry

Delete a time entry.

$client->timeEntries()->delete('123456789');

Filtering Time Entries

You can filter time entries by adding query parameters to the request. For example, to filter by period:

$request = new GetTimeEntriesPageRequest;
$request->query()->add('filter', 'period:this_month');
$timeEntries = $client->paginate($request);

Common filters include:

  • period:{this_week|this_month|this_quarter|this_year} - Filter by time period
  • contact_id:{id} - Filter by contact ID
  • project_id:{id} - Filter by project ID
  • user_id:{id} - Filter by user ID
  • state:{active|archived} - Filter by state

Time Entry Properties

When working with time entries, you’ll have access to the following properties:

PropertyTypeDescription
idstringUnique identifier
administration_idstringID of the administration the time entry belongs to
contact_idstringID of the contact associated with the time entry (optional)
project_idstringID of the project associated with the time entry (optional)
user_idintID of the user who created the time entry
started_atstringISO 8601 timestamp of when the time entry started
ended_atstringISO 8601 timestamp of when the time entry ended
descriptionstringDescription of the time entry
paused_durationintDuration of pauses in seconds
billablebooleanWhether the time entry is billable
created_atstringISO 8601 timestamp of when the time entry was created
updated_atstringISO 8601 timestamp of when the time entry was last updated
contactarrayContact information (if a contact is associated)
detailarrayAdditional details (if any)
userarrayUser information
projectarrayProject information (if a project is associated)
eventsarrayEvents related to the time entry
notesarrayNotes associated with the time entry

Note: See the official API reference for the complete list of available properties.

Further reading