Shopping Objects
The Commerce API includes only one object that is globally accessible in the SuiteScript context, the webContainer object.
The following table lists the objects that are accessible after you have gotten a webContainer. The table also lists the calls you can use to get a reference to each object. You need a reference to a shopping object to call its methods.
Object |
Description |
Call to get Object |
For available methods, see: |
---|---|---|---|
shoppingSession |
Tracks session context. |
nlapiGetWebContainer |
|
customer |
Holds data for the logged in customer. |
nlapiGetWebContainer |
|
order |
Holds shopping cart data and methods for placing the order. |
nlapiGetWebContainer |
|
pageGenerator |
Used to generate web pages. |
nlapiGetWebContainer |
|
standardTagLibrary |
Implements web site tags. |
nlapiGetWebContainer |
Note the following:
-
These customer and order objects are different from NetSuite customer and order records, because they hold information within the given shopping session only.
-
To access a customer or an order, in addition to getting a webContainer, you also need to get a shoppingSession.
-
You can only use Commerce API shopping methods against Commerce API objects. You cannot use shopping methods against NetSuite records.
-
Shopping object methods support passing of primitive strings and JSON objects. See Input Parameters/Return Values for Shopping Object Methods.
-
The Commerce API includes JSON objects to support shopping object methods. For details about supported fields for JSON objects, see JSON Object Fields.
-
For information about governance for shopping object methods, see SSP Application Governance.