php form submit converted the JSON formate the URL API to post that data but data will not post API key also passed but not working
$values->email = $_POST['email'];
$values->password = $_POST['password'];
$values->phone = $_POST['phoneno'];
$values->owner_id = $_POST['operator_id'];
$values->bank_name = $_POST['bankname'];
$values->ifsc_code = $_POST['ifsc'];
$values->last_name = $_POST['lastname'];
$values->created_by = 'mobiadmin';
$values->first_name = $_POST['firstname'];
$values->account_type = $_POST['accounttype'];
$values->schema = $_POST['schema'];
$values->merchant_meta = array("id"=> null);
$values->merchant_name = $_POST['merchantname'];
$values->account_number = $_POST['accountno'];
$values->acc_holder_name = $_POST['accountholder'];
$array = array("records"=>array($values));
$json_formate = json_encode($array);
$ch = curl_init('api');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_formate);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'x-api-key:aMqwyQJdA1aqH5GkpG5NR78UyswcHhkEaMZCfrC8',
'Content-Length: ' . strlen($json_formate))
);
$result = curl_exec($ch);