Skip to content

Orders and Positions Endpoints out of sync #276

Closed as not planned
Closed as not planned

Description

@AlekseyUrmanov

I have a posted limit order to buy an equity. Polling orders and positions endpoints every second reveals an issue:
Get orders will return data on my order, showing it is still active (not filled), at the same time, get positions will return data showing I have an active position in that equity (1 qty).

Now, it seems that the API is telling me my order is not filled, but the positions endpoint is showing I have inventory, so obviously the order has been filled.

If you try to sell that position, you get an error of insufficient quantity (which is funny because the API also tells me I have inventory).

Sometimes this lag between the orders and positions data continues for 10 seconds.

Activity

  1. hiohiohio commented on Jun 12, 2025

    @hiohiohio

    @AlekseyUrmanov thank you for the report.

    I assume you have some kind of auto-mated order management on your side to call APIs.
    Please make sure there are overlapping orders (i.e. multiple orders for the same symbol) or not.
    Those orders in-flight could consume available qty in the position.
    You could also check qty_available field in the response of Positions API for the actual available position at the time.

    If you are facing similar issue still, please reach our support team with account/order id information so we can look at the order request information https://alpaca.markets/contact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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