$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $configLoader = $objectManager->get('\Magento\Backend\Model\UrlInterface'); $url = $configLoader->getUrl('testing/queue/purchase'); <script> require([ 'jquery', 'mage/mage', 'mage/calendar' ], function($){ $('#customer_company').on('change',function(event){ $.ajax({ url: '<?php echo $url ?>', type:'POST', showLoader: true, dataType:'json', complete: function(response) { console.log(response); }, error: function (xhr, status, errorThrown) { console.log('Error happens. Try again.'); } }); }); }); i write this code in magento admin on change the ajax request call and its hit my controller but in console the response is Invalid Form Key. Please refresh the page