I am using the below API code, which works by setting up the recurring invoice, and then immediately sending the first invoice
$invoice = $ninja->recurring_invoices->create([
‘client_id’ => $ninjaUserIDToken,
‘date’ => date(‘Y-m-d’),
‘due_date’ => date(‘Y-m-d’),
// recuring start
‘frequency_id’ => 5,
‘remaining_cycles’ => -1,
// recuring end
‘line_items’ => [
[
‘quantity’ => 1,
‘cost’ => $billingAmount,
‘product_key’ => $billingCredits.’ Credits’,
‘notes’ => ‘You are buying ‘.$billingCredits.’ credits’,
‘custom_value1’ => ‘credits’,
‘custom_value2’ => $billingCredits
],
],
],
[‘send_email’ => ‘true’]
);$invoiceBulk2 = $ninja->recurring_invoices->bulk("send_now", array($invoice['data']['id'])); $invoiceBulk = $ninja->recurring_invoices->bulk("start", array($invoice['data']['id']));
The problem i am having is:
There is no due date set on the invoice that is sent (in my case i would like the due date to be the same as the invoice date).
How can i set the due date of each recuring invoice to be the date it was created?
Thanks
Jon