C# Paper SDK PostOrder results in HTTP 422 error

Hello!

I am using the Paper API and the C# .Net SDK provided from the documentations. When I’m trying to post an order, I receive HTTP 422 error. I’m doing exactly as specified in the examples, and here is an example:

quantity = 1
_stock = “fb”
side = OrderSide.Buy
Price = 159.75

var order = await _alpacaTradingClient.PostOrderAsync(
            new NewOrderRequest(
                _stock, quantity, side, OrderType.Limit, TimeInForce.Day)
            {
                LimitPrice = price
            });

Why do I receive 422? Thanks!

So apparently the stock symbol should be upper case (“FB” instead of “fb”). Now it’s fine.

2 Likes

Haha yeah that’s one of the common gotcha :slight_smile: