java script : validate incoming payload fields. ------------------- worked: try { // Retrieve the incoming request content as a string var requestContent = context.getVariable("request.content"); // Parse the JSON payload into a JavaScript object var request = JSON.parse(requestContent); // Define allowed fields for the main object var allowedFields = [ "actualGrossWeight", "actualVolumeUom", "actualVolumeWeight", "actualWeightUom", "billOfLading", "carrierId", "companyCode", "containerID", "containerSealNumber1", "containerSealNumber2", "despatchDeliveryId", "destination", "destinationType", "documentText", "externalUniqueReference", "idKey", "items", "postingDate", "referenceDocumentNumber", "source", ...