Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Please note that on Saturday, April 11, 2026, at 8:00 PM Pacific time, our Case Management System will undergo a scheduled maintenance for approximately 30 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
Multiple items in itemList (php)
How do you create a sales order with multiple items in the itemList using the php toolkit?
Every example I see has 'itemList' defined as an associate array with one entry named 'item' in it. Like in this example:
[CODE]
$salesOrderFields = array(
'entity' => new nsRecordRef(array('internalId' => $entity)),
'paymentMethod' => array('internalId' =>$paymentMethod),
'ccNumber' => $ccNumber,
'ccExpireDate' => date("c", mktime(0,0,0,$month,1,$year)),
'ccName' => $ccName,
'itemList' => array(
'item' => array(
'item' => array('internalId' => $itemIntId),
'quantity' => $quantity
)
)
);
[/CODE]
The sales xsd (https://webservices.netsuite.com/xsd/transactions/v2010_1_0/sales.xsd) says that 'itemList' can have multiple 'item' child elements, but that works for xml, not php associative arrays.
Every example I see has 'itemList' defined as an associate array with one entry named 'item' in it. Like in this example:
[CODE]
$salesOrderFields = array(
'entity' => new nsRecordRef(array('internalId' => $entity)),
'paymentMethod' => array('internalId' =>$paymentMethod),
'ccNumber' => $ccNumber,
'ccExpireDate' => date("c", mktime(0,0,0,$month,1,$year)),
'ccName' => $ccName,
'itemList' => array(
'item' => array(
'item' => array('internalId' => $itemIntId),
'quantity' => $quantity
)
)
);
[/CODE]
The sales xsd (https://webservices.netsuite.com/xsd/transactions/v2010_1_0/sales.xsd) says that 'itemList' can have multiple 'item' child elements, but that works for xml, not php associative arrays.
0