Good evening, I have difficulties creating new customers and recurring invoices. If I want to create a customer using the API, the customer will be created in the clients table but the user_id and account_id will always remain at 1. Unfortunately, nothing will be created in the users table except when I create a customer manually.
The other problem I have is with the recurring invoices. According to the InvoiceNinja API, a client_id must be specified for recurring invoices but what exactly is the client_id?
My problem is that the user id always stays at 1 although I specify the user_id in the POST. The customerid has the value 27 but in the invoice client table the customer gets the id 1 which should not be the case.
The user_id can not be specified, it will be copied from the token. If you want to assign the invoice to a different user you’d need to create it with the user’s token.
Note: in v5 the app supports assigning invoices to users by setting the assigned_user_id field.
I am currently trying to implement it so that a customer can order a product. I want to create a recurring invoice and therefore I have to specify the client_id at the api. But I don’t understand what you mean with the user_id and the token? Can you give me an example or something like that? That would be very nice.
We want to create a customer via the API and then, when he orders something, create a recurring invoice for this customer.
But if you create the customer via the API, he will get the user_Id “1” every time, no matter how many we create it is always the “1”. So we can’t create a recurring invoice correctly because all customers have the user_id “1”.
If we create a customer using the normal Invoice Ninja Dashboard, everything works perfectly, so every customer gets his own id
So how can we create a customer via the API that gets a preceding user_id so that we can assign a recurring invoice?