Yeah it’s me again but I think you’ll be interested to see this. The good news is that I’ve built the customer, the invoice and the payment with the API and that while there’s an error in the invoice builder, it still is being sent correctly to the customer and the customer payment is mark as paid.
Here’s a screenshot :
I’ve created an invoice of 69.65 with 10.43 of taxes for a total of 80.08. I applied a payment of 80.08.
However the invoice builder says there’s an amount due of 1.42??
Here’s the code to reproduce it :
$invoice = new stdClass; $invoice->client_id = 26; $line1 = new stdClass; $line1->product_key="Abonnement"; $line1->notes="Blogue V.I.P"; $line1->cost=9.95; $line1->qty=1; $line2 = new stdClass; $line2->product_key="Abonnement"; $line2->notes="Plotte V.I.P"; $line2->cost=9.95; $line2->qty=6; $invoice->invoice_items = [ $line1, $line2 ]; $invoice->tax_rate=14.975; $invoice->tax_name="Taxes"; $response = sendRequest('invoices', $invoice, "POST"); $invoice_id = $response->data->id; echo "# de facture = $invoice_id"; $payment = new stdClass; $payment->invoice_id=$invoice_id; $payment->amount='80.08'; $payment->payment_type_id=13; $payment->transaction_reference='XXXXXXXXXXXXXXXXXXX'; $response = sendRequest('payments', $payment, "POST");