Netsuite REST Web Services
Netsuite REST Web Services
Netsuite REST Web Services
2021.1
This software and related documentation are provided under a license agreement containing restrictions
on use and disclosure and are protected by intellectual property laws. Except as expressly permitted
in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast,
modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any
means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for
interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-
free. If you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it
on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software,
any programs installed on the hardware, and/or documentation, delivered to U.S. Government end
users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation
and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and
adaptation of the programs, including any operating system, integrated software, any programs installed
on the hardware, and/or documentation, shall be subject to license terms and license restrictions
applicable to the programs. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management
applications. It is not developed or intended for use in any inherently dangerous applications, including
applications that may create a risk of personal injury. If you use this software or hardware in dangerous
applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other
measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages
caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks
of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks
are used under license and are trademarks or registered trademarks of SPARC International, Inc.
AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of
Advanced Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content,
products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and
expressly disclaim all warranties of any kind with respect to third-party content, products, and services
unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and
its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use
of third-party content, products, or services, except as set forth in an applicable agreement between you
and Oracle.
This documentation is in pre-General Availability status and is intended for demonstration and preliminary
use only. It may not be specific to the hardware on which you are using the software. Oracle Corporation
and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to
this documentation and will not be responsible for any loss, costs, or damages incurred due to the use of
this documentation.
The information contained in this document is for informational sharing purposes only and should be
considered in your capacity as a customer advisory board member or pursuant to your pre-General
Availability trial agreement only. It is not a commitment to deliver any material, code, or functionality, and
should not be relied upon in making purchasing decisions. The development, release, and timing of any
features or functionality described in this document remains at the sole discretion of Oracle.
This document in any form, software or printed matter, contains proprietary information that is the
exclusive property of Oracle. Your access to and use of this confidential material is subject to the terms
and conditions of your Oracle Master Agreement, Oracle License and Services Agreement, Oracle
PartnerNetwork Agreement, Oracle distribution agreement, or other license agreement which has
been executed by you and Oracle and with which you agree to comply. This document and information
contained herein may not be disclosed, copied, reproduced, or distributed to anyone outside Oracle
without prior written consent of Oracle. This document is not part of your license agreement nor can it be
incorporated into any contractual agreement with Oracle or its subsidiaries or affiliates.
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website
at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc
Oracle customers that have purchased support have access to electronic support through My Oracle
Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit http://
www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.
Sample Code
Oracle may provide sample code in SuiteAnswers, the Help Center, User Guides, or elsewhere through
help links. All such sample code is provided "as is” and “as available”, for use only with an authorized
NetSuite Service account, and is made available as a SuiteCloud Technology subject to the SuiteCloud
Terms of Service at www.netsuite.com/tos.
Oracle may modify or remove sample code at any time without notice.
As the Service is a multi-tenant service offering on shared databases, Customer may not use the Service
in excess of limits or thresholds that Oracle considers commercially reasonable for the Service. If Oracle
reasonably concludes that a Customer’s use is excessive and/or will cause immediate or ongoing
performance issues for one or more of Oracle’s other customers, Oracle may slow down or throttle
Customer’s excess use until such time that Customer’s use stays within reasonable limits. If Customer’s
particular usage pattern requires a higher limit or threshold, then the Customer should procure a
subscription to the Service that accommodates a higher limit and/or threshold that more effectively aligns
with the Customer’s actual usage pattern.
Beta Features
This software and related documentation are provided under a license agreement containing restrictions
on use and disclosure and are protected by intellectual property laws. Except as expressly permitted
in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast,
modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any
means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for
interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-
free. If you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it
on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software,
any programs embedded, installed or activated on delivered hardware, and modifications of such
programs) and Oracle computer documentation or other Oracle data delivered to or accessed by
U.S. Government end users are "commercial computer software" or “commercial computer software
documentation” pursuant to the applicable Federal Acquisition Regulation and agency-specific
supplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure,
modification, preparation of derivative works, and/or adaptation of i) Oracle programs (including any
operating system, integrated software, any programs embedded, installed or activated on delivered
hardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other
Oracle data, is subject to the rights and limitations specified in the license contained in the applicable
contract. The terms governing the U.S. Government’s use of Oracle cloud services are defined by the
applicable contract for such services. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management
applications. It is not developed or intended for use in any inherently dangerous applications, including
applications that may create a risk of personal injury. If you use this software or hardware in dangerous
applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other
measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages
caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks
of their respective owners.
Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks
are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD,
Epyc, and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a
registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content,
products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and
expressly disclaim all warranties of any kind with respect to third-party content, products, and services
unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and
its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use
of third-party content, products, or services, except as set forth in an applicable agreement between you
and Oracle.
This documentation is in pre-General Availability status and is intended for demonstration and preliminary
use only. It may not be specific to the hardware on which you are using the software. Oracle Corporation
and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to
this documentation and will not be responsible for any loss, costs, or damages incurred due to the use of
this documentation.
The information contained in this document is for informational sharing purposes only and should be
considered in your capacity as a customer advisory board member or pursuant to your pre-General
Availability trial agreement only. It is not a commitment to deliver any material, code, or functionality, and
should not be relied upon in making purchasing decisions. The development, release, and timing of any
features or functionality described in this document remains at the sole discretion of Oracle.
This document in any form, software or printed matter, contains proprietary information that is the
exclusive property of Oracle. Your access to and use of this confidential material is subject to the terms
and conditions of your Oracle Master Agreement, Oracle License and Services Agreement, Oracle
PartnerNetwork Agreement, Oracle distribution agreement, or other license agreement which has
been executed by you and Oracle and with which you agree to comply. This document and information
contained herein may not be disclosed, copied, reproduced, or distributed to anyone outside Oracle
without prior written consent of Oracle. This document is not part of your license agreement nor can it be
incorporated into any contractual agreement with Oracle or its subsidiaries or affiliates.
Answering the following questions will help us improve our help content:
■ Did you find the information you needed? If not, what was missing?
■ Did you find any errors?
■ Is the information clear?
■ Are the examples correct?
■ Do you need more examples?
■ What did you like most about this document?
Click here to send us your comments. If possible, please provide a page number or section title to identify
the content you're describing.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
Click the link for each letter to access details about the records in alphabetical order (available fields,
sublists, subrecords) and about the operations you can perform on the record.
For additional information about records, see the REST API Browser.
■ Account – AssemblyUnbuild
■ BillingAccount – BulkOwnershipTransfer
■ CalendarEvent – CustomerSubsidiaryRelationship
■ Department – DownloadItem
■ EmailTemplate – ExpenseReport
■ FairValuePrice – FulfillmentRequest
■ GenericResource – GlobalInventoryRelationship
■ InboundShipment – ItemSupplyPlan
■ Job – JournalEntry
■ KitItem – KitItem
■ LaborBasedProjectRevenueRule – Location
■ ManufacturingCostTemplate – MfgPlannedTime
■ Nexus – NoteType
■ Opportunity – OtherNameCategory
■ Partner – PurchaseRequisition
■ ReceiveInboundShipment – RevRecTemplate
■ SalesChannel – SupportCase
■ Task – TransferOrder
■ UnitsType – Usage
■ Vendor – VendorSubsidiaryRelationship
■ WebSite – Workplace
Account – AssemblyUnbuild
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
BillingAccount – BulkOwnershipTransfer
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
CalendarEvent – CustomerSubsidiaryRelationship
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
Department – DownloadItem
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
EmailTemplate – ExpenseReport
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
FairValuePrice – FulfillmentRequest
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
GenericResource – GlobalInventoryRelationship
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
InboundShipment – ItemSupplyPlan
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
Job – JournalEntry
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
KitItem – KitItem
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
LaborBasedProjectRevenueRule – Location
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
ManufacturingCostTemplate – MfgPlannedTime
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
Nexus – NoteType
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
Opportunity – OtherNameCategory
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
Partner – PurchaseRequisition
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
ReceiveInboundShipment – RevRecTemplate
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
SalesChannel – SupportCase
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
Task – TransferOrder
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
■ Task – ga – Task
■ TaxAcct – beta – Tax Acct
■ TaxGroup – beta – Tax Group
■ TaxPeriod – beta – Tax Period
■ TaxType – beta – Tax Type
■ Term – beta – Term
■ TimeBill – beta – Time Bill
■ TimeEntry – beta – Time Entry
■ TimeSheet – beta – Time Sheet
■ Topic – beta – Topic
■ TransferOrder – beta – Transfer Order
UnitsType – Usage
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
Vendor – VendorSubsidiaryRelationship
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
WebSite – Workplace
The following section lists records, their support level (generally available or beta), and a link to the REST
Records Browser where you can find detailed information about each record.
The majority of SuiteScript records is available as beta records. Refer to the REST web services API and the
developer documentation to learn the status of records.
All records in REST web services are considered beta until indicated otherwise. Beta records are marked
with a beta label in the REST API Browser.
Note: REST web services do not support legacy tax features. To work with taxation through REST
web services, you must have the SuiteTax feature enabled. For more information about using
SuiteTax, see the help topic SuiteTax.
Communication Records
■ Event
■ Message
■ Phone Call
■ Task
Entity Records
■ Contact
■ Contact Category
■ Contact Role
ERP Records
Marketing Records
■ Email Template
SuiteBilling Records
■ Billing Account
■ Change Order
■ Charge
■ Price Book
■ Price Plan
■ Subscription
■ Subscription Line
■ Subscription Plan
■ Subscription Term
■ Usage
■ Cash Sale
■ Invoice
■ Sales Order
Billing Account
A billing account record exposes a SuiteBilling account to REST web services. You can enable Billing
Accounts without enabling SuiteBilling.
This record:
■ is not a subrecord
■ has no subrecords
All elements on this record are accessible through REST web services.
The REST API Browser includes information about the field names and field types of the billing account
record, and about the HTTP methods, request parameters, and operations available to this record. For
details, see the REST API Browser’s billing account reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the billing account REST record is billingaccount.
Prerequisites
You must Enabling SuiteBilling Features before you can use this record through REST web services.
Limitations
A billing account REST record does not show related records.
Code Sample
{
"startDate": "2019-2-20",
"customer": {"id" : 1},
"billingSchedule": {"id": 1}
"currency": {"id" : 1}
}
Cash Sale
The cash sale record exposes a cash sale to REST web services.
To access this record in NetSuite, go to Transactions > Sales > Enter Cash Sales.
For information on the cash sale record user interface, see the help topic Cash Sales.
There are no prerequisites for using this record through REST web services.
The REST API Browser includes information about the field names and field types of the cash sale record,
and about the HTTP methods, request parameters, and operations available to this record. For details,
see the REST API Browser’s cash sale reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for a cash sale REST record is cashsale.
Code Samples
These samples show common use cases for cash sales.
{
"asofdate": "2021-03-15",
"enddate": "2021-06-15",
"entity": {
"id": "217"
},
"item": {
"items": [
{
"amount": 1000,
"item": {
"id": "143"
}
}
]
},
"startdate": "2021-03-15"
}
"asofdate": "2021-03-15",
"entity": {
"id": "218"
},
"itemcost": {
"items": [
{
"apply": true,
"doc": {
"id": "305"
},
"line": 1
}
]
}
}
{
"entity": {
"id": "217"
},
"expcost": {
"items": [
{
"apply": true,
"doc": {
"id": "303"
},
"line": 1
}
]
}
}
PATCH: https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/cashsale/<recordKey>
{
"item": {
"items": [
{
"line": 1,
"quantity": 5
}
]
},
"startDate": "2021-03-05",
"endDate": "2021-04-05"
}
Change Order
A change order record exposes a SuiteBilling change order to REST web services. This record has the
following subrecords:
■ subLine
■ newSubLine
■ renewalSteps
The REST API Browser includes information about the field names and field types of the change order
record, and about the HTTP methods, request parameters, and operations available to this record. For
details, see the REST API Browser’s change order reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the change order REST record is subscriptionChangeOrder.
Prerequisites
You must Enabling SuiteBilling Features before you can use this record through REST web services.
Code Sample
POST 'https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/subscriptionchangeorder' \
"action": "MODIFY_PRICING",
"subscription": 208,
"customer": 5,
"billingAccount": 2,
"subline": {
"items": [
{
"apply": true,
"sequence": 1,
"pricePlanNew": 541
}
]
}
}'
Charge
A charge record exposes a SuiteBilling charge to REST web services. This record:
■ is not a subrecord
■ has no subrecords
The REST API Browser includes information about the field names and field types of the charge record,
and about the HTTP methods, request parameters, and operations available to this record. For details,
see the REST API Browser’s charge reference page.
Record ID
The record ID for the charge REST record is charge.
Prerequisites
You must Enabling SuiteBilling Features before you can use this record through REST web services.
Additional Details
You must specify the stage field as an enumeration string. Possible values can be obtained through the
Metadata Catalog. Charge type must be specified as an internal ID. You can obtain possible values via
SuiteScript while creating a charge through the User Interface.
Code Sample
This sample shows a common billing usage case.
POST https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/charge
{
"billTo": 5,
"stage": "READY_FOR_BILLING",
"chargeDate": "2020-07-14",
"chargeType": -19,
"billingItem": 5,
"rate": 100.0,
"quantity": 1
}
Contact
A contact record exposes a contact to REST web services.
This record:
■ is not a subrecord
■ has no subrecords
The REST API Browser includes information about the field names and field types of the contact record,
and about the HTTP methods, request parameters, and operations available to this record. For details,
see the REST API Browser’s contact reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for a contact REST record is contact.
Code Sample
In the following example, <accountID> represents your account ID.
{
"firstName": "Peter",
"contactSource": "99994",
"comments": "Works directly with all key decision-makers."
}
Contact Category
A contact category record exposes a contact category to REST web services.
This record:
■ is not a subrecord
■ has no subrecords
All elements on this record are accessible through REST web services.
Record actions supported for this record type include delete, submitnew, and submitter. For more
information, see the help topic Supported Record Actions.
The REST API Browser includes information about the field names and field types of the contact category
record, and about the HTTP methods, request parameters, and operations available to this record. For
details, see the REST API Browser’s contactCategory reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for a contact category REST record is contactcategory.
Code Sample
In the following example, <accountID> represents your account ID.
{
"name": "ContactCategoryFour",
"externalid": "3929345",
"private": true
}
Contact Role
A contact role record exposes a contact role to REST web services.
This record:
■ is not a subrecord
■ has no subrecords
All elements on this record are accessible through REST web services.
The REST API Browser includes information about the field names and field types of the contact role
record, and about the HTTP methods, request parameters, and operations available to this record. For
details, see the REST API Browser’s contactRole reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for a contact role REST record is contactrole.
Code Sample
In the following example, <accountID> represents your account ID.
{
"name": "ContactRoleOne",
"description": "Key Contact",
"isinactive": true
}
The REST API Browser includes information about the field names and field types of the customer
subsidiary relationship record. It also includes the HTTP methods, request parameters, and operations
available to this record. For details, see the REST API Browser’s customerSubsidiaryRelationship reference
page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the subsidiary REST record is customerSubsidiaryRelationship.
Prerequisites
You must either use NetSuite OneWorld or have the Subsidiaries hidden feature enabled before you can
use this record through REST web services.
Supported Operations
The following operations are supported for REST web services:
Code Samples
The following code sample shows how to get a specific customerSubsidiaryRelationship record:
GET https://123456.suitetalk.api.netsuite.com/services/rest/record/v1/customersubsidiaryrelationship?q=entity
EQUAL 13 AND subsidiary EQUAL 5
The following code sample shows how to get the ID of a specific customerSubsidiaryRelationship record:
POST https://123456.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=5
Header:
'prefer: transient'
'Content-Type: application/json'
Body:
'{
"q": "SELECT id FROM customerSubsidiaryRelationship WHERE entity = 13 AND subsidiary = 5"
}'
The following code sample shows how to set the externalId for a specific customerSubsidiaryRelationship
record:
PATCH https://123456.suitetalk.api.netsuite.com/services/rest/record/v1/customersubsidiaryrelationship/1
Header:
'Content-Type: application/json'
Body:
'{
"externalId": "VSR1"
}'
Email Template
An email template record exposes an email template to REST web services.
The REST API Browser includes information about the field names and field types of the email template
record, and about the HTTP methods, request parameters, and operations available to this record. For
details, see the REST API Browser’s emailTemplate reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the email template REST record is emailtemplate.
Prerequisites
You must enable the CRM feature before you can use this record through REST web services.
Exposed Elements
The following email template record elements are exposed to REST web services:
Code Sample
In the following example, <accountID> represents your account ID.
{
"name": "EmailTemplateNine",
"addunsubscribelink": true,
"description": "Marketing Campaign Template"
}
Event
An event record exposes an event to REST web services.
This record:
■ is not a subrecord
■ has the following subrecords:
□ Attendee
□ CalendarEventRresourceMap
□ EventFile
The REST API Browser includes information about the field names and field types of the event record, and
about the HTTP methods, request parameters, and operations available to this record. For details, see the
REST API Browser’s event reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the event REST record is calendarevent.
Exposed Elements
The following event record elements are exposed to REST web services:
■ accesslevel
■ alldayevent
■ company
■ contact
■ createddate (Read only – set to current date)
■ customform
■ endtime (For alldayevent, set to 6pm)
■ id
■ location
■ message
■ organizer
■ owner (read only)
■ relateditem
■ resource
■ response
■ startdate
■ starttime (For alldayevent, set to 8am)
■ status
■ supportcase
■ timedevent
■ title
■ transaction
■ usernotes
Code Sample
In the following example, <accountID> represents your account ID.
Body – Request
{
"title": "Meeting with Tom",
"status": "CONFIRMED",
"message": "Bring Monthly Results",
"location": "Caffe West",
"startdate": "2022-11-02",
"starttime": "14:30",
"timedevent": true
}
URL: https://<accountID>/services/rest/record/v1/calendarevent/100425
Body – Response
{
"links": [
{
"rel": "self",
"href": http://<accountID>/services/rest/record/v1/calendarevent/100425
}
],
"accessLevel": {
"links": [],
"id": "PUBLIC",
"refName": "Public"
},
"allDayEvent": false,
"attendee": {
"links": [
{
"rel": "self",
"href": http://<accountID>/services/rest/record/v1/calendarevent/100425/attendee
}
]
},
"createdDate": "2020-11-25T16:40:00Z",
"customForm": {
"links": [],
"id": "-110",
"refName": "Standard Event Form"
},
"endTime": "15:30",
"id": "100425",
"lastModifiedDate": "2020-11-25T16:40:00Z",
"location": "Caffe West",
"message": "Bring Monthly Results",
"organizer": {
"links": [
{
"rel": "self",
"href": http://<accountID>/services/rest/record/v1/customer/-5
}
],
"id": "-5",
"refName": "A Wolfe-admin"
},
"owner": {
"links": [
{
"rel": "self",
"href": http://<accountID>/services/rest/record/v1/customer/-5
}
],
"id": "-5",
"refName": "-5"
}
"resource": {
"links": [
{
"rel": "self",
"href": "http://<accountID>.eng.netsuite.com/services/rest/record/v1/calendarevent/100425/resource"
}
]
},
"startDate": "2022-11-02",
"startTime": "14:30",
"status": {
"links": [],
"id": "CONFIRMED",
"refName": "Confirmed"
},
"timedEvent": true,
"timezone": "America/Los_Angeles",
"title": "Meeting with Tom"
}
Inventory Item
Inventory item records are used to track information about items for which you maintain a stock.
The REST API Browser includes information about the field names and field types of the event record, and
about the HTTP methods, request parameters, and operations available to this record. For details, see the
REST API Browser’s inventory item reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the journal entry REST record is inventoryItem.
Prerequisites
There are no prerequisites for using this record in REST.
Limitations
An inventory item REST record does not show Quantity Pricing Discount/Levels (quantitypricingdiscount,
quantitypricinglevel) or the Item Translations subtab (translations).
Code Sample
The following example shows how to get record metadata, create an inventory item.
Get Record:
GET https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryItem/<ID>?expandSubResources=true
Update Record:
PATCH https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryItem/<ID>
Header: Content-Type: application/json
Body:
{
"itemId": "Updated item name",
"upcCode: "123456"
}
PATCH
https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryItem/<ID>/price/currencypage=1,pricelevel=1,quantity=10
Header: Content-Type: application/json
Body:
{
"price": 10
}
Invoice
The invoice record exposes an invoice to REST web services.
To access this record in NetSuite, go to Transactions > Sales > Create Invoices.
For information on the invoice record user interface, see the help topic Invoices.
There are no prerequisites for using this record through REST web services.
The REST API Browser includes information about the field names and field types of the invoice record,
and about the HTTP methods, request parameters, and operations available to this record. For details,
see the REST API Browser’s invoice reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for an invoice REST record is invoice.
Code Samples
These samples show common use cases for invoices
{
"asofdate": "2021-03-15",
"enddate": "2021-06-15",
"entity": {
"id": "220"
},
"item": {
"items": [
{
"amount": 1000.0,
"item": {
"id": "144"
}
}
]
},
"startdate": "2021-03-15",
"subsidiary": {
"id": "1"
},
"terms": {
"id": "1"
}
{
"asofdate": "2021-03-15",
"entity": {
"id": "221"
},
"itemcost": {
"items": [
{
"apply": true,
"doc": {
"id": "310"
},
"line": 1
}
]
}
}
{
"entity": {
"id": "220"
},
"time": {
"items": [
{
"apply": true,
"doc": {
"id": "1"
},
"rate": 10
}
]
}
}
PATCH: https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/invoice/<recordKey>
{
"item": {
"items": [
{
"line": 1,
"rate": 50.00
}
]
},
"tranDate": "2021-03-05"
}
Item Fulfillment
An item fulfillment transaction records the shipment of some or all items on an order to the customer.
The processes for item fulfillment transactions depend on whether the Advanced Shipping feature is
enabled.
■ If Advanced Shipping is not enabled, the fulfillment and invoicing processes are combined. When an
item fulfillment is created, a related invoice is created at the same time.
■ If Advanced Shipping is enabled, fulfillment and invoicing are two independent processes, and
shipments can be recorded separately from billing.
For more information on item fulfillment entries, see the help topic Order Fulfillment.
This record:
The REST API Browser includes information about the field names and field types of the event record, and
about the HTTP methods, request parameters, and operations available to this record. For details, see the
REST API Browser’s item fulfillment reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the journal entry REST record is ItemFulfillment.
Prerequisites
There are no prerequisites for using this record in REST.
Code Sample
The following example shows how to create an item fulfillment from a sales order record.
POST https://<accountID>/services/rest/record/v1/salesorder/{{SALES_ORDER_ID}}/!transform/itemFulfillment
{
"item":{
"items":[
{
"orderLine":1,
"location":6,
"itemreceive": true
}
{
"orderLine": 3
"location": 6,
"itemreceive": false
}
]
}
}
Journal Entry
You use the journal entry record to adjust balances in accounts. Journal entries let you change the value
of any set of accounts without having to enter a posting transaction. In an account that has the Multi-
Book Accounting feature enabled, you can also use this record to create book specific journal entries.
For more information on journal entries in NetSuite, see the help topic Journal Entries.
This record:
■ is not a subrecord
■ has the following subrecords:
□ journalentryline
□ accountingbookdetail
The REST API Browser includes information about the field names and field types of the journal entry
record, and about the HTTP methods, request parameters, and operations available to this record. For
details, see the REST API Browser’s journalentry reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the journal entry REST record is journalentry.
Prerequisites
There are no prerequisites for using the record in REST.
Limitations
■ Tax-related fields are not supported in REST.
■ The accounting book detail sublist is part of the Multi-Book Accounting feature (and its related
features). For more information, see the help topic Multi-Book Accounting.
■ Read-only sublists, including system notes and GL impact, are not supported in REST.
Code Sample
{
"subsidiary": { "id": "1" },
"line": {
"items": [
{
"account": { "id": "58" },
"debit": 187,
"memo": "Journal Example"
},
{
"account": { "id": "4" },
"credit": 187
}
]
}
Message
A message record exposes a message to REST web services.
■ MessageFile
■ CcBccRecipient
The REST API Browser includes information about the field names and field types of the message record,
and about the HTTP methods, request parameters, and operations available to this record. For details,
see the REST API Browser’s message reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the message REST record is Message.
Exposed Elements
The following message record elements are exposed to REST web services:
■ activity
■ author
■ authoremail
■ bcc
■ cc
■ emailed
■ entity
■ externalid
■ hasattachment
■ htmlmessage
■ id
■ incoming
■ lastmodifieddate
■ message
■ messagedate
■ recipient
■ recipientemail
■ record
■ recordtype
■ subject
■ template
■ time
■ transaction
Usage Notes
All fields are read-only.
Code Sample
In the following example, <accountID> represents your account ID.
Body – Request
{
"subject": "Meeting agenda",
"message": "Please send the agenda for tomorrow's meeting.",
"author": "-5",
"authorEmail": "sender@your.company.com",
"recipientEmail": "recipient@your.company.com",
"cc": "cc_recipient@your.company.com",
"bcc": "bcc_recipient@your.company.com"
}
URL: https://<accountID>/services/rest/record/v1/message/230
Body – Response
{
"links": [
{
"rel": "self",
"href": http://<accountID>/services/rest/record/v1/message/230
}
],
"author": {
"links": [
{
"rel": "self",
"href": http://<accountID>/services/rest/record/v1/customer/-5
}
],
"id": "-5",
"refName": "A Wolfe-admin"
},
"authorEmail": "sender@your.company.com",
"bcc": "bcc_recipient@your.company.com",
"cc": "cc_recipient@your.company.com",
"emailed": true,
"hasAttachment": false,
"htmlMessage": true,
"htmlMessage": true,
"id": "230",
"incoming": true,
"lastModifiedDate": "2020-11-25T16:32:00Z",
"message": "Please send the agenda for tomorrow's meeting.",
"messageDate": "2020-11-25",
"recipient": {
"links": [
{
"rel": "self",
"href": "<accountID>/services/rest/record/v1/customer/-5"
}
],
"id": "-5",
"refName": "A Wolfe-admin"
},
"recipientEmail": "recipient@your.company.com",
The REST API Browser includes information about the field names and field types of the event record, and
about the HTTP methods, request parameters, and operations available to this record. For details, see the
REST API Browser’s non-inventory sale item reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the journal entry REST record is noninventorySaleItem.
Prerequisites
There are no prerequisites for using this record in REST.
Code Samples
The following example shows how to get record metadata, create an inventory item.
GET https://<accountID>/services/rest/record/v1/metadata-catalog/nonInventorySaleItem
Header: Accept: application/swagger+json
Get Record:
GET https://<accountID>/services/rest/record/v1/nonInventorySaleItem/<ID>
Update Record:
PATCH https://<accountID>/services/rest/record/v1/nonInventorySaleItem/<ID>
Header: Content-Type: application/json
Body:
{
"itemId": "Updated item name",
"upcCode: "123456"
}
PATCH
https://<accountID>/services/rest/record/v1/nonInventorySaleItem/<ID>/price/currencypage=1,pricelevel=1,quantity=10
Header: Content-Type: application/json
Body:
{
"price": 10
}
Phone Call
A phone call record exposes a phone call to REST web services.
This record:
■ is not a subrecord
■ has the following subrecord:
□ EventFile
The REST API Browser includes information about the field names and field types of the phone call record,
and about the HTTP methods, request parameters, and operations available to this record. For details,
see the REST API Browser’s phone call reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the phone call REST record is phonecall.
Exposed Elements
The following phone call record elements are exposed to REST web services:
■ accesslevel
■ assigned
■ bom (Requires Advanced Bill of Materials feature)
■ bomversion (Requires Advanced Bill of Materials feature)
■ company
■ completed date (a change here can be overwritten by change in status when set to completed in a
separate modification, and cannot be set to custom date in the same message that completes the call)
■ contact
■ create date (Read only)
■ customform (Enumerated)
■ enddate
■ endtime
■ externalid
■ id
■ lastmodifieddate (Cannot be manually changed)
■ message
■ owner
■ phone
■ priority
■ relateditem
■ reminderminutes (Enumerated)
■ startdate
■ starttime
■ status
■ supportcase
■ timedvent
■ title
■ transaction
■ mfgrouting (Manufacturing Routing feature required)
Code Sample
In the following example, <accountID> represents your Account ID.
Request – Body
{
"title": "Call with Tom",
"phone": "650-555-1234",
"priority": "MEDIUM",
"starttime": "16:30",
"timedevent": true
}
URL: https://<accountID>/services/rest/record/v1/phonecall/100525
Body – Response
{
"links": [
{
"rel": "self",
"http://<accountID>/services/rest/record/v1/phonecall/100525
}
],
"accessLevel": false,
"assigned": {
"links": [
{
"rel": "self",
"href": "http://<accountID>/services/rest/record/v1/customer/-5"
}
],
"id": "-5",
"refName": "A Wolfe-admin"
},
"createdDate": "2020-11-25T16:54:00Z",
"customForm": {
"links": [],
"id": "-150",
"refName": "Standard Phone Call Form"
},
"endTime": "17:30",
"id": "100525",
"lastModifiedDate": "2020-11-25T16:54:00Z",
"owner": {
"links": [
{
"rel": "self",
"href": "http://<acountID>/services/rest/record/v1/customer/-5"
}
],
"id": "-5",
"refName": "-5"
},
"phone": "650-555-1234",
"priority": {
"links": [],
"id": "MEDIUM",
"refName": "Medium"
},
"sendEmail": false,
"startDate": "2022-11-01",
"startTime": "16:30",
"status": {
"links": [],
"id": "SCHEDULED",
"refName": "Scheduled"
},
"timedEvent": true,
"timezone": "America/Los_Angeles",
"title": "Call with Tom"
}
Price Book
A price book record exposes a SuiteBilling price book to REST web services.
This record:
■ is not a subrecord
■ has no subrecords
The REST API browser includes information about the field names and field types of the price book record,
and about the HTTP methods, request parameters, and operations available to this record. For details,
see the REST API Browser’s price book reference page.
For information on using the REST API browser, see the help topic The REST API Browser.
Record ID
The record ID for a price book REST record is pricebook.
Prerequisites
You must Enabling SuiteBilling Features before you can use this record through REST web services.
Code Samples
These samples show common use cases for creating price books with all header fields.
{
"subscriptionplan" : {"id" : "{{existing_subscription_plan_id}}"},
"currency" : {"id" : "1"},
"name": "My Price Book {{$timestamp}}",
"priceinterval": {
"items": [
{
"priceplan": {"id": "{{last_priceplan}}"},
"frequency": "MONTHLY",
"repeatevery": "1",
"startoffsetvalue": 1
}
]
}
}
{
"priceinterval": {
"items": [
{
"groupid":"438",
"linenumber" : "1",
"chargetype":"2",
"priceplan": {"id": "1017"},
"frequency": "MONTHLY",
"repeatevery": "1",
"startoffsetvalue": "8",
"startoffsetunit": "MONTH",
"isrequired": true,
"item": { "id": "15" },
"subscriptionplanlinenumber" : "1",
"subscriptionplanline":"20"
}
]
}
}
Price Plan
A price plan record exposes a SuiteBilling price plan to REST web services.
This record:
■ is not a subrecord
■ has no subrecords
The REST API Browser includes information about the field names and field types of the price plan record,
and about the HTTP methods, request parameters, and operations available to this record. For details,
see the REST API Browser’s price plan reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for a price plan REST record is priceplan.
Prerequisites
You must Enabling SuiteBilling Features before you can use this record through REST web services.
Code Sample
{
"currency": {"id": "1"},
"priceplantype": "2",
"pricetiers": {
"items": [
{
"fromval": 0,
"pricingoption": {"id": "-102"},
"value": 50.00
}
]
}
}
Purchase Order
NetSuite exposes the purchase order record to REST web services. This record has the following
subrecords:
■ billingAddress
■ shippingAddress
The following elements are not accessible through REST web services:
■ accounting books
■ items
■ tax detail
If the Allow Expenses on Purchases accounting preference is set, the expenses sublist is also not
accessible.
All other elements on this record are accessible through REST web services.
The REST API Browser includes information about the field names and field types of the task record, and
about the HTTP methods, request parameters, and operations available to this record. For details, see the
REST API Browser’s purchase order reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for a purchase order REST record is purchaseOrder
Prerequisites
You must enable the Purchase Orders feature before you can use this record through REST web services.
Code Samples
The following samples show common use cases for a purchase order record.
Sales Order
A sales order record exposes a sales order to REST web services. This record has one subrecord:
salesOrderItem.
To access this record in NetSuite, go to Transactions > Sales > Enter Sales Order.
The REST API Browser includes information about the field names and field types of the sales order
record, and about the HTTP methods, request parameters, and operations available to this record. For
details, see the REST API Browser’s sales order reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for a sales order REST record is salesorder.
Prerequisites
You must enable Unified Pricing before you can use this record through REST web services.
Code Samples
These samples show common use cases for sales orders. The example ID is 1504.
GET: https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesorder/1504
PATCH: https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesorder/1504
{"istaxable":false}
{
"item": {
"items": [
{
"line":1,
"item": {
"id": 328
},
"amount": 54.0
}
}
}
}
Subscription
A subscription record exposes a SuiteBilling subscription to REST web services. This record:
■ is not a subrecord
■ has no subrecords
The REST API Browser includes information about the field names and field types of the subscription
record, and about the HTTP methods, request parameters, and operations available to this record. For
details, see the REST API Browser’s subscription reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for a subscription REST record is subscription.
Prerequisites
You must Enabling SuiteBilling Features before you can use this record through REST web services.
Limitations
A subscription REST record does not show change orders, related records, or system information.
Code Samples
These samples show common use cases for creating subscriptions.
}
}
"startDate": "2019-2-20",
"billingFrequency": "MONTHLY",
"subscriptionline": {
"items": [{
"linenumber": 4,
"includeinrenewal": true,
"item": 5,
"subscriptionlinetype": 2,
"billingMode": "IN_ADVANCE",
"proratestartdate": false,
"prorateenddate": true,
"isincluded": false
}]
},
"priceinterval": {
"items": [{
"subscriptionplanlinenumber": 4,
"linenumber": 4,
"quantity": 3,
"repeatEvery": 2,
"pricePlan": {"id": 1217},
"frequency": "ANNUALLY"
}]
}
}
Subscription Line
A subscription line record exposes a SuiteBilling subscription line to REST web services.
The REST API Browser includes information about the field names and field types of the subscription line
record, and about the HTTP methods, request parameters, and operations available to this record. For
details, see the REST API Browser’s subscription line reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for a subscription line REST record is subscriptionline.
Prerequisites
You must Enabling SuiteBilling Features before you can use this record through REST web services.
Limitations
A subscription line REST record does not show system notes.
You cannot directly create or delete the exposed subscription line record, but you can update some of the
fields.
Code Sample
Sample Update:
{
"subscriptionlinestatus": "PENDING_ACTIVATION",
"proratestartdate": false,
"prorateenddate": false,
"includeinrenewal": false
}
Subscription Plan
A subscription plan is a stand-alone record that exposes a SuiteBilling subscription plan to REST web
services.
A subscription requires a subscription plan, but the subscription plan is not always tied to a subscription.
The REST API Browser includes information about the field names and field types of the subscription plan
record, and about the HTTP methods, request parameters, and operations available to this record. For
details, see the REST API Browser’s subscription plan reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for a subscription plan REST record is subscriptionplan.
Prerequisites
You must Enabling SuiteBilling Features before you can use this record through REST web services.
Limitations
A subscription plan REST record does not show price books or related records.
When you access this record through REST web services, there is no link available for creating price
books.
Code Sample
This sample shows a common use case for creating a subscription plan.
Subscription Term
A subscription term is a stand-alone record that exposes a SuiteBilling subscription term to REST web
services.
The REST API Browser includes information about the field names and field types of the subscription term
record, and about the HTTP methods, request parameters, and operations available to this record. For
details, see the REST API Browser’s subscription term reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for a subscription term REST record is subscriptionterm.
Prerequisites
You must Enabling SuiteBilling Features before you can use this record through REST web services.
Code Sample
This sample shows a common use case for creating a subscription plan.
Subsidiary
NetSuite exposes the subsidiary record to REST web services. The subsidiary record enables you to
manage data for a hierarchical structure of separate legal entities. See the help topic Subsidiaries in
OneWorld.
The REST API Browser includes information about the field names and field types of the subsidiary record.
It also includes the HTTP methods, request parameters, and operations available to this record. For
details, see the REST API Browser’s subsidiary reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the subsidiary REST record is subsidiary.
■ mainaddress
■ shippingaddress
■ returnaddress
Prerequisites
You must either use NetSuite OneWorld or have the Subsidiaries hidden feature enabled before you can
use this record through REST web services.
Exposed Elements
The following subsidiary record elements are exposed to REST web services:
■ (internalid) - internal id
■ (externalid) - external id
■ (isinactive) - subsidiary is inactive
■ (legalname) - legal name
■ (name) - name
■ (fullname) - (search-only field)
■ (parent) - subsubsidiary of
■ (currency) - currency
■ (iselimination) - elimination
■ (country) - country
■ (state) - state/province
■ (url) - web site
■ (email) - return email address
■ (fax) - fax
The following subsidiary subrecord elements are exposed to REST web services:
Limitations
Only GET (Read, Search) operation is supported for REST web services. POST (create), PATCH (update), and
DELETE are not supported. Tax-related fields are not supported in REST.
Code Samples
The following code samples show a common use case for getting supported elements from the
subsidiary REST record.
{GET /services/rest/record/v1/subsidiary/<id>}
Task
A task record exposes a task to REST web services.
This record:
■ is not a subrecord
■ has the following subrecords
□ EventFile
□ TaskCompanyMap
□ TaskContactMap
The REST API Browser includes information about the field names and field types of the task record, and
about the HTTP methods, request parameters, and operations available to this record. For details, see the
REST API Browser’s task reference page.
For more information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the task REST record is task.
Exposed Elements
The following task record elements are exposed to REST web services:
■ accesslevel
■ assigned
■ bom (Requires Advanced Bill of Materials feature)
■ bomrevision ( Requires Advanced Bill of Materials feature)
■ company
■ contact
■ createdate (Read only)
■ customform
■ duedate
■ endtime
■ externalid
■ id
■ nessage
■ order
■ owner
■ percentcomplete
■ priority
■ relateditem
■ reminderminutes
■ sendemail
■ startdate
■ starttime
■ status
■ supportcase
■ timedevent
■ title
■ transaction
■ usernotes
Code Sample
In the following example, <accountID> represents your account ID.
Request – Body
{
"title": "Prepare sales slides",
"message": "Charts are required",
"priority": "HIGH",
"duedate": "2022-11-03",
"timedevent": true
}
URL: https://<accountID>/services/rest/record/v1/task
Response – Body
{
"links": [
{
"rel": "self",
"href": "http://<accountID>/services/rest/record/v1/task/100526
}
],
"accessLevel": false,
"assigned": {
"links": [
{
"rel": "self",
"href": "http://<account>/service/rest/record/v1/customer/-5"
}
],
"id": "-5",
"refName": "A Wolfe-admin"
},
"createdDate": "2020-11-25T17:13:00Z",
"links": [],
"id": "-120",
"refName": "Standard Task Form"
},
"dueDate": "2022-11-03",
"endTime": "10:00",
"id": "100526",
"lastModifiedDate": "2020-11-25T17:13:00Z",
"message": "Charts are required",
"owner": {
"links": [
{
"rel": "self",
"href": "http://<accountID>/services/rest/record/v1/customer/-5"
}
],
"id": "-5",
"refName": "-5"
},
"percentTimeComplete": 0.0,
"priority": {
"links": [],
"id": "HIGH",
"refName": "High"
},
"sendEmail": false,
"startDate": "2020-11-25",
"startTime": "09:00",
"status": {
"links": [],
"id": "NOTSTART",
"refName": "Not Started"
},
"timedEvent": true,
"timeRemaining": "0:00",
"timeRemaining": "0:00",
"timezone": "America/Los_Angeles",
"title": "Prepare sales slides"
}
Usage
A usage record exposes SuiteBilling usage to REST web services. This record:
■ is not a subrecord
■ has no subrecords
The REST API Browser includes information about the field names and field types of the usage record, and
about the HTTP methods, request parameters, and operations available to this record. For details, see the
REST API Browser’s usage reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for a usage REST record is usage.
Prerequisites
You must Enabling SuiteBilling Features before you can use this record through REST web services.
This record also requires, at a minimum, a customer, subscription, subscription plan, and subscription
line.
Code Sample
This sample shows a common usage case.
POST https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/usage
{
"memo": "Record of usage",
"usageQuantity": 33,
"usageDate": "2020-07-14",
"customer": 5,
"subscriptionPlan": 8,
"usageSubscription": 208,
"usageSubscriptionLine": 235
}
The REST API Browser includes information about the field names and field types of the vendor subsidiary
relationship record. It also includes the HTTP methods, request parameters, and operations available to
this record. For details, see the REST API Browser’s vendorSubsidiaryRelationship reference page.
For information on using the REST API Browser, see the help topic The REST API Browser.
Record ID
The record ID for the vendor subsidiary relationship REST record is vendorSubsidiaryRelationship.
Prerequisites
You must either use NetSuite OneWorld or have the Subsidiaries hidden feature enabled before you can
use this record through REST web services.
Supported Operations
The following operations are supported for REST web services:
Code Samples
The following code sample shows how to get a specific vendorSubsidiaryRelationship record:
GET https://123456.suitetalk.api.netsuite.com/services/rest/record/v1/vendorsubsidiaryrelationship?q=entity
EQUAL 13 AND subsidiary EQUAL 5
The following code sample shows how to get the ID of a specific vendorSubsidiaryRelationship record:
POST https://123456.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=5
Header:
'prefer: transient'
'Content-Type: application/json'
Body:
'{
"q": "SELECT id FROM vendorSubsidiaryRelationship WHERE entity = 13 AND subsidiary = 5"
}'
The following code sample shows how to set the externalId and creditLimit for a specific
vendorSubsidiaryRelationship record:
PATCH 'https://123456.suitetalk.api.netsuite.com/services/rest/record/v1/vendorsubsidiaryrelationship/1'
Header:
'Content-Type: application/json'
Body:
'{
"externalId": "VSR1",
"creditLimit": 150
}'
A sales order is a transaction that records a commitment to sell items or services to a customer. Sales
orders have no accounting impact until items ship or services are completed. For more information on
NetSuite sales orders, see the help topic Creating Sales Orders.
Variable Definition
{{REST_SERVICES}} Indicates your access to the NetSuite REST Service (for example, https://
testaccount.corp.netsuite.com/services/rest).
{{*_ID}} These variables refer to the internal ID of the record. For example, ESTIMATE_ID or
SALES_ORDER_ID.
The IDs and the variables used in the following scenarios are examples only, and are included to show
how to write REST commands.
POST {{REST_SERVICES}}/record/v1/estimate/{{ESTIMATE_ID}}/!transform/salesOrder
This function takes an estimate with an ID of {{ESTIMATE_ID}} and transforms it into a sales order. You
can also specify in the body of the request which fields you want to change during the transformation.
POST {{REST_SERVICES}}/record/v1/estimate/{{ESTIMATE_ID}}/!transform/salesOrder
{
"memo": "Transformed Estimate to Sales Order!"
}
POST {{REST_SERVICES}}/record/v1/salesOrder
{
"entity": {
"id": "110"
},
"item": {
"items": [
{
"item": {
"id": 98
},
"quantity": 1
}
]
}
}
{
"entity": {
"id": "110"
},
"customForm": "68",
"tranDate": "2020-6-15",
"otherrefnum": "11037",
"memo": "This is a test memo!",
"item": {
"items": [
{
"item": {
"id": 98
},
"quantity": 1,
"Description": "Test Item"
}
]
}
}
POST {{REST_SERVICES}}/record/v1/salesOrder
{
"entity": {
"id": "110"
},
"promocode": { "id": 1 },
"item": {
"items": [
{
"item": {
"id": 98
},
"quantity": 1
}
]
}
}
POST {{REST_SERVICES}}/record/v1/salesOrder
{{
"entity": {
"id": "110"
},
"discountitem": { "id": 99 }
"item": {
"items": [
{
"item": {
"id": 98
},
"quantity": 1
}
]
}
}
PATCH {{REST_SERVICES}}/record/v1/salesOrder/{{SALES_ORDER_ID}}
{
"discountitem": { "id": 99 }
}
GET {{REST_SERVICES}}/record/v1/salesOrder/{{ID}}
In the response body, you can see all the data pertaining to the sales order. The data includes the specific
field values that you set, as well as default values for the fields that you did not set.
Each of the sublists has its own endpoint for you to gather field data for each line.
GET Request Results
{
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/salesOrder/18"
}
],
"altSalesTotal": 0.0,
"balance": 0.0,
"balreadyrefunded": "F",
"billingaddress": {
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/salesorder/18/billingaddress"
}
]
},
"canBeUnapproved": true,
"carrier": "nonups",
"ccApproved": false,
"ccProcessAsPurchaseCard": false,
"checkCommitted": false,
"createdDate": "2020-07-29T08:34:00Z",
"credholdentity": 110,
"credholdoverride": "F",
"currency": {
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/currency/1"
}
],
"id": "1",
"refName": "USA"
},
"currencyName": "USA",
"currencyPrecision": 2,
"currencysymbol": "USD",
"customForm": "68",
"defaultCatchUp": 92,
"deferredrevenue": 0.0,
"discountTotal": 0.0,
"edition": "US",
"entity": {
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/customer/110"
}
],
"id": "110",
"refName": "Anonymous Customer"
},
"entity_nexus_country": "US",
"entityfieldname": "entity",
"entityNexus": {
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/nexus/1"
}
],
"id": "1",
"refName": "US-CA"
},
"exchangeRate": 1.0,
"excludecommission": false,
"getAuth": false,
"giftCertApplied": 0.0,
"giftCertRedemption": {
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/salesorder/18/giftCertRedemption"
}
]
},
"hasanydelayedrevrec": false,
"hasFedexFreightService": false,
"hasprecalcs": false,
"id": "18",
"ignoreAvs": false,
"ignoreAvsVis": false,
"ignoreCsc": false,
"ignoreCscVis": false,
"installmentcount": 0,
"invertrevrecschedule": false,
"iseitf81on": false,
"isOnlineTransaction": "F",
"isRecurringPayment": false,
"item": {
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/salesorder/18/item"
}
]
},
"itemShippingCostFxRate": 1,
"lastModifiedDate": "2020-07-29T08:34:00Z",
"linkedTrackingNumberList": {
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/salesorder/18/linkedTrackingNumberList"
}
]
},
"manualCreditHold": "F",
"needsbill": "F",
"needsPick": true,
"nextbill": "2020-07-29",
"nexus": {
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/nexus/1"
}
],
"id": "1",
"refName": "US-CA"
},
"nexus_country": "US",
"oldrevenuecommitment": false,
"ordbilled": "F",
"orderStatus": "A",
"ordpicked": false,
"ordrecvd": false,
"originalNexus": {
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/nexus/1"
}
],
"id": "1",
"refName": "US-CA"
},
"originalNexusCountry": "US",
"overallbalance": 0.0,
"overallunbilledorders": 39.95,
"paymentSessionAmount": 39.95,
"payPalOverride": false,
"payPalProcess": false,
"prevDate": "2020-07-29",
"primarycurrency": 1.0,
"primarycurrencyfxrate": 1.0,
"recognizedrevenue": 0.0,
"revenuestatus": "A",
"saleseffectivedate": "2020-07-29",
"salesTeam": {
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/salesorder/18/salesTeam"
}
]
},
"shipComplete": false,
"shipDate": "2020-07-29",
"shipIsResidential": false,
"shipItemHasFreeShippingItems": false,
"shipOverride": false,
"shippingAddress": {
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/salesorder/18/shippingAddress"
}
]
},
"shippingCostOverridden": false,
"status": "A",
"storeorder": "F",
"subsidiary": {
"links": [
{
"rel": "self",
"href": "https://runbox3.corp.netsuite.com/services/rest/record/v1/subsidiary/1"
}
],
"id": "1",
"refName": "Parent Company"
},
"subtotal": 39.95,
"taxTotal": 0.0,
"threedStatusCodeVis": false,
"toBeEmailed": false,
"toBeFaxed": false,
"toBePrinted": false,
"total": 39.95,
"tranDate": "2020-07-29",
"tranId": "1",
"tranisvsoebundle": false,
"unbilledOrders": 39.95,
"usingVSOEFldSet": false,
"vsoeautocalc": false,
"warnNexusChange": false,
"webstore": "F",
"weekendpreference": "ASIS"
}
PATCH {{REST_SERVICES}}/record/v1/salesOrder/{{SALES_ORDER_ID}}
{ "orderStatus": "B" }
PATCH {{REST_SERVICES}}/record/v1/salesOrder/{{SALES_ORDER_ID}}
To update a field for a specific line, specify the line number in the body of your request.
{
"item": {
"items": [
{
"line": 1,
"isclosed": true
}
]
}
PATCH {{REST_SERVICES}}/record/v1/salesOrder/{{SALES_ORDER_ID}}
{
"item": {
"items": [
{
"item": { "id": 98 },
"quantity": 2
}
]
}
}
Remove an Item
After saving a sales order, you can use the sales order’s ID to remove an item by using the following
PATCH call. Using an existing sales order, update {{salesOrderId}} with the ID of the sales order you wish
to modify and specify the new items. When specifying the new items in the sales order, make sure the
item you wish to remove is no longer listed.
PATCH {{REST_SERVICES}}/record/v1/salesOrder/{{salesOrderId}}?replace=item
Note: Currently, there is no option to individually delete a specific line through REST, so you can
make the lines optional and let the sales person enforce this rule.
{
"item": {
"items": [{
"item": { "id": {{itemId}} },
"rate": 40
}, {
"item": { "id": {{itemId}} },
"rate": 50
}]
}
}
A Pending Approval
B Pending Fulfillment
To create a preapproved sales order, set the orderStatus in the POST request to "B".
POST {{REST_SERVICES}}/record/v1/salesOrder
{
"entity": {
"id": "110"
},
"orderStatus": "B",
"item": {
"items": [
{
"item": {
"id": 98
},
"quantity": 1
}
]
}
}
If you want to create a sales order that requires approval after you create it, send in a PATCH request with
orderStatus "B" in the body.
PATCH {{REST_SERVICES}}/record/v1/salesOrder/{{SALES_ORDER_ID}}
{
"orderStatus": "B"
}
PATCH {{REST_SERVICES}}/record/v1/salesOrder/{{SALES_ORDER_ID}}
{
"orderStatus": "A"
}
PATCH {{REST_SERVICES}}/record/v1/salesOrder/{{SALES_ORDER_ID}}
{
"item": {
"items": [
{
"line": 1,
"isclosed": true
},
{
"line": 2,
"isclosed": true
},
{
"line": 3,
"isclosed": true
}
]
}
}
POST {{REST_SERVICE}}/record/v1/salesorder/{{SALES_ORDER_ID}}/!transform/itemfulfillment
■ In the first grouping, you partially fulfill an order by specifying a quantity of less than the full order
("quantity": 1).
■ In the second grouping, you leave the order unfulfilled by setting the itemreceive parameter to false
("itemreceive": false).
{
"item": {
"items": [
{
"orderLine": 1,
"location": 6,
"quantity": 1
},
{
"orderLine": 4,
"location": 6,
"itemreceive": false
}
]
}
}
Note: Like the provided code sample, your sales order may not have sequential order lines. For
example, "orderLine": 4 follows "orderLine": 1 in the code sample.
To check the correct orderLine number for an item, use a GET call to retrieve the sales order item
information through REST as show here:
GET {{REST_SERVICES}}/record/v1/salesOrder/{{ID}}/item
Create an Invoice
To create an invoice from a sales order, you need an approved sales order with the Custom Form field set
to Standard sales order - Invoice and some fulfilled items.
POST {{REST_SERVICES}}/record/v1/salesorder/{{SALES_ORDER_ID}}/!transform/invoice
If you leave the request body empty, NetSuite creates an Invoice for all fulfilled items and quantities.
However, if you plan to fulfill only part of the order, you need to be able to create a matching partial
invoice. As shown in the example, you can create a partial invoice by specifying the quantity for each item
line.
{
"item": {
"items": [
{
"orderLine": 1,
"quantity": 3
},
{
"orderLine": 2,
"quantity": 0
}
]
}
}
POST {{REST_SERVICES}}/record/v1/salesorder/{{SALES_ORDER_ID}}/!transform/cashsale
If you leave the request body empty, NetSuite creates a cash sale for all fulfilled items and quantities.
You can create a partial cash sale by specifying the quantity for each item line as shown in the following
example.
{
"item": {
"items": [
{
"orderLine": 1,
"quantity": 0
},
{
"orderLine": 2,
"quantity": 4
}
]
}
}
■ a value for the entity field that corresponds to the customer on the sales order
■ at least one item
Field on the Sales Order Corresponding Field on the Custom Form Valid Values
B - Pending Fulfillment
For more information, see the help topic Creating Progress Sales Orders.
POST {{REST_SERVICES}}/record/v1/salesorder
{
"customform": 86, //For custom form "Standard Sales Order - Progress Billing"
"entity": {
"id": "110"
},
"trandate": "2020-07-30", //optional field
"orderstatus": "B", //optional field
"terms": 3, //optional field
"item": {
"items": [
{
"item": {
"id": 98
},
"quantity": 1
},
{
"item": {
"id": 98
},
"quantity": 2
},
{
"item": {
"id": 98
},
"quantity": 3
}
]
}
}
DELETE {{REST_SERVICES}}/record/v1/salesOrder/{{ID}}
In this use case, you create the necessary records using REST for your fictitious company, CED Cyber
Solutions.
■ Setup
■ License
■ Seats
■ Bronze Support
■ Silver Support
■ Gold Support
You need to create a subscription term because you want your subscription plan to have an initial term of
three years.
Although the subscription plan depends on these records, this use case does not cover how to create
them through REST. For now, you can create them through the user interface.
After you create each record, make note of its internal ID so that you can reference it. You can find the
internal ID of each record by navigating to the record's list page.
The following table lists prerequisite records along with the record type and example internal ID for each:
Note: At present time, there is no way to enforce this behavior through NetSuite, so you can
make the lines optional and let the sales person enforce this rule.
To set the initialTerm to the subscription term that you have created, you need to reference an existing
record. Because you created a custom subscription term, wrap the ID of that term in an object with the ID
property. Wrapping the ID in an object is commonly how records are referenced in REST.
Lines on subscription plans are specified in the member sublist. The member sublist is an object with an
items property. The items property is an array of objects that each represent a line. The lines have their
own fields that must be defined. Although the lineNumber can be inferred in some cases, it is best to
always specify it. Lines are 1-indexed. This is the common structure for sublists in requests.
Some fields on the lines in the member sublist require enumeration values. Usually, the possible values
are clearly defined in the Metadata Catalog. However, sometimes they can be unclear. For example,
subscriptionLineType has an enumeration value of integer strings. Those strings map to subscription line
types:
■ 1 – One-Time
■ 2 – Recurring
■ 3 – Usage
A successful request returns a response with a HTTP status of 204 No Content. In the response headers,
there is a Location key with an associated value representing the endpoint at which you can access your
newly created record. Make note of the ID so that you can reference your subscription plan later. The ID
for your example subscription plan is 1.
{
"itemId": "DEFEND Package",
"initialTerm": { "id": "1" },
"member": {
"items": [
{
"lineNumber": 1,
"item": { "id": "1" },
"isRequired": true,
"subscriptionLineType": "1",
"billingMode": "IN_ADVANCE",
"renewalOption": "DIFFERENT_PLAN"
},
{
"lineNumber": 2,
"item": { "id": "2" },
"isRequired": true,
"subscriptionLineType": "2",
"prorateStartDate": true,
"prorateEndDate": true,
"billingMode": "IN_ADVANCE",
"renewalOption": "ALWAYS"
},
{
"lineNumber": 3,
"item": { "id": "3" },
"isRequired": true,
"subscriptionLineType": "2",
"prorateStartDate": false,
"prorateEndDate": false,
"billingMode": "IN_ADVANCE",
"renewalOption": "ALWAYS"
},
{
"lineNumber": 4,
"item": { "id": "4" },
"isRequired": false,
"subscriptionLineType": "2",
"prorateStartDate": true,
"prorateEndDate": true,
"billingMode": "IN_ADVANCE",
"renewalOption": "ALWAYS"
},
{
"lineNumber": 5,
"item": { "id": "5" },
"isRequired": false,
"subscriptionLineType": "2",
"prorateStartDate": true,
"prorateEndDate": true,
"billingMode": "IN_ADVANCE",
"renewalOption": "ALWAYS"
},
{
"lineNumber": 6,
"item": { "id": "6" },
"isRequired": false,
"subscriptionLineType": "2",
"prorateStartDate": true,
"prorateEndDate": true,
"billingMode": "IN_ADVANCE",
"renewalOption": "ALWAYS"
}
]
}
}
There are six lines on your subscription plan, which means that you need at least six price plans. You need
three more price plans to account for the price drop after the first year on your support lines. To satisfy
these requirements, you need nine price plans.
Price Plan 1
{
"currency": { "id": "1" },
"pricePlanType": "2",
"priceTiers": {
"items": [
{
"fromVal": 0,
"pricingOption": { "id": "-102" },
"value": 100.00
}
]
}
}
Price Plan 2
{
"currency": { "id": "1" },
"pricePlanType": "2",
"priceTiers": {
"items": [
{
"fromVal": 0,
"pricingOption": { "id": "-102" },
"value": 250.00
}
]
}
Price Plan 3
{
"currency": { "id": "1" },
"pricePlanType": "4",
"priceTiers": {
"items": [
{
"fromVal": 0,
"pricingOption": { "id": "-101" },
"value": 7.00
},
{
"fromVal": 20,
"pricingOption": { "id": "-101" },
"value": 6.00
},
{
"fromVal": 50,
"pricingOption": { "id": "-101" },
"value": 5.00
}
]
}
}
Price Plan 4
{
"currency": { "id": "1" },
"pricePlanType": "2",
"priceTiers": {
"items": [
{
"fromVal": 0,
"pricingOption": { "id": "-102" },
"value": 30.00
}
]
}
}
Price Plan 5
{
"currency": { "id": "1" },
"pricePlanType": "2",
"priceTiers": {
"items": [
{
"fromVal": 0,
"pricingOption": { "id": "-102" },
"value": 20.00
}
]
}
}
Price Plan 6
{
"currency": { "id": 1 },
"pricePlanType": "2",
"priceTiers": {
"items": [
{
"fromVal": 0,
"pricingOption": { "id": "-102" },
"value": 60.00
}
]
}
}
Price Plan 7
{
"currency": { "id": "1" },
"pricePlanType": "2",
"priceTiers": {
"items": [
{
"fromVal": 0,
"pricingOption": { "id": "-102" },
"value": 40.00
}
]
}
Price Plan 8
{
"currency": { "id": "1" },
"pricePlanType": "2",
"priceTiers": {
"items": [
{
"fromVal": 0,
"pricingOption": { "id": "-102" },
"value": 90.00
}
]
}
}
Price Plan 9
{
"currency": { "id": "1" },
"pricePlanType": "2",
"priceTiers": {
"items": [
{
"fromVal": 0,
"pricingOption": { "id": "-102" },
"value": 60.00
}
]
}
}
■ Support is billed monthly, prorated by day, and prices decrease after the first year
The subscriptionPlanLineNumber has an integer value and is the number of the line to which the price
interval should apply. The sublist line number cannot be inferred by the system because the relationship
between subscription plan lines and price intervals is one-to-many.
The repeatEvery is connected to the frequency and determines how often the line should be billed. It has
an enum value instead of an integer. The values map directly to their integer values.
For one-time lines, you must specify that repeatEvery is 0 and prorateBy is an empty string.
The startOffsetUnit and startOffsetValue are related to time-based pricing. Combined, the two fields
determine when the pricing of a certain line should follow the tiers in the referenced price plan. For
example, the support lines (4, 5, and 6) have two price intervals each. The first interval defines the pricing
for the first year as startOffsetUnit = YEAR and startOffsetValue = 1. The second interval defines the
pricing for the second year as startOffsetUnit = YEAR and startOffsetValue = 2. This results in a reduced
recurring price for support in every year after the first.
On a successful response, you have completed the process for creating a subscription plan and price
plans linked by a single price book.
Price Book
{
"subscriptionPlan": { "id": "1" },
"currency": { "id": "1" },
"name": "TEST Pricing",
"priceInterval": {
"items": [
{
"subscriptionPlanLineNumber": 1,
"pricePlan": { "id": "10" },
"frequency": "ONETIME",
"repeatEvery": "0",
"startOffsetUnit": "MONTH",
"startOffsetValue": 1,
"prorateBy": ""
},
{
"subscriptionPlanLineNumber": 2,
"pricePlan": { "id": "11" },
"frequency": "ANNUALLY",
"repeatEvery": "1",
"startOffsetUnit": "MONTH",
"startOffsetValue": 1,
"prorateBy": "MONTH"
},
{
"subscriptionPlanLineNumber": 3,
"pricePlan": { "id": "12" },
"frequency": "MONTHLY",
"repeatEvery": "1",
"startOffsetUnit": "MONTH",
"startOffsetValue": 1,
"prorateBy": "DAY"
},
{
"subscriptionPlanLineNumber": 4,
"pricePlan": { "id": "13" },
"frequency": "MONTHLY",
"repeatEvery": "1",
"startOffsetUnit": "YEAR",
"startOffsetValue": 1,
"prorateBy": "DAY"
},
{
"subscriptionPlanLineNumber": 4,
"pricePlan": { "id": "14" },
"frequency": "MONTHLY",
"repeatEvery": "1",
"startOffsetUnit": "YEAR",
"startOffsetValue": 2,
"prorateBy": "DAY"
},
{
"subscriptionPlanLineNumber": 5,
"pricePlan": { "id": "15" },
"frequency": "MONTHLY",
"repeatEvery": "1",
"startOffsetUnit": "YEAR",
"startOffsetValue": 1,
"prorateBy": "DAY"
},
{
"subscriptionPlanLineNumber": 5,
"pricePlan": { "id": "16" },
"frequency": "MONTHLY",
"repeatEvery": "1",
"startOffsetUnit": "YEAR",
"startOffsetValue": 2,
"prorateBy": "DAY"
},
{
"subscriptionPlanLineNumber": 6,
"pricePlan": { "id": "17" },
"frequency": "MONTHLY",
"repeatEvery": "1",
"startOffsetUnit": "YEAR",
"startOffsetValue": 1,
"prorateBy": "DAY"
},
{
"subscriptionPlanLineNumber": 6,
"pricePlan": { "id": "18" },
"frequency": "MONTHLY",
"repeatEvery": "1",
"startOffsetUnit": "YEAR",
"startOffsetValue": 2,
"prorateBy": "DAY"
}
]
}
}
Retrieve Records
You can retrieve records using a GET request. You can also use a GET request for validating records after
creation. The endpoint is similar to the POST requests. The only difference is that the ID of the record is
appended to the end.
Example: In this example, the GET request returns the response body that follows.
Note: The response body is slightly different from the request body because there are other
optional fields. These fields were set to their default values internally. The member sublist has its
own endpoint that you can access to gather field data for each line.
GET http://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/subscriptionplan/1
"links": [
{
"rel": "self",
"href": "http://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/subscriptionplan/1"
}
],
"autoRenewal": false,
"createdDate": "2020-1-1T00:00:00Z",
"customForm": "-950",
"defaultRenewalTerm": {
"links": [],
"id": "1",
"refName": "Three Years"
},
"id": "1",
"includeChildren": false,
"incomeAccount": {
"links": [
{
"rel": "self",
"href": "http://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/account/1"
}
],
"id": "1",
"refName": "Sales"
},
"initialTerm": {
"links": [],
"id": "1",
"refName": "Three Years"
},
"isInactive": false,
"itemId": "DEFEND Package",
"lastModifiedDate": "2020-1-1T00:00:00Z",
"member": {
"links": [
{
"rel": "self",
"href": "http://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/subscriptionplan/1/member"
}
]
},
"subsidiary": {
"links": [
{
"rel": "self",
"href": "http://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/subscriptionplan/1/subsidiary"
}
]
},
"userNotes": {
"links": [
{
"rel": "self",
"href": "http://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/subscriptionplan/1/userNotes"
}
]
}
}
In this use case, you work through the process of using REST to sell a subscription plan for a fictitious
company, CED Cyber Solutions.
■ Subscription Plan – If you have not created a subscription plan (or its associated pricing records) yet
and would like to do so using REST, see Managing Your Catalog.
■ Price Plan – See the help topic Creating Price Plans
■ Price Book - See the help topic Creating Price Books
■ Customer – You need a customer to sell your subscription plan to. In this example, your customer is
called Clean Water Co.
■ Billing Schedule – You need to create a charge-based billing schedule to determine how frequently we
bill the customer. Your billing schedule is monthly, on the first of the month.
After creating these records, make note of their internal IDs. Throughout this example, use the IDs listed
in the following table:
The startDate must always be in the format YYYY-MM-DD. Use this format regardless of the date format
preferences set.
A successful request returns a response with HTTP status 204 No Content. The returned response
headers contain the endpoint for the new record. Make note of the Billing Account ID. The example Billing
Account internal ID is 1.
{
"billingSchedule": { "id": "1" },
"currency": { "id": "1" },
On a successful response, make note of the subscription ID. Use the ID to make changes to your draft
subscription. The ID for your example subscription is 1.
Example Subscription
{
"customer": { "id": "1" },
"billingAccount": { "id": "1" },
"subscriptionPlan": { "id": "1" },
"priceBook": { "id": "1" },
"initialTerm": { "id": "1" }
}
If desired, you can change the defaults. To change the defaults, you send a PATCH request with the ID of
the target record appended to the end of the patch request. The contents of the request body only need
to include your changes. Make sure that all changes to dependent fields are included.
Clean Water Co. wants the silver support tier and has 25 users. Because they are one of your first
customers, they receive a 50% discount on their setup costs.
Note: Leaving a field undefined leaves it unchanged. If you want to set the value of a field to an
empty value, you must explicitly set the field to null in the request body.
A successful request returns a response with HTTP status 204 No Content. The endpoint for the modified
record is returned in the response headers.
{
"subscriptionLine": {
"items": [
{
"lineNumber": 4,
"isIncluded": true
}
]
},
"priceInterval": {
"items": [
{
"subscriptionPlanLineNumber": 1,
"discount": 50.0
},
{
"subscriptionPlanLineNumber": 3,
"quantity": 25
}
]
}
}
Clean Water Co. would like to add Managed Detection and Response to their subscription. The
requirements for the line are as follows:
■ Bill in advance
■ Always add to renewal subscriptions
■ Have a prorated start and end date
■ Charge $50.00 per month, prorated by day
Adding an add-on item to a draft subscription is an edit. You complete this edit by sending a PATCH
request to the subscription endpoint with the ID appended to the end.
Because the add-on item is not tied to any subscription plan or price book, you must supply all of the
subscription line and price book line information.
Because the add-on line requires new pricing information, you must create another price plan. If you are
unfamiliar with this process, see Use Case For Managing Your Subscription Catalog. You assign an ID of
19 to the new price plan.
If the customer decides that they no longer want the add-on item, you can PATCH the subscription to
mark the line as not included.
{
"subscriptionLine": {
"items": [
{
"lineNumber": 7,
"item": { "id": "7" },
"subscriptionLineType": "2",
"billingMode": "IN_ADVANCE",
"renewalOption": "ALWAYS",
"prorateStartDate": true,
"prorateEndDate": true
}
]
},
"priceInterval": {
"items": [
{
"subscriptionPlanLineNumber": 7,
"pricePlan": { "id": "19" },
"frequency": "MONTHLY",
"repeatEvery": "1",
"startOffsetUnit": "MONTH",
"startOffsetValue": 1,
"prorateBy": "DAY"
}
]
}
}