Architecture Overview (Pre-Vinson)

To handle data transactions with NetSuite, SuiteCommerce Advanced (SCA) 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. The following sections provide more detail about each component:

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:

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.

Backend Model

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 returned to the frontend framework.

Each feature or module in SCA generally defines the services and backend models needed to access the required data. The Cart module, for example, defines the services and backend models for accessing items currently in the cart. Services and backend models are stored in the JavaScript directory of each module.

When you deploy SCA, 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. For more information, see The ssp_libraries.js File.

Related Topics

SCA Models, Collections, and Services
Services and Backend Models

General Notices