Closed Jaspur closed 5 years ago
Hi @Jaspur:
Can you try to send the $moneybirdInvoice
instead of $nInvoice
:
$moneybirdClient->salesInvoices->send($moneybirdInvoice);
Hi @TriPSs, That's a quick reply :-) Just tried it and that's also not working.
Do you get any logs / response from $moneybirdClient->salesInvoices->send($moneybirdInvoice);
?
And could you check with $moneybirdClient->getLastHttpResponseStatusCode()
what the last code returned by Moneybird is?
And if possible can you share a little more of your setup code?
And is the invoice created with $moneybirdClient->salesInvoices->create($nInvoice);
?
Found a response: Error executing API call: Sales Invoice Sending isn't a hash.
@TriPSs got an answer from Moneybird about this and they say:
Bedankt voor je bericht. Als je deze foutmelding krijgt, dan geef je de parameters niet in het goede formaat mee. Je kunt hier nalezen op in welk formaat je ze mee kunt geven aan je request: https://developer.moneybird.com/api/sales_invoices/#patch_sales_invoices_id_send_invoice
You have a clue what to do?
Hi @Jaspur, I will see if I can repreduce the error as I do not use this project somewhere anymore I will need to setup something.
Hi @Jaspur, i committed a couple of changes, the following way now works again:
$salesInvoice = $moneybirdClient->salesInvoices->send("INVOICE ID");
The default send method of the contact is used, to overwrite use the below, that was a way that already worked:
$invoiceContact = new \Moneybird\Object\Contact();
$invoiceContact->id = "CONTACT ID";
$invoiceContact->delivery_method = "Email";
$invoiceContact->email = "your@email.com";
$salesInvoice = $moneybirdClient->salesInvoices->setContact($invoiceContact);
$salesInvoice->send("INVOICE ID");
@TriPSs thanks, it's working now!
Hi @TriPSs,
How to send the invoice after creating it?
I tried: