You can directly return
$response["amount"] = $balance - [your input value (amount)]
Or directly update
$updatestatement = mysqli_prepare($con, "UPDATE customer SET balance = (balance - [your input value (amount)]) WHERE number = ? AND password = ? ");
mysqli_stmt_bind_param($updatestatement , "ss", $number, $password);
mysqli_stmt_execute($updatestatement );
mysqli_stmt_bind_param($statement, "ss", $number, $password);
mysqli_stmt_execute($statement);
mysqli_stmt_store_result($statement);
mysqli_stmt_bind_result($statement,$id,$name,$number,$password,$balance);