Im not sure if you figured this out yet or not. It took me a while, but I got records to insert into my customers object finally. Updating worked for as well.
I needed to use the full raw type array depth. so,
$fields = array(
$customerID => '',
$customerCopmany => "Test Company",
$customerName => array("last" => "Appleseed", "first" => "Johnny"),
$customerBillingAddress => array("zip" => "27612", "state" => "NC", "city" => "Raleigh", "street" => "123 Abc St"),
$customerEmail => array("email" => "email@testing.com"),
$customerPassword => array("password" => "passwordABC123")
);
$data = json_encode($fields);
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, “https://api.knackhq.com/v1/objects/".$customers."/records”);
curl_setopt($ch2, CURLOPT_CUSTOMREQUEST, ‘POST’);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch2, CURLOPT_POSTFIELDS, $data );
curl_setopt($ch2, CURLOPT_HTTPHEADER, array(“Content-Type: application/json”, "Content-Lenght: ". strlen($data), "X-Knack-Application-Id: " . $kn_appID, "X-Knack-REST-API-Key: " . $kn_APIKey));
$postReturnVal = curl_exec($ch2);
curl_close($ch2);
Depending on what “field_315_raw” field type is. By changing this to PUT and removing everything but the address i was able to update that.
$fields = array(
$customerBillingAddress => array(“zip” => “5555”, “state” => “NC”, “city” => “BLAHBLAH”, “street” => “5555 ABC Dr.”)
);
$data = json_encode($fields);
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, “https://api.knackhq.com/v1/objects/".$customers."/records"."/”.$id);
curl_setopt($ch2, CURLOPT_CUSTOMREQUEST, ‘PUT’);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch2, CURLOPT_POSTFIELDS, $data );
curl_setopt($ch2, CURLOPT_HTTPHEADER, array(“Content-Type: application/json”, "Content-Lenght: ". strlen($data), "X-Knack-Application-Id: " . $kn_appID, "X-Knack-REST-API-Key: " . $kn_APIKey));
$postReturnVal = curl_exec($ch2);
curl_close($ch2);
Hopefully that helps out you and anyone else with this issue.