We are working on connecting our online service payments with InvoiceNinja (Ninja will serve as automatic invoice generator) through API and so far so good but I have a question regarding clients - does InvoiceNinja have any way of blocking the creation of duplicate clients or must we somehow check via API everytime we send a new request to Ninja if the client already exists?
The app doesn’t block duplicate clients, maybe you can store the Invoice Ninja client id in your system?
Sorry for responding/re-opening such an old topic, but I got aware of the same situation.
So to prevent that a client is created multiple times via API, the only way is:
- API Call to find the client with the information (e.g. Company Name, Address, City) using GET /api/v1/clients.
- If a client was found, do not create a new client
- If no client was found in the response (total or count: 0), create a new client
However how do I search for a client using the company name or address? So far only “email” seems to work for lookups?
It isn’t supported in v4, just email and id_number are filterable
What about v5? Does/will it support lookups on other fields?
Yes, the v5 API is much more flexible