Jump to content

Recommended Posts

Posted

Hi,

 

I was testing the "add" Invoice API but right now I have no idea what the problem is since the response is too generic, please see below:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Below is my sample invoice data that I was trying to submit to our blesta server. Is there something I am missing here?

$date = date('c');
$invoice = ['client_id' => 68,
                'date_billed' => $date,
                'date_due' => $date,
                'date_closed' => $date,
                'date_autodebit' => $date,
                'status' => 'active',
                'currency' => 'USD',
                'note_private' => 'Initial payment',
                'note public' => '',
                'lines' => [
                    'service_id' => 127,
                    'amount' => 500,
                    'qty' => 1,
                    'description' => '1 slot',
                    'tax' => false
                ],
                'term' => '',
                'period' => '',
                'duration' => '',

    ];
Posted

That error is rather generic. Curious why you're using brackets for associative arrays. I'm not familiar with that syntax.

 

The data values look fine, except for the due date, which is expected to be after the bill date, so the error is occurring on or before rule validation.

  • 5 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...