NetSuite SuiteTalk icon

NetSuite SuiteTalk

NetSuite REST API

Upsert Record

AI-generated

Summary

Upsert a record in NetSuite by specifying the record type, an external ID, and the record data. If a record with the given external ID exists, it is updated; otherwise, a new record is created.

Inputs

  • Record Type (required) — Select the type of record to upsert, e.g., Sales Order, Customer, or a Custom Record.
  • Custom Record Script ID (required) — Provide the internal identifier of the Custom Record type (only shown if Record Type is Custom).
  • External ID (required) — Specify the external identifier for the record; used to identify the record to update or create if it does not exist.
  • Replace Sublists — Comma-delimited list of sublist names for which all existing lines will be replaced by those specified in the upsert data. Sublists not specified will have lines added instead.
  • API Version — The API version to use for the request (currently only V1).
  • Options — Additional options to control the operation such as returning the full response or setting max retry attempts on failures.

Output shape

a single JSON object indicating success status, and if available, the internal ID and location of the upserted record.

Returns an object with a success boolean. If successful, it includes the internal ID and location URL of the upserted record. Errors are surfaced in the response if the upsert fails.

Examples

Example 1: Upsert a Sales Order by external ID

Set Record Type to 'Sales Order', enter the External ID identifying the record, and specify the record's data in the input JSON. Set Replace Sublists if you want to replace entire sublists. Run the node to create or update the record.

Links

Discussion