To handle data transactions with NetSuite, SuiteCommerce Advanced provides multiple endpoints that enable access to data stored in NetSuite records. These endpoints run on NetSuite and are implemented as RESTful APIs.
Each endpoint has the following components:
Service (request handler)
The service (.ss file) handles communication between the frontend SCA application and the backend models that connect to NetSuite. The service receives an HTTP request initiated by the frontend framework, usually a model or collection. Services handle standard HTTP request methods (GET, POST, PUT, DELETE). Based on the HTTP action specified in the request, the service calls methods on the backend model.
For example, the ProductLists.Service.ss service returns information about product lists. Since this is a RESTful service, you can access product list information using HTTP methods as follows:
HTTP POST — create a new product list.
HTTP PUT — update a product list.
HTTP DELETE — delete a product list.
HTTP GET — perform a search on a product list. This is accomplished by passing search filters as parameters to the service.
Services are also responsible for passing data from the backend model to the frontend model or collection that initiated the HTTP request. This data is passed as a JSON object.
The backend model contains methods that access NetSuite records by calling the SuiteScript API. See SuiteScript API for more information.
Each model defines methods that correspond to the HTTP actions handled by the service. For example, if a model is handling a GET action to retrieve data from NetSuite, it must also format the corresponding JSON object that is return to the frontend framework.
When you deploy SuiteCommerce Advanced, the gulp tasks deploy all of the services to the SSP application. The gulp tasks also add backend models to the ssp_libraries.js file. See The ssp_libraries.js File for more information.