Operations (sample payloads)
Main operations
Add record
Add a new record for a given type. Sample Input
{
"record": \{
"type": "customer",
"xmlns_namespace": "listRel"
\},
"fields": [
\{
"name": "entityId",
"value": "John Doe"
\},
\{
"name": "companyName",
"value": "Acme Corporation"
\},
\{
"name": "email",
"value": "john.doe@acme.com"
\},
\{
"name": "phone",
"value": "555-123-4567"
\},
{
"name": "subsidiary",
"attributes": {
"internalId": "1"
}
}
]
}
Sample Output
Batch add records
Batch add new records, each for a given type. Sample Input
{
"add_record_batch": [
{
"record": \{
"type": "customer",
"xmlns_namespace": "listRel"
\},
"fields": [
\{
"name": "entityId",
"value": "John Doe"
\},
\{
"name": "companyName",
"value": "Acme Corporation"
\},
\{
"name": "email",
"value": "john.doe@acme.com"
\},
\{
"name": "phone",
"value": "555-123-4567"
\}
]
},
{
"record": \{
"type": "salesOrder",
"xmlns_namespace": "transactionSales"
\},
"fields": [
{
"name": "entity",
"attributes": {
"internalId": "12345"
},
"value": "John Doe"
},
\{
"name": "tranDate",
"value": "2023-05-15"
\},
{
"name": "item",
"value": [
{
"item": {
"internalId": "67890"
},
"quantity": 2,
"amount": 100
}
]
}
]
}
]
}
Sample Output
{
"response_list": [
{
"record": \{
"internalId": 54321,
"recordType": "customer"
\},
"isSuccess": true
},
{
"record": \{
"internalId": 98765,
"recordType": "salesOrder"
\},
"isSuccess": true
}
]
}
Batch delete records
Batch delete records, each for a given type and ID. Sample Input Sample Output
{
"response_list": [
{
"record": \{
"internalId": 12345,
"recordType": "customer"
\},
"isSuccess": true
},
{
"record": \{
"internalId": 10001,
"recordType": "invoice"
\},
"isSuccess": true
},
{
"record": \{
"internalId": 5678,
"recordType": "salesorder"
\},
"isSuccess": false
}
]
}
Batch get records
Batch get records, each for a given type and ID. Sample Input
{
"batch_get_record": [
\{
"record_type": "customer",
"internal_id": "12345"
\},
\{
"record_type": "invoice",
"internal_id": "67890"
\},
\{
"record_type": "item",
"internal_id": "54321"
\}
]
}
Sample Output
{
"response_list": [
{
"record": \{
"internalId": 12345,
"recordType": "customer"
\},
"isSuccess": true
},
{
"record": \{
"internalId": 67890,
"recordType": "invoice"
\},
"isSuccess": true
},
{
"record": \{
"internalId": 54321,
"recordType": "item"
\},
"isSuccess": true
}
]
}
Batch update records
Batch update records, each for a given type and ID. Sample Input Sample Output
{
"response_list": [
{
"record": \{
"internalId": 1234,
"recordType": "customer"
\},
"isSuccess": true
},
{
"record": \{
"internalId": 5678,
"recordType": "employee"
\},
"isSuccess": true
}
]
}
Batch upsert records
Batch upsert records, each of a given record type. Existing records will be updated and new records will be added. Sample Input
{
"upsert_record_batch": [
{
"record": \{
"type": "customer",
"xmlns_namespace": "listRel"
\},
"external_id": "CUST001",
"fields": [
\{
"name": "companyName",
"value": "Acme Corporation"
\},
\{
"name": "email",
"value": "info@acme.com"
\},
\{
"name": "phone",
"value": "555-123-4567"
\}
]
},
{
"record": \{
"type": "employee",
"xmlns_namespace": "listEmployees"
\},
"external_id": "EMP001",
"fields": [
\{
"name": "firstName",
"value": "John"
\},
\{
"name": "lastName",
"value": "Doe"
\},
\{
"name": "email",
"value": "john.doe@company.com"
\}
]
}
]
}
Sample Output
{
"response_list": [
{
"record": \{
"internalId": 12345,
"externalId": "CUST001",
"recordType": "customer"
\},
"isSuccess": true
},
{
"record": \{
"internalId": 67890,
"externalId": "EMP001",
"recordType": "employee"
\},
"isSuccess": true
}
]
}
Delete record
Delete a record of a given record type and ID. Sample Input
\{
"record_type": "customer",
"internal_id": "12345",
"deletion_reason_code": 3,
"deletion_reason_memo": "Customer account closed due to inactivity"
\}
Sample Output
{
"isSuccess": true,
"deleted_record": \{
"internalId": 12345,
"recordType": "customer"
\}
}
Get account governance info
Retrieve account governance info. Sample Input
{
"key_name": "governance_info"
}
Sample Output
\{
"isSuccess": true,
"accountConcurrencyLimit": 25,
"unallocatedConcurrencyLimit": 15
\}
Get currency rate
Retrieve the exchange rate between two currencies based on a certain date. Sample Input
\{
"base_currency_internal_id": "1",
"from_currency_internal_id": "2",
"effective_date": "2023-05-15T00:00:00Z"
\}
Sample Output
{
"isSuccess": "true",
"currencyRateList": [
\{
"baseCurrency": "USD",
"fromCurrency": "EUR",
"exchangeRate": 0.92,
"effectiveDate": "2023-05-15T00:00:00Z"
\}
]
}
Get integration governance info
Retrieve integration governance info. Sample Input
{
"key_name": "IntegrationGovernanceKey"
}
Sample Output
\{
"isSuccess": true,
"accountConcurrencyLimit": 25,
"unallocatedConcurrencyLimit": 10
\}
Get item availability
Retrieve the inventory availability for a specific list of items. Sample Input
\{
"items": [
1234,
5678,
"9012"
],
"last_qty_available_change": "2023-05-01T12:00:00Z"
\}
Sample Output
{
"isSuccess": true,
"itemAvailabilityList": [
\{
"itemId": 1234,
"itemName": "Widget A",
"itemType": "inventoryItem",
"locationId": 1,
"locationName": "Main Warehouse",
"lastQtyAvailableChange": "2023-05-02T09:30:00Z",
"quantityOnHand": 500,
"onHandValueMli": 5000,
"reorderPoint": 100,
"preferredStockLevel": 300,
"quantityOnOrder": 200,
"quantityCommitted": 150,
"quantityAvailable": 350
\},
\{
"itemId": 5678,
"itemName": "Gadget B",
"itemType": "inventoryItem",
"locationId": 2,
"locationName": "Secondary Warehouse",
"lastQtyAvailableChange": "2023-05-01T14:45:00Z",
"quantityOnHand": 250,
"onHandValueMli": 3750,
"reorderPoint": 50,
"preferredStockLevel": 200,
"quantityOnOrder": 100,
"quantityCommitted": 75,
"quantityAvailable": 175
\},
\{
"itemId": 9012,
"itemName": "Component C",
"itemType": "inventoryItem",
"locationId": 1,
"locationName": "Main Warehouse",
"lastQtyAvailableChange": "2023-05-03T11:15:00Z",
"quantityOnHand": 1000,
"onHandValueMli": 2000,
"reorderPoint": 200,
"preferredStockLevel": 500,
"quantityOnOrder": 300,
"quantityCommitted": 400,
"quantityAvailable": 600
\}
]
}
Get record
Retrieve a record of a given type and ID. Sample Input
\{
"record_type": "customer",
"internal_id": "12345"
\}
Sample Output
{
"record": {
"internalId": 12345,
"recordType": "customer",
"customFieldList": \{
"internalId": 67890,
"scriptId": "custentity_loyalty_points"
\}
},
"isSuccess": true
}
List records
List records for a given type (available only for certain types - state values). Sample Input Sample Output
{
"totalRecords": 5,
"recordList": [
\{
"internalId": 1,
"name": "US Dollar"
\},
\{
"internalId": 2,
"name": "Euro"
\},
\{
"internalId": 3,
"name": "British Pound"
\},
\{
"internalId": 4,
"name": "Japanese Yen"
\},
\{
"internalId": 5,
"name": "Canadian Dollar"
\}
],
"isSuccess": true
}
Search records
Search records for a given type and criteria (Basic). Sample Input Sample Output
{
"totalRecords": 2,
"pageSize": 50,
"totalPages": 1,
"pageIndex": 1,
"searchId": "WEBSERVICES_3824982_SB1_052320231581851663397605558_28d78",
"recordList": [
{
"attributes": \{
"internalId": 12345,
"externalId": "CUST001",
"xsi:type": "listRel:Customer"
\},
"entityId": "Example Corp",
"customFieldList": {
"customField": [
{
"attributes": \{
"internalId": 100,
"xsi:type": "StringCustomFieldRef"
\}
}
]
}
},
{
"attributes": \{
"internalId": 12346,
"externalId": "CUST002",
"xsi:type": "listRel:Customer"
\},
"entityId": "Example Corp Subsidiary",
"customFieldList": {
"customField": [
{
"attributes": \{
"internalId": 100,
"xsi:type": "StringCustomFieldRef"
\}
}
]
}
}
],
"isSuccess": true
}
Search records (advanced)
Use a saved search to retrieve records from NetSuite. Sample Input
{
"search_record_advanced": \{
"type": "CustomerSearchAdvanced",
"xmlns_namespace": "listRel",
"saved_search_id": "customsearch_active_customers"
\},
"page_size": 50,
"search_criteria": [
\{
"name": "email",
"value": "@example.com"
\},
\{
"name": "mainline",
"value": "true"
\}
]
}
Sample Output
Search records more (by pagination)
Search more records for a given ID and page. Sample Input
\{
"search_id": "SEARCH_ID_12345",
"page": 2
\}
Sample Output
Update record
Update a record of a given type and ID. Sample Input
{
"internal_id": "12345",
"record": \{
"type": "customer",
"xmlns_namespace": "listRel"
\},
"fields": [
\{
"name": "companyName",
"value": "Acme Corporation"
\},
\{
"name": "email",
"value": "info@acmecorp.com"
\},
\{
"name": "phone",
"value": "555-123-4567"
\},
{
"name": "customField",
"attributes": {
"scriptId": "custentity_loyalty_level"
},
"value": "Gold"
}
]
}
Sample Output
{
"record": \{
"internalId": 12345,
"recordType": "customer"
\},
"isSuccess": true
}
Upsert record
Upsert a record of a given type. Existing records will be updated and new records will be added. Sample Input
{
"external_id": "EXT123456",
"record": \{
"type": "customer",
"xmlns_namespace": "listRel"
\},
"fields": [
\{
"name": "companyName",
"value": "Acme Corporation"
\},
\{
"name": "email",
"value": "info@acmecorp.com"
\},
\{
"name": "phone",
"value": "555-123-4567"
\},
{
"name": "addressbook",
"attributes": {
"addressbooktype": "defaultShipping"
},
"value": \{
"addr1": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345",
"country": "US"
\}
}
]
}
Sample Output
{
"record": \{
"internalId": 1234567,
"recordType": "customer",
"externalId": "EXT123456"
\},
"isSuccess": true
}