Sparse fieldsets
How to request the API to return only specific fields
When you fetch a resource or collection, you can request the API to return only specific fields, using the fields
query parameter. This reduces the response payload, optimizing the performances. If you want the API to return also specific related resources data, they must be included and added to the fields
list as well.
The value of the fields
parameter must be a comma-separated list that refers to the name(s) of the fields to be returned. Pay attention to avoid whitespaces before or after each comma.
Examples
Requesting specific attributes only
The following request fetches an SKU code and name:
Requesting specific related resources
The following request fetches an SKU code, name, and related prices plus the formatted amount and the related price lists of each price:
Last updated