Zoho Books API Post Contacts Custom_Fields PHP

Zoho Books API Post Contacts Custom_Fields PHP

Hey guys, I'm trying to POST a new contact with a custom field but it's returning the following error:
  1. "{"code":1038,"message":"JSON is not well formed"}"
Here is my code:

  1. $invoice = array(
  2.    'contact_name' => $result[0]['name'],
  3.    'email' => $result[0]['email'],
  4.    'custom_fields' => ["index" => "1", "value" => "123456789"]
  5. );


  6. $jsonInvoice = json_encode($invoice);
  7. var_dump($jsonInvoice);
  8. $url = 'https://books.zoho.com/api/v3/contacts';

  9. $data = array(
  10.        'authtoken'   => 'c6964fa118ef2ee81cf09642434478f7',
  11.        'JSONString'   => $jsonInvoice,

  12.        "organization_id"  => '636609576',
  13.        "send"                  => 'false'
  14. );

  15. $ch = curl_init($url);

  16. curl_setopt($ch, CURLOPT_VERBOSE, 1);
  17. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  18. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 
  19. curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
  20. curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  21. curl_setopt($ch, CURLOPT_POST, TRUE);
  22. curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded") );

  23. $response = curl_exec($ch);
  24. curl_close($ch);

  25. var_dump($response);

Anybody know how to post a custom field?