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 Name||Parent Class||Description||Properties|
|JSONAttribute||JSONRecord||Represents a single product attribute and its properties|
- id: The ID of the record.
- messages: Informational, warning, or error message associated with this result.
- name: Unique name of the value.
- 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.