C# API broken because invalid data returned in response

(I’ve posted this in Slack and sent an email to support but got no response, so trying here.)

I’m using the API with C#/Nuget package 5.2.2 and when trying to pull positions (or filled orders) I get the error “Error converting value “” to type ‘Alpaca.Markets.AssetClass’. Path ‘[94].asset_class’, line 1, position 73276.”

I dove into the response and I think it’s because the symbol KIND is returning an empty JSON value: asset_class:"", so it can’t cast to the enum.

I tried exiting my KIND position through the website but it says “One or more positions could not be liquidated.” So essentially the API is useless to me now and I can’t pull my 300+ positions because of one misconfigured stock.

I trade for a living and need this fixed.

First, the fastest way to get help specific to C# SDK is reporting bugs directly into the SDK GitHub repo (you can easily figure out it in the NuGet package browser).

Second, I’m not sure that useful we can do on the client-side with the bad data received from the server. How should SDK handle this empty string in the asset_class JSON property? Only throw an exception. If you have a better idea - tell me or implement it as a pull request and send it on GitHub for discussion/merge.

I understand that this issue is critical for you but this problem is not about C# SDK - the root cause is on the server-side. Most probably metadata for the KIND ticker configured incorrectly.