Skip to content

[Bug]: Status Code 422 for createOrder #255

Open
@mckuok

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions