Invoice Line Items not auto included via API ?

Hello, I am trying to generate invoices via the API (react) and per the docs should be able to specify a pre-existing product key to autopopulate a line item. Unfortunately I’m having no joy with this (instead creating an invoice with a new lineitem with the same key (but no notes, price etc).

I’m using Postman to do this - here’s the request payload for a pre-existing product called Insights:
{
“client_id”: “mWZdPwbKgR”,
“public_notes”: “These are the service details included for the clients benefit..”,
“line_items”: [
{
“product_key”: “Insights”,
“quantity”: 1
}
]
}

I have autofill and auto update enabled in the admin UI (React (V 5.12.0)).
I’m submitting to the standard invoices endpoint, no chaining.

Many thinks if anyone has thoughts on this - I’m new to Ninja so forgive me if Ive overlooked something obvious.. ps: the storage/logs Laravel log shows nothing of particular import.

Hi,

The auto-fill option applies to the app, not the API. You’ll need to provide all of the product details in the line item.

Thanks Hillel. I was pulling my hair out trying to figure it out. I do have one further question. The Flutter dashboard, Windoze dashboard, iPhone app don’t appear to be updating in realtime when I create or change status of invoices (the React app no problem - behaves exactly as expected). The changes did eventually show up over night, but maybe a sync issue I can focus on ? also I tripped over a post in the forum about it thankfully, but I was getting a 500 rc when trying to run the update. I already had memory at 1G, running PHP 8.3 etc. It turned out that 1G wasn’t enough. I’m running on shared hosting with Wordpress running on the primary domain, so that’s likely the cause but had to bump it to 2G before the install completed successfully. I think it would be wise to catch and expose mem issues during installs/updates like that because I had no way to know what was causing the 500.

And BTW - I’m loving the app. Thanks so much for all your hard work :smiley:

1 Like

Glad to hear it!

The Flutter app caches the data locally, it checks for changes every 5 minutes.

We include a PHP memory check in the health dialog to help catch this ahead of time.

The memory check assumes (and asserts) a 1Gig requirement. In my case that wasn’t enough, and was just handed server 500 errors when it failed. But yes, it’s a great app :smiley:

Thanks, understood. We’ll update the message.

cc @david @ben