Response Format for Cart-Based APIs

API responses for the Cart-based APIs permit a structured interaction between the requesting entities and back-end operations and are composed of objects wrapped in a result object. The wrapper object used is represented by a JSONResult class while most result records are represented by the JSONRecord base class.

Based on every specific API, the records construct or JSONRecord can represent a different physical database record or a unit of information. The JSONRecord construct supports a hierarchical representation of the data when required, which is accomplished through the use of the nameResult property of the JSONRecord class.

The following table lists the wrapper classes. Note that not all listed properties are used by each vertical.

Apex Class NameParent ClassDescriptionProperties
JSONAttributeJSONRecordRepresents a single product attribute and its properties
    | |JSONCategory|JSONRecord|Represents a single product attribute category and its properties.|
    • id: The ID of the record.
    | |JSONRecord|N/A|A value object that represents a record. A record can be an attribute, product, order, quote, opportunity or line item.|
    • messages: Informational, warning, or error message associated with this result.
    | |JSONAttribute.JSONValue|N/A|Represents a single Product Attribute Value.|
    • name: Unique name of the value.
    | |JSONResult|N/A|The main value object that encapsulates API responses.|
    • totalSize: The size of the records. This is the total number, not necessary the same of records.size(). For example, if there are 200 attributes and the number of records being return is 20. The totalSize will be 200. It serves as an indicator to fetch more records.
    |