I am currently using the .NET SDK. I am trying to get all of the discounts for a portal, but I am seeing there are discounts embedded in the “order” object that are not a “discount”. Is this by design or am I missing something?
var objectTypes = new List<string>();
objectTypes.Add("discount");
var body = new SearchCatalogObjectsRequest.Builder()
.ObjectTypes(objectTypes)
.IncludeDeletedObjects(true)
//.Limit(100)
.Cursor(cursor)
.Build();
var result = await client.CatalogApi.SearchCatalogObjectsAsync(body: body);
They are not ad-hoc discounts. The names of the discounts match but the discount id in the order does not match a catalog id or a discount id from the catalog objects.
Looking at the API Logs there is one GET request to RetrieveCatalogObject for that ID. That endpoint doesn’t include_deleted_objects which is why you got the error. I verified with the POST request of BatchRetrieveCatalogObjects and include_deleted_objects that the discount is returned.
The API Logs that I checked show that it was a RetrieveCatalogObject API call. Are you sure it was a call to SearchCatalogObjects that didn’t return the results? Can you confirm in our Logs?
I think I am calling the right one. Here is the code
var body = new SearchCatalogObjectsRequest.Builder()
.ObjectTypes(objectTypes)
.IncludeDeletedObjects(includeDeleted)
//.Limit(100)
.Cursor(cursor)
.Build();
var result = await client.CatalogApi.SearchCatalogObjectsAsync(body: body);
That is the right call except I don’t see any API call in the logs from that function. Whats your application ID so I can make sure I’m checking the right account. Also when did you last run that function?