# Can’t trade using the API

**URL:** <https://forum.alpaca.markets/t/can-t-trade-using-the-api/14319>\
**Category:** Alpaca Trading\
**Created:** [May 30, 2024, 9:55pm UTC](https://forum.alpaca.markets/t/can-t-trade-using-the-api/14319 "2024-05-30T21:55:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Gu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/jason_gu/32/6212_2.png) [@Jason\_Gu](https://forum.alpaca.markets/u/Jason_Gu)\
**Post date:** [May 30, 2024, 9:55pm UTC](https://forum.alpaca.markets/t/can-t-trade-using-the-api/14319/1 "2024-05-30T21:55:21Z")

</div>

The Create Order API doesn’t work for me-it would generate an error message more than a thousand lines long:

 ![Screenshot 2024-05-30 at 2.42.10 PM](https://us1.discourse-cdn.com/flex020/uploads/alp/original/2X/5/561dcc1d570e13fdf3de3d5243feaee3724ee8bb.png)

My language is JS. What is going wrong here??

---

<div class="post-metadata">

**Author:** ![kris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/kris/32/163_2.png) [@kris](https://forum.alpaca.markets/u/kris)\
**Post date:** [May 30, 2024, 10:03pm UTC](https://forum.alpaca.markets/t/can-t-trade-using-the-api/14319/2 "2024-05-30T22:03:16Z")

</div>

whats the error that you get

---

<div class="post-metadata">

**Author:** ![Dan\_Whitnable\_Alpaca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dan_whitnable_alpaca/32/1658_2.png) [@Dan\_Whitnable\_Alpaca](https://forum.alpaca.markets/u/Dan_Whitnable_Alpaca)\
**Post date:** [May 30, 2024, 10:20pm UTC](https://forum.alpaca.markets/t/can-t-trade-using-the-api/14319/3 "2024-05-30T22:20:03Z")

</div>

@Jason_Gu There may be other issues, but the first one I see is your URL is incorrect. You are using

```
 https://paper-api.alpaca.markets/v2/v2/orders

```

Notice there are two `v2` . It should be

```
 https://paper-api.alpaca.markets/v2/orders

```

Try that.

---

<div class="post-metadata">

**Author:** ![Jason\_Gu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/jason_gu/32/6212_2.png) [@Jason\_Gu](https://forum.alpaca.markets/u/Jason_Gu)\
**Post date:** [May 30, 2024, 10:36pm UTC](https://forum.alpaca.markets/t/can-t-trade-using-the-api/14319/4 "2024-05-30T22:36:03Z")

</div>

@Dan_Whitnable_Alpaca I don’t see a place where you edit the URL. Is there a “node\_modules” thing? Is it in there?

---

<div class="post-metadata">

**Author:** ![Jason\_Gu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/jason_gu/32/6212_2.png) [@Jason\_Gu](https://forum.alpaca.markets/u/Jason_Gu)\
**Post date:** [May 31, 2024, 12:04am UTC](https://forum.alpaca.markets/t/can-t-trade-using-the-api/14319/5 "2024-05-31T00:04:47Z")

</div>

![Screenshot 2024-05-30 at 5.53.10 PM](https://us1.discourse-cdn.com/flex020/uploads/alp/original/2X/b/b408279ba7b3b495088efe66c442e180dac4fd96.png)

@Dan_Whitnable_Alpaca

I don’t know what’s the issue here.
