Create new Country

How can I add a new country into the country dropdown field? (ie without using custom fields)

I tried via the database but the UI doesn’t seem to recognise it.

Many thanks


Adding a country would require also adding it to the frontend app: GitHub - invoiceninja/admin-portal: Invoice Ninja: Admin portal built with Flutter

Note: an alternate solution may be to update the label of a country on Settings > Localization.

Thank you.

I’m using the self hosted pre built version.
In the database folder, I found the countries seeder file. I assume that is only used for the migrations in the first run.

Would you be able to guide me in the file structure to where I could find this and update it?

An alternative solution might be to add it as a custom field, but not sure if it would have any impact in the application by having another country set in the settings, even if hidden. The custom field would also not have a country code etc so not sure how that would impact other areas?

Same question for currency, how can one add other currencies and their symbols such as bitcoin, etc etc?

Many thanks

I may have been wrong above, after checking the code I’m not sure the frontend will need to be changed.

If you change the seeder file you would need to manually re-run it to update the database.

Would there be a way to test this out and confirm it?

Would you be able to address and confirm the other queries please?

Many thanks

@david can you please advise?

We store all data like currencies and countries in cache. So after making a change like this you would need to rebuild the cache.

Thes easiest way to do this is to run the update route


Please note, that future updates of the application may break if you add this change in isolation, if you have a country to add, you could PR it to the repo, that way your app can stay up to date in the future.

Thank you @david .

Do you mean a pull request? To what purpose, so that it is reviewed and integrated with the main branch? This only applies to my specific use case.

BTW, to clear cache, you mentioned “/update?secret=” but the update currency guide mentions “?clear_cache=true” .

I have tried both and it didn’t work. Do I need the secret parameter in the clear cache also? Is the secret the APP_KEY without base64 argument?

Many thanks


?clear_cache will also work.

In regards to inserting your own country in isolation, if we later add another country with that ID, (we explicitly define the id for the database) the migrations in future updates will break for you. One workaround would be to select a ID that is very large so that potential collisions do not interfere with future updates.

However another consideration are the translations, this will definitely be overwritten, so you’ll need to manually add back the country translations for each update.

The secret is the UPDATE_SECRET in the .env file.

1 Like