check if json obj exists

JavaScript
if(thisSession.hasOwnProperty('merchant_id')){

}
Source

Also in JavaScript: