Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Status Code 422 for createOrder #255

Open
1 task done
mckuok opened this issue Mar 27, 2024 · 0 comments
Open
1 task done

[Bug]: Status Code 422 for createOrder #255

mckuok opened this issue Mar 27, 2024 · 0 comments

Comments

@mckuok
Copy link

mckuok commented Mar 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When I do

alpaca.createOrder({
                symbol: "AAPL",
                notional: 1000,
                side: "buy",
                type: "market",
                time_in_force: "day",
            })

I received an exception stating that the status code returned is 422. However, when I navigate to the alpaca app dashboard, I do see the order got executed.

Expected Behavior

If the order is placed, return a 2xx status code instead of a 422.

SDK Version I encountered this issue in

node_modules/@alpacahq/alpaca-trade-api: 3.0.1

Steps To Reproduce

  1. Initiate the alpaca client with paper trading option
  2. call
alpaca.createOrder({
                symbol: "AAPL",
                notional: 1000,
                side: "buy",
                type: "market",
                time_in_force: "day",
            })
  1. Exception thrown for 422 status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant