API explorer code generation

I have been using the CatalogApi SearchCatalogObjectsAsync in the API explorer and it returns my product as expected.

If I add the generate code in my project it does return the products but not the same way as the API.

var objectTypes = new List<string>();
objectTypes.Add("ITEM");

var body = new SearchCatalogObjectsRequest.Builder()
  .ObjectTypes(objectTypes)
  .IncludeRelatedObjects(true)
  .Limit(10)
  .IncludeCategoryPathToRoot(false)
  .Build();
var catalogResponse = await _squareClient.CatalogApi.SearchCatalogObjectsAsync(body: body);

While I can see things like “ecom_image_uris” and image data information in the API explorer in my code they all come back null. Things like “ImageData” is always null.

I am trying to load 20 products per page and display the product name, image and price.
Using .NET core with the official nugget package.

What am I missing?

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Build a Simple Catalog
Call the SearchCatalogObjects Endpoint
Work with Images

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.