By request, here is a post on creating a sales order record with Netsuite PHPToolkit with more than one item:
$items = array();
foreach ($mycartitems as $item) {
$itemRef = new nsRecordRef(array('internalId'=>$item->getNetsuiteID()));
$qty = $item->getQuantity();
$SalesOrderItem = new nsComplexObject("SalesOrderItem");
$salesOrderItemFieldArray = array(
"item" => $itemRef,
"quantity" => $qty
);
$SalesOrderItem->setFields($salesOrderItemFieldArray);
$items[] = $SalesOrderItem;
}
$salesOrderItemList = new nsComplexObject("SalesOrderItemList");
$salesOrderItemList->setFields(array(
"item" => $items
));
$salesOrderFields = array(
"orderStatus" => "_pendingFulfillment",
"entity" => $custRef,
"getAuth" => true,
"shippingCost" => $shipCost,
"shipMethod" => $shipRef,
"toBeEmailed" => true,
"email" => $emailList,
"itemList" => $salesOrderItemList
);
Its not all that intuitive, but that’s Netsuite Web-services for you…

Hi Daniel,
It’s me again, i’ve been using your code above for my SO( Sales Order) implementation.
It’s working perfectly.
I have problem now on how to add the custom Shipping and billing address in SO.
But i don’t want the address to be added to the customer record, i just want it to be a custom data in the particular Sales Order
Do you have sample script to achieve this ?
I can only find an example in SuiteScript, but cannot find how to do in SuiteTalk.
I haven’t tried to do that before. I have always added the address to the customer. If you can’t find a way to do what you want, a work around might be adding it to the customer and then removing after the order completes.
Hi Daniel,
Based on this article the item is referred by internalID
$itemRef = new nsRecordRef(array(‘internalId’=>$item->getNetsuiteID()));
Is there any way to refer the item by itemId ?
I tried
$itemRef = new nsRecordRef(array(‘itemId’=>’SKU123456′);
but it’s not working
Thanks