# Issues with alpaca-py instead of alpaca-trading-api for trading in the extended hours

**URL:** <https://forum.alpaca.markets/t/issues-with-alpaca-py-instead-of-alpaca-trading-api-for-trading-in-the-extended-hours/10294>\
**Category:** Alpaca Trading\
**Created:** [August 12, 2022, 10:46am UTC](https://forum.alpaca.markets/t/issues-with-alpaca-py-instead-of-alpaca-trading-api-for-trading-in-the-extended-hours/10294 "2022-08-12T10:46:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumptercha](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/sumptercha/32/3892_2.png) [@sumptercha](https://forum.alpaca.markets/u/sumptercha)\
**Post date:** [August 12, 2022, 10:46am UTC](https://forum.alpaca.markets/t/issues-with-alpaca-py-instead-of-alpaca-trading-api-for-trading-in-the-extended-hours/10294/1 "2022-08-12T10:46:16Z")

</div>

Hi, I decided to change an app that worked very well with alpaca-trading-api for the new sdk, alpaca-py. When I want to place an order during the extended hours with alpaca-py with the following line of code:

```auto
client = TradingClient('APIKEY', 'SECRET_KEY')
req = MarketOrderRequest(symbol='AAPL', limit_price=140, qty=2, type='limit', side=OrderSide.BUY, time_in_force=TimeInForce.DAY, extended_hours=True )
client.submit_order(req)

```

I get this error:

```auto
APIError: {"code":42210000,"message":"extended hours order must be DAY limit orders"}

```

I have chosen the right parameters, my code seems correct, could someone help me, thank you in advance

---

<div class="post-metadata">

**Author:** ![Tim\_Arthur](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/tim_arthur/32/4518_2.png) [@Tim\_Arthur](https://forum.alpaca.markets/u/Tim_Arthur)\
**Post date:** [November 5, 2022, 8:02am UTC](https://forum.alpaca.markets/t/issues-with-alpaca-py-instead-of-alpaca-trading-api-for-trading-in-the-extended-hours/10294/2 "2022-11-05T08:02:37Z")

</div>

@sumptercha I’m getting the same error. Did you find a fix for this?
