Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
Upsert SalesOrder line items via REST Put operation - how to key?
Hi -
I'm trying to run an Upsert on SalesOrder using a PUT operation like so:
PUT
https://{accountId}.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder/eid:SO_EXT_123
Body:
{ "memo": "Test Memo",
"tranDate": "2025-07-12",
"currency": { "id": 1 },
"entity": { "id": 3743 },
"item": {
"items": [ {
"quantity": 1,
"rate": 100.0,
"line": 1,
"item": { "id": 114 }
} ] }}
I want to use the upsert operation to do a sync/merge of sales orders. By passing the external id in the url, i can correctly insert/update the sales order header data as required.
However, I want to also sync on the items. The swagger schema suggests that 'line' is the key to be used, but is that accurate? My understanding is that the line refers to the position in the collection, not an internally or externally assigned id?