Commerce Create Cart/Order without product function create_init_order() {
  global $user;

  $order = commerce_cart_order_load($user-&gt;uid);

  if(!$order) {

    $new_order = commerce_order_new($user-&gt;uid, 'pending');


    // just consider i have generateEmail() and randomName($len) functions

    $new_order-&gt;order_number = $order_number = randomName(10);
    $new_order-&gt;mail = generateEmail();
    $new_order-&gt;hostname = randomName(10);

    commerce_order_save($new_order);
    unset($new_order);

    $order = commerce_cart_order_load($user-&gt;uid); 
    $order-&gt;data['suburbs'] = $_REQUEST['suburb'];
    $order-&gt;data['truck'] = $_REQUEST['truck_size'];
    commerce_order_save($order);

  }
}


Hi guys this is for anonymous user creation of order if not existing yet, anything I missed why is not working well.

Specifically this part:

    $order = commerce_cart_order_load($user-&gt;uid); 
    $order-&gt;data['suburbs'] = $_REQUEST['suburb'];
    $order-&gt;data['truck'] = $_REQUEST['truck_size'];
    commerce_order_save($order);


As i need suburbs and truck data before adding the line item.

Thank you in advanced.
You are unsetting $new_order and then calling commerce_order_save($new_order); when $new_order is null. It should use $order there.  i.e. 

not:

commerce_order_save($new_order);
unset($new_order);

$order = commerce_cart_order_load($user-&gt;uid); 
$order-&gt;data['suburbs'] = $_REQUEST['suburb'];
$order-&gt;data['truck'] = $_REQUEST['truck_size'];
commerce_order_save($new_order);


but instead:

commerce_order_save($new_order);
unset($new_order);

$order = commerce_cart_order_load($user-&gt;uid); 
$order-&gt;data['suburbs'] = filter_xss($_REQUEST['suburb']);
$order-&gt;data['truck'] = filter_xss($_REQUEST['truck_size']);     
commerce_order_save($order); // here


It also looks like there's no need to save and reload the order there when one save would suffice.

Edit: OP has changed the $new_order code typo.

No need to save and load the order, the order_id is already in $new_order-&gt;order_id after saving in commerce_order_save($new_order);

Your problem is probably a NULL or empty $_REQUEST var. 
Alternatively, you could add the fields to the order entity itself via the Fields UI.