I got the code working for creating quote object and quote item object, and I'm able to create quote successfully which I could confirm it by checking the database, I also created cookie named front-end. All I need now is to assign the created quote to the guest user, so that I can let the user checkout as guest, but couldn't assign the cart to the guest user.
Request for items in the cart will be coming from 3rd party site via JSON request which I have decoded and looped through.
Here is the code
session_name("frontend");
session_start();
$cartInfo = $_GET['items'];
require_once '../app/Mage.php';
Mage::init('default');
$session = Mage::getSingleton('customer/session');
Mage::getSingleton('checkout/cart')->getQuote();
foreach ($cartArray as $key=> $value) {
$productId = $key;
$productQuantity = $value;
$productModel = Mage::getSingleton('catalog/product');
$productObj = $productModel->load($productId);
if (!$quoteObj) {
$quoteObj = new Mage_Sales_Model_Quote();
}
$store_id = Mage::app()->getStore()->getId();
$storeObj = $quoteObj->getStore()->load($store_id);
$quoteObj->setStore($storeObj);
$quoteItem = Mage::getModel('sales/quote_item')->setProduct($productObj);
$quoteItem->setQuote($quoteObj);
$quoteItem->setQty($productQuantity);
$quoteItem->setStoreId($store_id);
$quoteObj->addItem($quoteItem);
$quoteObj->setStoreId($store_id);
$quoteObj->collectTotals();
$quoteObj->setCustomerId(null);
$quoteObj->save();
$quoteId = $quoteObj->entity_id;
echo $quoteObj->entity_id.'**<br />';
echo $quoteItem->item_id.'---<br />';
}