Sparse fieldsets
How to request the API to return only specific fields
Last updated
How to request the API to return only specific fields
Last updated
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 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.
The following request fetches an SKU code and name:
The following request fetches an SKU code, name, and related prices plus the formatted amount and the related price lists of each price: