Multiple client with same e-mail > Portal client login

Hello there,

I’m testing InvoiceNinja to create a billing on my application, but got some questions about strange behavior I flagged:

  • On my app there is no unique e-mail, users will only have unique username. On InvoiceNinja, I can create two clients with same e-mail, but in the purchase page, what is the expected behavior when filling the e-mail ? Only the first one is taken, or there is a way to pass a client_id as url params ?

  • There is a way to update subscription quantity, instead of switching plan ? I got a plan called “Storage space 1TiB”, and if the user want 10 TiB, my idea is to update the quantity from 1 to 10, didn’t see this option in client portal

I tried using self hosted version v5, and cloud, I can’t answer those questions

Thanks for your help


  • You’ll want to make sure all users have unique email addresses, it can cause problems in the client portal.

  • I don’t believe this is currently supported, feel free to create an issue on GitHub to request it: Issues · invoiceninja/invoiceninja · GitHub

Understood, maybe a verification on InvoiceNinja side can be great … to be sure currently, only the first user is selected, if two exists with the same e-mail ?

Got another question: there is a way to use API, to get direct link to client portal (without login required, I want same process, when I click on client actions > Go to client portal, that seems to auto-login with the link) ?

If two clients have the same email address the app assumes they’re the same person. This is useful if you need to create more than one client record. For example, if you need to invoice the client in more than one currency.

If you add ?client_hash=<client.client_hash> to the URL I believe it should bypass the login screen.

Understood, for the client email
There is no way to add a restriction, to avoid creating two client with same e-mail ?

For the link, just found a solution. It seems on the API, the link is provided. The format is

I don’t believe it’s currently supported but feel free to create an issue on GitHub to request it.

Glad you have a solution!

1 Like

@hilel, do you know what is the purpose of account_key ?
Multiple times in the codebase, sometimes in URL params

It used as a public id for the the account, we use it in the Flutter app to associate an in-app purchase with the connected account.

There is something I don’t quite understand. Here’s my workflow:

  1. The user creates an account on my app (domain: => free account.
  2. When the user wants to upgrade, they click on “Upgrade” in my app, which redirects them to a subscription link ([id/purchase/v3)
  3. The user fills out the form, including credit card and other necessary information.
  4. A webhook callback is triggered in my app to upgrade the user to a premium account upon the plan_paid event.

However, there’s an issue: we can’t identify the user when using the subscription link.

The account_key is always null in the webhook event. It seems we need to update the user and set a custom value called account_key for it to work. However, even with a webhook on the client created event, we only receive client details and not URL parameters.

Using the campaign parameter only works for the recurring_purchase event, not for the plan_paid event. This means the update on my app happens too late, as the user is already redirected by the time we receive this event.

I’ve tried several workflows, but if you have more details on your workflow or an ideal workflow, it would greatly help me understand how to address this issue.

@david can you please advise?