I'm having an issue getting my PHP code to work with a REST API.  What I am trying to accomplish should be simple, but I don't know enough about PHP, REST, and JSON.  The API belongs to my ticketing system, and they aren't currently supporting it so I'm pretty much on my own.  What I am trying to accomplish is to create a customer using an HTML for (this I have figured out and is working), once the customer is created then I want a new invoice created with a specific item.  I can get it to create a blank invoice that is attached to the customer, but it will not populate any line items.  
Here is a link to the example webform that passes info to the API
http://feedback.repairshopr.com/knowledgebase/articles/379711-custom-web-form-code-leads-api. 

Here is the small amount of documentation available for the API.
http://feedback.repairshopr.com/knowledgebase/articles/376312-repairshopr-http-rest-api-beta

The way the parameters read 'line_items' is an array that passes 'item', 'name', 'quantity', 'cost', price', and 'taxable'.  I spoke to one of the programmers and he is stating that it must be a hash and that's why it's not working.  I have tried using an associative array formatted with the http_build_query, but it's just not working. Anyone out there want to take a look at it for me and provide some suggestions. I've provided my code below, minus my API key.



$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,"http://supportit.repairshopr.com/api/v1/invoices.json?api_key=XXXXX");
    curl_setopt($ch, CURLOPT_POST, 1);
$customer_id = '901992';
//$date = date('Y/m/d');
$date = '2014-08-01';

$data = http_build_query(array('date' => $date,
'customer_id' => $customer_id,
'line_items'=>
array('item'=>'Managed Services',
'name'=>'1 Year Flash Antivirus Subscription',
'cost'=>'12',
'price'=>'80',
'quantity'=>'1')
               ));

   
   
    curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
 
 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
 
    $server_output = curl_exec ($ch);
 
    curl_close ($ch);
 
    exit();
  
?>