NetSuite REST icon

NetSuite REST

Call NetSuite SuiteTalk REST operations.

Actions979

Location → Insert or update record

AI-generated

Summary

Inserts a new NetSuite Location record or updates an existing one using an identifier. This operation behaves as an upsert.

Inputs

  • Id (required) — The external or internal identifier of the Location record to update or insert. This ID is used in the URL path for the API request.
  • Name — The name of the location, visible in NetSuite lists. Maximum 60 alphanumeric characters.
  • External ID — A user-defined external identifier for the Location record.
  • Is Inactive — Set to true to inactivate the location record, preventing it from appearing in lists.
  • Main Address — Details for the location's main address, including address lines, city, country, state/province, and zip code.
  • Return Address — Details for the location's return address, including address lines, city, country, state/province, and zip code.
  • Latitude — The latitude coordinate of the location in decimal format (e.g., '37.5367').
  • Longitude — The longitude coordinate of the location in decimal format (e.g., '-122.3285').
  • Subsidiary — The subsidiary associated with this location, identified by its internal or external ID.
  • Include Children — Set to true to associate the location with all sub-subsidiaries of the selected subsidiary.
  • Time Zone — The time zone of the location, specified by its internal identifier or reference name.
  • Location Type — The type of location, specified by its internal identifier or reference name.
  • Document Number Prefix — An alphanumeric prefix (up to 8 characters) for auto-generated transaction numbers for this location.
  • X - Net Suite - Idempotency - Key — A user-defined unique idempotency key (UUID) for asynchronous requests, ensuring the request is executed only once.
  • Custom Fields — A list of custom fields to set on the Location record, requiring a field name, type, and value.
  • Debug Mode — Whether to include full request and response information in the output.

Output shape

A single JSON object representing the created or updated NetSuite Location record.

If the 'Prefer' header is set to 'respond-async', the response might be a '202 Accepted' status with a link to check the status of the asynchronous operation, rather than the full record immediately.

Examples

Example 1: Create a new warehouse location

Set 'Id' to a unique external ID, provide a 'Name', 'Main Address' details, and a 'Subsidiary' ID.

Example 2: Update the address and activate an existing store location

Set 'Id' to the location's internal ID, provide updated 'Main Address' details, and set 'Office is Inactive' to false.

Example 3: Assign a custom category to a location

Set 'Id' to the location's identifier, then add a 'Custom Field' with the appropriate field name and a 'Select' type value.

Discussion