If the outter quotes are removed and you use string replace to replace the apostrophes with quotation that would be the solution, if you need it to be a variable, replace the outer quotations with apostrophes.
You're on the right track just write a helper function to handle this.
Can't access directly like this $data->product_id
You need a Json array of objects.
Edit: I don't understand is it coming In like in your question or is that after you changed it. If that's the case don't change it.