• Pages
  • /
  • Dealers
  • /
  • Data Depot
  • /
  • Version 4
  • /
  • API
  • /
  • Helpers
  • /
  • Fields

Fields

Transform the API response by specifying exactly which fields to return in the response.

The fields helper parameter allows you to indicate the properties you would like to be returned in the API response. Doing this not only reduces the overall size of the data transmitted, but it also makes responses more human-readable to omit fields that you don't need or intend on using.

Example requests

Single field

Get all the Items for a specific Product, but only return the sku property in the response.

https://api.wps-inc.com/products/65184/items?fields[items]=sku

Multiple fields (separated by a comma)

Get all the Images for a specific Item, but only return the filename and mime properties in the response.

https://api.wps-inc.com/items/crutch/73-8603L/images?fields[images]=filename,mime

Example using the includes helper

Get a collection of Products, with their Items included, but only return the name property of the Product and only the sku and list_price properties of the Items.

https://api.wps-inc.com/products?include=items&fields[products]=name&fields[items]=sku,list_price