We have created some example flows for you to use as a reference when setting up your API integration.
These won't always be identical to the setup you need, but they should give a good starting point.
Click on the schematic to download the flow.
User provisioning
-
Get the last sync date for the users in your HR tool.
"Last Sync" is the latest successful synchronization, or update, to the database. -
Retrieve the list of all existing groups in your Rydoo account
Get the groups in your company -
Retrieve the list of all employees from your HR tool
-
Loop through every employee:
Check for all users´ groups if it already exists in Rydoo, if there are groups that don’t exist yet, use the following endpoint to create the group(s).
Add a group to the company -
Loop through every employee again.
Check if the users already have a Rydoo User GUID, which is provided in the responses as "id".
If there are users that don’t have a GUID yet, we need to check if the user’s email address already exists in Rydoo.
If that’s not the case, create the user and store the GUID, if the user already exists we can just store the GUID in your HR tool. -
Loop through every employee.
Check if the last modified date is before the last sync date.
For all users for whom this is not the case, the user needs to be updated:
Update the user
Edit expense approver assignments for user
Update the groups to which the user belongs -
Finally, set the last sync date for all users.
Expense export flow (scheduled)
-
Set a scheduled trigger to run this task.
We suggest hourly sync. -
Get the last sync date/time and the current date/time.
-
Use the GET branches endpoint:
Get branches in the company -
Find the BranchId for which you want to book expenses.
-
Use the BranchGUID as a filter in GET expense request:
Export expenses -
Check the "total count" information which is provided in the Response.
If the count is 0, set the last sync date/time.
If the count is less than 100, you can book these expenses in one go.
If the count is more than 100, please refer to our paging option. -
In case of errors when trying to get the expenses, we advise you to try again up to 5 times or try again later.