Order was Rejected

Environment

Language
Python

Problem

Summary
I attempted to make a simple market ‘buy’ order at 3:50 EST. I saw that the order was ‘Accepted’ for awhile, then moved to the ‘Rejected’ state. Does anyone know what might cause that to happen? The total price of the order was estimated to be roughly $5 less than the Equity that would be left in my account after order completion, so maybe that would cause it (since possibly the market price for all the shares I was attempting to buy was higher than my account equity)? I’m pretty new to using alpaca, so i’m not sure what would cause this state to occur.

Paper or Live Tradng?
Live trading

Example Code

If it’s any help, here’s an approximation of what the order looks like (with a fake quantity).

api.submit_order (
symbol = ‘FTI’,
qty = 200,
side =‘buy’,
type =‘market’,
time_in_force =‘day’
)

I just switched the market order over to a limit order, and regenerated my api key. Seems to work fine now. Not really a solution, but eh as long as the buy works one way or another idc.