So once, you have setup all projects and customers from Toggl to InvoiceNinja, you’ll have to get the customer-ID and project-ID. Unfortunately, I didn’t find a way within the GUI, so I followed the instructions for the API and came up with this command to get a list of all customers:
curl -X GET "https://invoice.example.com/api/v1/clients" -H "X-API-TOKEN: xXxXxXxXxXxXxXxXxXxXxXxX"
Make sure you put in your domain instead of “example.com” and your API-Token from within InvoiceNinja.
If the output is too extensive, you can add “>> clients.txt” at the end to paste it into the text file “clients.txt”. Open it and it looks like this:
the marked lines are the customer name you created within the WebUI and the ID i the one you’ll have to put into the Config-File.
To do the same for projects, you simply have to change “clients” into “projects” and you’ll end up with a list of all your created projects:
curl -X GET "https://invoice.example.com/api/v1/clients" -H "X-API-TOKEN: xXxXxXxXxXxXxXxXxXxXxXxX"
Add them as well with the Toggl name and the invoiceninja-ID to the conf-file, and you can give it a try.
If you’ll need further info, I can send more info, but maybe it’s better you open a new issue and send me the link inhere.
Caveats with this way are:
- you’ll have to manually keep up with changes in Toggl (maybe I’ll write a little workaround for this later)
- it’s only a one way sync from Toggl to InvoiceNinja
- it’s only a onetime sync - you’ll have to figure out how to run it periodically (with cron for instance)