snaptrade-typescript-sdk 9.0.38 → 9.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -76
- package/dist/api/account-information-api-generated.d.ts +4 -4
- package/dist/api/account-information-api-generated.js +4 -4
- package/dist/api/authentication-api-generated.d.ts +4 -4
- package/dist/api/authentication-api-generated.js +4 -4
- package/dist/api/connections-api-generated.d.ts +44 -44
- package/dist/api/connections-api-generated.js +40 -40
- package/dist/api/trading-api-generated.d.ts +47 -47
- package/dist/api/trading-api-generated.js +46 -46
- package/dist/browser.js +1 -1
- package/dist/configuration.js +1 -1
- package/dist/models/account.d.ts +2 -2
- package/dist/models/action-strict.d.ts +1 -1
- package/dist/models/brokerage-authorization-disabled-confirmation.d.ts +1 -1
- package/dist/models/brokerage-authorization-refresh-confirmation.d.ts +1 -1
- package/dist/models/brokerage-authorization.d.ts +11 -9
- package/dist/models/brokerage-type.d.ts +1 -1
- package/dist/models/brokerage.d.ts +25 -38
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/manual-trade-and-impact.d.ts +5 -4
- package/dist/models/manual-trade-balance.d.ts +5 -5
- package/dist/models/manual-trade-form.d.ts +21 -21
- package/dist/models/manual-trade-impact.d.ts +38 -0
- package/dist/models/manual-trade-impact.js +2 -0
- package/dist/models/manual-trade-symbol.d.ts +10 -6
- package/dist/models/manual-trade.d.ts +9 -8
- package/dist/models/notional-value.d.ts +1 -1
- package/dist/models/options-place-option-strategy-request.d.ts +2 -2
- package/dist/models/order-type-strict.d.ts +1 -1
- package/dist/models/symbols-quotes-inner.d.ts +8 -8
- package/dist/models/time-in-force-strict.d.ts +1 -1
- package/dist/models/trading-cancel-user-account-order-request.d.ts +1 -1
- package/dist/models/validated-trade-body.d.ts +2 -2
- package/dist/operationParameterMap.js +20 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Connect brokerage accounts to your app for live positions and trading
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/9.0.40)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -427,7 +427,7 @@ const getUserHoldingsResponse =
|
|
|
427
427
|
|
|
428
428
|
### `snaptrade.accountInformation.listUserAccounts`<a id="snaptradeaccountinformationlistuseraccounts"></a>
|
|
429
429
|
|
|
430
|
-
Returns all brokerage accounts known to SnapTrade for the authenticated user.
|
|
430
|
+
Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
|
|
431
431
|
|
|
432
432
|
The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
433
433
|
|
|
@@ -554,7 +554,7 @@ const deleteSnapTradeUserResponse =
|
|
|
554
554
|
|
|
555
555
|
### `snaptrade.authentication.listSnapTradeUsers`<a id="snaptradeauthenticationlistsnaptradeusers"></a>
|
|
556
556
|
|
|
557
|
-
Returns a list of all registered user IDs.
|
|
557
|
+
Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
|
558
558
|
|
|
559
559
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
560
560
|
|
|
@@ -709,14 +709,14 @@ SnapTrade User Secret. This is a randomly generated string and should be stored
|
|
|
709
709
|
|
|
710
710
|
### `snaptrade.connections.detailBrokerageAuthorization`<a id="snaptradeconnectionsdetailbrokerageauthorization"></a>
|
|
711
711
|
|
|
712
|
-
Returns a single
|
|
712
|
+
Returns a single connection for the specified ID.
|
|
713
713
|
|
|
714
714
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
715
715
|
|
|
716
716
|
```typescript
|
|
717
717
|
const detailBrokerageAuthorizationResponse =
|
|
718
718
|
await snaptrade.connections.detailBrokerageAuthorization({
|
|
719
|
-
authorizationId: "
|
|
719
|
+
authorizationId: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
720
720
|
userId: "snaptrade-user-123",
|
|
721
721
|
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
722
722
|
});
|
|
@@ -726,8 +726,6 @@ const detailBrokerageAuthorizationResponse =
|
|
|
726
726
|
|
|
727
727
|
##### authorizationId: `string`<a id="authorizationid-string"></a>
|
|
728
728
|
|
|
729
|
-
The ID of a brokerage authorization object.
|
|
730
|
-
|
|
731
729
|
##### userId: `string`<a id="userid-string"></a>
|
|
732
730
|
|
|
733
731
|
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
@@ -747,14 +745,18 @@ The ID of a brokerage authorization object.
|
|
|
747
745
|
|
|
748
746
|
### `snaptrade.connections.disableBrokerageAuthorization`<a id="snaptradeconnectionsdisablebrokerageauthorization"></a>
|
|
749
747
|
|
|
750
|
-
Manually
|
|
748
|
+
Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections.
|
|
749
|
+
Will trigger a disconnect as if it happened naturally, and send a [`CONNECTION_BROKEN` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_broken) for the connection.
|
|
750
|
+
|
|
751
|
+
*Please contact us in order to use this endpoint as it is disabled by default.*
|
|
752
|
+
|
|
751
753
|
|
|
752
754
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
753
755
|
|
|
754
756
|
```typescript
|
|
755
757
|
const disableBrokerageAuthorizationResponse =
|
|
756
758
|
await snaptrade.connections.disableBrokerageAuthorization({
|
|
757
|
-
authorizationId: "
|
|
759
|
+
authorizationId: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
758
760
|
userId: "snaptrade-user-123",
|
|
759
761
|
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
760
762
|
});
|
|
@@ -764,8 +766,6 @@ const disableBrokerageAuthorizationResponse =
|
|
|
764
766
|
|
|
765
767
|
##### authorizationId: `string`<a id="authorizationid-string"></a>
|
|
766
768
|
|
|
767
|
-
The ID of a brokerage authorization object.
|
|
768
|
-
|
|
769
769
|
##### userId: `string`<a id="userid-string"></a>
|
|
770
770
|
|
|
771
771
|
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
@@ -785,7 +785,12 @@ The ID of a brokerage authorization object.
|
|
|
785
785
|
|
|
786
786
|
### `snaptrade.connections.listBrokerageAuthorizations`<a id="snaptradeconnectionslistbrokerageauthorizations"></a>
|
|
787
787
|
|
|
788
|
-
Returns a list of Brokerage Authorization
|
|
788
|
+
Returns a list of all connections for the specified user. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency.
|
|
789
|
+
|
|
790
|
+
A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts.
|
|
791
|
+
|
|
792
|
+
SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
|
|
793
|
+
|
|
789
794
|
|
|
790
795
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
791
796
|
|
|
@@ -818,14 +823,17 @@ const listBrokerageAuthorizationsResponse =
|
|
|
818
823
|
|
|
819
824
|
### `snaptrade.connections.refreshBrokerageAuthorization`<a id="snaptradeconnectionsrefreshbrokerageauthorization"></a>
|
|
820
825
|
|
|
821
|
-
Trigger a holdings update for all accounts under this
|
|
826
|
+
Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection.
|
|
827
|
+
|
|
828
|
+
*Please contact support for access as this endpoint is not enabled by default.*
|
|
829
|
+
|
|
822
830
|
|
|
823
831
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
824
832
|
|
|
825
833
|
```typescript
|
|
826
834
|
const refreshBrokerageAuthorizationResponse =
|
|
827
835
|
await snaptrade.connections.refreshBrokerageAuthorization({
|
|
828
|
-
authorizationId: "
|
|
836
|
+
authorizationId: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
829
837
|
userId: "snaptrade-user-123",
|
|
830
838
|
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
831
839
|
});
|
|
@@ -835,8 +843,6 @@ const refreshBrokerageAuthorizationResponse =
|
|
|
835
843
|
|
|
836
844
|
##### authorizationId: `string`<a id="authorizationid-string"></a>
|
|
837
845
|
|
|
838
|
-
The ID of a brokerage authorization object.
|
|
839
|
-
|
|
840
846
|
##### userId: `string`<a id="userid-string"></a>
|
|
841
847
|
|
|
842
848
|
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
@@ -856,14 +862,14 @@ The ID of a brokerage authorization object.
|
|
|
856
862
|
|
|
857
863
|
### `snaptrade.connections.removeBrokerageAuthorization`<a id="snaptradeconnectionsremovebrokerageauthorization"></a>
|
|
858
864
|
|
|
859
|
-
Deletes
|
|
865
|
+
Deletes the connection specified by the ID. This will also delete all accounts and holdings associated with the connection. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the connection has been successfully deleted.
|
|
860
866
|
|
|
861
867
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
862
868
|
|
|
863
869
|
```typescript
|
|
864
870
|
const removeBrokerageAuthorizationResponse =
|
|
865
871
|
await snaptrade.connections.removeBrokerageAuthorization({
|
|
866
|
-
authorizationId: "
|
|
872
|
+
authorizationId: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
867
873
|
userId: "snaptrade-user-123",
|
|
868
874
|
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
869
875
|
});
|
|
@@ -873,8 +879,6 @@ const removeBrokerageAuthorizationResponse =
|
|
|
873
879
|
|
|
874
880
|
##### authorizationId: `string`<a id="authorizationid-string"></a>
|
|
875
881
|
|
|
876
|
-
The ID of the Authorization to delete.
|
|
877
|
-
|
|
878
882
|
##### userId: `string`<a id="userid-string"></a>
|
|
879
883
|
|
|
880
884
|
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
@@ -1119,7 +1123,7 @@ const placeOptionStrategyResponse = await snaptrade.options.placeOptionStrategy(
|
|
|
1119
1123
|
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1120
1124
|
accountId: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1121
1125
|
optionStrategyId: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1122
|
-
order_type: "
|
|
1126
|
+
order_type: "Market",
|
|
1123
1127
|
time_in_force: "FOK",
|
|
1124
1128
|
price: 31.33,
|
|
1125
1129
|
}
|
|
@@ -1130,11 +1134,11 @@ const placeOptionStrategyResponse = await snaptrade.options.placeOptionStrategy(
|
|
|
1130
1134
|
|
|
1131
1135
|
##### order_type: [`OrderTypeStrict`](./models/order-type-strict.ts)<a id="order_type-ordertypestrictmodelsorder-type-strictts"></a>
|
|
1132
1136
|
|
|
1133
|
-
|
|
1137
|
+
The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
|
|
1134
1138
|
|
|
1135
1139
|
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
1136
1140
|
|
|
1137
|
-
|
|
1141
|
+
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
|
|
1138
1142
|
|
|
1139
1143
|
##### userId: `string`<a id="userid-string"></a>
|
|
1140
1144
|
|
|
@@ -1482,8 +1486,7 @@ The ID of the account to search for symbols within.
|
|
|
1482
1486
|
|
|
1483
1487
|
### `snaptrade.trading.cancelUserAccountOrder`<a id="snaptradetradingcanceluseraccountorder"></a>
|
|
1484
1488
|
|
|
1485
|
-
|
|
1486
|
-
This will only work if the order has not yet been executed.
|
|
1489
|
+
Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
|
|
1487
1490
|
|
|
1488
1491
|
|
|
1489
1492
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
@@ -1494,7 +1497,7 @@ const cancelUserAccountOrderResponse =
|
|
|
1494
1497
|
userId: "snaptrade-user-123",
|
|
1495
1498
|
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1496
1499
|
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1497
|
-
brokerage_order_id: "
|
|
1500
|
+
brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
1498
1501
|
});
|
|
1499
1502
|
```
|
|
1500
1503
|
|
|
@@ -1506,10 +1509,10 @@ const cancelUserAccountOrderResponse =
|
|
|
1506
1509
|
|
|
1507
1510
|
##### accountId: `string`<a id="accountid-string"></a>
|
|
1508
1511
|
|
|
1509
|
-
The ID of the account to cancel the order in.
|
|
1510
|
-
|
|
1511
1512
|
##### brokerage_order_id: `string`<a id="brokerage_order_id-string"></a>
|
|
1512
1513
|
|
|
1514
|
+
Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
|
1515
|
+
|
|
1513
1516
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
1514
1517
|
|
|
1515
1518
|
[AccountOrderRecord](./models/account-order-record.ts)
|
|
@@ -1525,7 +1528,7 @@ The ID of the account to cancel the order in.
|
|
|
1525
1528
|
|
|
1526
1529
|
### `snaptrade.trading.getOrderImpact`<a id="snaptradetradinggetorderimpact"></a>
|
|
1527
1530
|
|
|
1528
|
-
|
|
1531
|
+
Simulates an order and its impact on the account. This endpoint does not place the order with the brokerage. If successful, it returns a `Trade` object and the ID of the object can be used to place the order with the brokerage using the [place checked order endpoint](/reference/Trading/Trading_placeOrder). Please note that the `Trade` object returned expires after 5 minutes. Any order placed using an expired `Trade` will be rejected.
|
|
1529
1532
|
|
|
1530
1533
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1531
1534
|
|
|
@@ -1533,47 +1536,52 @@ Return the trade object and it's impact on the account for the specified order.
|
|
|
1533
1536
|
const getOrderImpactResponse = await snaptrade.trading.getOrderImpact({
|
|
1534
1537
|
userId: "snaptrade-user-123",
|
|
1535
1538
|
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1536
|
-
account_id: "
|
|
1539
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1537
1540
|
action: "BUY",
|
|
1538
|
-
|
|
1541
|
+
universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1542
|
+
order_type: "Market",
|
|
1543
|
+
time_in_force: "FOK",
|
|
1539
1544
|
price: 31.33,
|
|
1540
1545
|
stop: 31.33,
|
|
1541
|
-
|
|
1542
|
-
universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1546
|
+
units: 10.5,
|
|
1543
1547
|
});
|
|
1544
1548
|
```
|
|
1545
1549
|
|
|
1546
1550
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1547
1551
|
|
|
1548
|
-
##### userId: `string`<a id="userid-string"></a>
|
|
1549
|
-
|
|
1550
|
-
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
1551
|
-
|
|
1552
1552
|
##### account_id: `string`<a id="account_id-string"></a>
|
|
1553
1553
|
|
|
1554
|
+
Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
|
|
1555
|
+
|
|
1554
1556
|
##### action: [`ActionStrict`](./models/action-strict.ts)<a id="action-actionstrictmodelsaction-strictts"></a>
|
|
1555
1557
|
|
|
1556
|
-
|
|
1558
|
+
The action describes the intent or side of a trade. This is either `BUY` or `SELL`
|
|
1559
|
+
|
|
1560
|
+
##### universal_symbol_id: `string`<a id="universal_symbol_id-string"></a>
|
|
1561
|
+
|
|
1562
|
+
Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
|
|
1557
1563
|
|
|
1558
1564
|
##### order_type: [`OrderTypeStrict`](./models/order-type-strict.ts)<a id="order_type-ordertypestrictmodelsorder-type-strictts"></a>
|
|
1559
1565
|
|
|
1560
|
-
|
|
1566
|
+
The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
|
|
1561
1567
|
|
|
1562
|
-
#####
|
|
1568
|
+
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
1563
1569
|
|
|
1564
|
-
|
|
1570
|
+
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
|
|
1565
1571
|
|
|
1566
|
-
#####
|
|
1572
|
+
##### userId: `string`<a id="userid-string"></a>
|
|
1567
1573
|
|
|
1568
|
-
|
|
1574
|
+
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
1569
1575
|
|
|
1570
|
-
#####
|
|
1576
|
+
##### price: `number`<a id="price-number"></a>
|
|
1571
1577
|
|
|
1572
|
-
|
|
1578
|
+
The limit price for `Limit` and `StopLimit` orders.
|
|
1573
1579
|
|
|
1574
|
-
#####
|
|
1580
|
+
##### stop: `number`<a id="stop-number"></a>
|
|
1575
1581
|
|
|
1576
|
-
|
|
1582
|
+
The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
|
|
1583
|
+
|
|
1584
|
+
##### units: [`number`](./models/number.ts)<a id="units-numbermodelsnumberts"></a>
|
|
1577
1585
|
|
|
1578
1586
|
##### notional_value: [`ManualTradeFormNotionalValue`](./models/manual-trade-form-notional-value.ts)<a id="notional_value-manualtradeformnotionalvaluemodelsmanual-trade-form-notional-valuets"></a>
|
|
1579
1587
|
|
|
@@ -1592,7 +1600,7 @@ Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Goo
|
|
|
1592
1600
|
|
|
1593
1601
|
### `snaptrade.trading.getUserAccountQuotes`<a id="snaptradetradinggetuseraccountquotes"></a>
|
|
1594
1602
|
|
|
1595
|
-
Returns
|
|
1603
|
+
Returns quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. This endpoint does not work for options quotes.
|
|
1596
1604
|
|
|
1597
1605
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1598
1606
|
|
|
@@ -1614,15 +1622,13 @@ const getUserAccountQuotesResponse =
|
|
|
1614
1622
|
|
|
1615
1623
|
##### symbols: `string`<a id="symbols-string"></a>
|
|
1616
1624
|
|
|
1617
|
-
List of
|
|
1625
|
+
List of Universal Symbol IDs or tickers to get quotes for.
|
|
1618
1626
|
|
|
1619
1627
|
##### accountId: `string`<a id="accountid-string"></a>
|
|
1620
1628
|
|
|
1621
|
-
The ID of the account to get quotes.
|
|
1622
|
-
|
|
1623
1629
|
##### useTicker: `boolean`<a id="useticker-boolean"></a>
|
|
1624
1630
|
|
|
1625
|
-
Should be set to True if
|
|
1631
|
+
Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
|
|
1626
1632
|
|
|
1627
1633
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
1628
1634
|
|
|
@@ -1639,7 +1645,10 @@ Should be set to True if providing tickers.
|
|
|
1639
1645
|
|
|
1640
1646
|
### `snaptrade.trading.placeForceOrder`<a id="snaptradetradingplaceforceorder"></a>
|
|
1641
1647
|
|
|
1642
|
-
Places a
|
|
1648
|
+
Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
|
|
1649
|
+
|
|
1650
|
+
This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact).
|
|
1651
|
+
|
|
1643
1652
|
|
|
1644
1653
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1645
1654
|
|
|
@@ -1647,47 +1656,52 @@ Places a specified trade in the specified account.
|
|
|
1647
1656
|
const placeForceOrderResponse = await snaptrade.trading.placeForceOrder({
|
|
1648
1657
|
userId: "snaptrade-user-123",
|
|
1649
1658
|
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1650
|
-
account_id: "
|
|
1659
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1651
1660
|
action: "BUY",
|
|
1652
|
-
|
|
1661
|
+
universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1662
|
+
order_type: "Market",
|
|
1663
|
+
time_in_force: "FOK",
|
|
1653
1664
|
price: 31.33,
|
|
1654
1665
|
stop: 31.33,
|
|
1655
|
-
|
|
1656
|
-
universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1666
|
+
units: 10.5,
|
|
1657
1667
|
});
|
|
1658
1668
|
```
|
|
1659
1669
|
|
|
1660
1670
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1661
1671
|
|
|
1662
|
-
##### userId: `string`<a id="userid-string"></a>
|
|
1663
|
-
|
|
1664
|
-
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
1665
|
-
|
|
1666
1672
|
##### account_id: `string`<a id="account_id-string"></a>
|
|
1667
1673
|
|
|
1674
|
+
Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
|
|
1675
|
+
|
|
1668
1676
|
##### action: [`ActionStrict`](./models/action-strict.ts)<a id="action-actionstrictmodelsaction-strictts"></a>
|
|
1669
1677
|
|
|
1670
|
-
|
|
1678
|
+
The action describes the intent or side of a trade. This is either `BUY` or `SELL`
|
|
1679
|
+
|
|
1680
|
+
##### universal_symbol_id: `string`<a id="universal_symbol_id-string"></a>
|
|
1681
|
+
|
|
1682
|
+
Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
|
|
1671
1683
|
|
|
1672
1684
|
##### order_type: [`OrderTypeStrict`](./models/order-type-strict.ts)<a id="order_type-ordertypestrictmodelsorder-type-strictts"></a>
|
|
1673
1685
|
|
|
1674
|
-
|
|
1686
|
+
The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
|
|
1675
1687
|
|
|
1676
|
-
#####
|
|
1688
|
+
##### time_in_force: [`TimeInForceStrict`](./models/time-in-force-strict.ts)<a id="time_in_force-timeinforcestrictmodelstime-in-force-strictts"></a>
|
|
1677
1689
|
|
|
1678
|
-
|
|
1690
|
+
The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely.
|
|
1679
1691
|
|
|
1680
|
-
#####
|
|
1692
|
+
##### userId: `string`<a id="userid-string"></a>
|
|
1681
1693
|
|
|
1682
|
-
|
|
1694
|
+
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
1683
1695
|
|
|
1684
|
-
#####
|
|
1696
|
+
##### price: `number`<a id="price-number"></a>
|
|
1685
1697
|
|
|
1686
|
-
|
|
1698
|
+
The limit price for `Limit` and `StopLimit` orders.
|
|
1687
1699
|
|
|
1688
|
-
#####
|
|
1700
|
+
##### stop: `number`<a id="stop-number"></a>
|
|
1689
1701
|
|
|
1690
|
-
|
|
1702
|
+
The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
|
|
1703
|
+
|
|
1704
|
+
##### units: [`number`](./models/number.ts)<a id="units-numbermodelsnumberts"></a>
|
|
1691
1705
|
|
|
1692
1706
|
##### notional_value: [`ManualTradeFormNotionalValue`](./models/manual-trade-form-notional-value.ts)<a id="notional_value-manualtradeformnotionalvaluemodelsmanual-trade-form-notional-valuets"></a>
|
|
1693
1707
|
|
|
@@ -1706,15 +1720,14 @@ Trade time in force examples: * FOK - Fill Or Kill * Day - Day * GTC - Goo
|
|
|
1706
1720
|
|
|
1707
1721
|
### `snaptrade.trading.placeOrder`<a id="snaptradetradingplaceorder"></a>
|
|
1708
1722
|
|
|
1709
|
-
Places the
|
|
1710
|
-
returns the status of the order from the brokerage.
|
|
1723
|
+
Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder).
|
|
1711
1724
|
|
|
1712
1725
|
|
|
1713
1726
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1714
1727
|
|
|
1715
1728
|
```typescript
|
|
1716
1729
|
const placeOrderResponse = await snaptrade.trading.placeOrder({
|
|
1717
|
-
tradeId: "
|
|
1730
|
+
tradeId: "139e307a-82f7-4402-b39e-4da7baa87758",
|
|
1718
1731
|
userId: "snaptrade-user-123",
|
|
1719
1732
|
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1720
1733
|
wait_to_confirm: true,
|
|
@@ -1725,7 +1738,7 @@ const placeOrderResponse = await snaptrade.trading.placeOrder({
|
|
|
1725
1738
|
|
|
1726
1739
|
##### tradeId: `string`<a id="tradeid-string"></a>
|
|
1727
1740
|
|
|
1728
|
-
|
|
1741
|
+
Obtained from calling the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact)
|
|
1729
1742
|
|
|
1730
1743
|
##### userId: `string`<a id="userid-string"></a>
|
|
1731
1744
|
|
|
@@ -1733,7 +1746,7 @@ The ID of trade object obtained from trade/impact endpoint
|
|
|
1733
1746
|
|
|
1734
1747
|
##### wait_to_confirm: `boolean`<a id="wait_to_confirm-boolean"></a>
|
|
1735
1748
|
|
|
1736
|
-
Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status PENDING as we will not wait to check on the status before responding to the request
|
|
1749
|
+
Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status `PENDING` as we will not wait to check on the status before responding to the request.
|
|
1737
1750
|
|
|
1738
1751
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
1739
1752
|
|
|
@@ -76,7 +76,7 @@ export declare const AccountInformationApiAxiosParamCreator: (configuration?: Co
|
|
|
76
76
|
*/
|
|
77
77
|
getUserHoldings: (accountId: string, userId: string, userSecret: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
78
78
|
/**
|
|
79
|
-
* Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
79
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
80
80
|
* @summary List accounts
|
|
81
81
|
* @param {string} userId
|
|
82
82
|
* @param {string} userSecret
|
|
@@ -150,7 +150,7 @@ export declare const AccountInformationApiFp: (configuration?: Configuration) =>
|
|
|
150
150
|
*/
|
|
151
151
|
getUserHoldings(requestParameters: AccountInformationApiGetUserHoldingsRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AccountHoldingsAccount>>;
|
|
152
152
|
/**
|
|
153
|
-
* Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
153
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
154
154
|
* @summary List accounts
|
|
155
155
|
* @param {AccountInformationApiListUserAccountsRequest} requestParameters Request parameters.
|
|
156
156
|
* @param {*} [options] Override http request option.
|
|
@@ -221,7 +221,7 @@ export declare const AccountInformationApiFactory: (configuration?: Configuratio
|
|
|
221
221
|
*/
|
|
222
222
|
getUserHoldings(requestParameters: AccountInformationApiGetUserHoldingsRequest, options?: AxiosRequestConfig): AxiosPromise<AccountHoldingsAccount>;
|
|
223
223
|
/**
|
|
224
|
-
* Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
224
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
225
225
|
* @summary List accounts
|
|
226
226
|
* @param {AccountInformationApiListUserAccountsRequest} requestParameters Request parameters.
|
|
227
227
|
* @param {*} [options] Override http request option.
|
|
@@ -506,7 +506,7 @@ export declare class AccountInformationApiGenerated extends BaseAPI {
|
|
|
506
506
|
*/
|
|
507
507
|
getUserHoldings(requestParameters: AccountInformationApiGetUserHoldingsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<AccountHoldingsAccount, any>>;
|
|
508
508
|
/**
|
|
509
|
-
* Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
509
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
510
510
|
* @summary List accounts
|
|
511
511
|
* @param {AccountInformationApiListUserAccountsRequest} requestParameters Request parameters.
|
|
512
512
|
* @param {*} [options] Override http request option.
|
|
@@ -375,7 +375,7 @@ const AccountInformationApiAxiosParamCreator = function (configuration) {
|
|
|
375
375
|
};
|
|
376
376
|
}),
|
|
377
377
|
/**
|
|
378
|
-
* Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
378
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
379
379
|
* @summary List accounts
|
|
380
380
|
* @param {string} userId
|
|
381
381
|
* @param {string} userSecret
|
|
@@ -570,7 +570,7 @@ const AccountInformationApiFp = function (configuration) {
|
|
|
570
570
|
});
|
|
571
571
|
},
|
|
572
572
|
/**
|
|
573
|
-
* Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
573
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
574
574
|
* @summary List accounts
|
|
575
575
|
* @param {AccountInformationApiListUserAccountsRequest} requestParameters Request parameters.
|
|
576
576
|
* @param {*} [options] Override http request option.
|
|
@@ -667,7 +667,7 @@ const AccountInformationApiFactory = function (configuration, basePath, axios) {
|
|
|
667
667
|
return localVarFp.getUserHoldings(requestParameters, options).then((request) => request(axios, basePath));
|
|
668
668
|
},
|
|
669
669
|
/**
|
|
670
|
-
* Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
670
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
671
671
|
* @summary List accounts
|
|
672
672
|
* @param {AccountInformationApiListUserAccountsRequest} requestParameters Request parameters.
|
|
673
673
|
* @param {*} [options] Override http request option.
|
|
@@ -764,7 +764,7 @@ class AccountInformationApiGenerated extends base_1.BaseAPI {
|
|
|
764
764
|
return (0, exports.AccountInformationApiFp)(this.configuration).getUserHoldings(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
765
765
|
}
|
|
766
766
|
/**
|
|
767
|
-
* Returns all brokerage accounts known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
767
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
|
768
768
|
* @summary List accounts
|
|
769
769
|
* @param {AccountInformationApiListUserAccountsRequest} requestParameters Request parameters.
|
|
770
770
|
* @param {*} [options] Override http request option.
|
|
@@ -20,7 +20,7 @@ export declare const AuthenticationApiAxiosParamCreator: (configuration?: Config
|
|
|
20
20
|
*/
|
|
21
21
|
deleteSnapTradeUser: (userId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
22
22
|
/**
|
|
23
|
-
* Returns a list of all registered user IDs.
|
|
23
|
+
* Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
|
24
24
|
* @summary List all users
|
|
25
25
|
* @param {*} [options] Override http request option.
|
|
26
26
|
* @throws {RequiredError}
|
|
@@ -67,7 +67,7 @@ export declare const AuthenticationApiFp: (configuration?: Configuration) => {
|
|
|
67
67
|
*/
|
|
68
68
|
deleteSnapTradeUser(requestParameters: AuthenticationApiDeleteSnapTradeUserRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteUserResponse>>;
|
|
69
69
|
/**
|
|
70
|
-
* Returns a list of all registered user IDs.
|
|
70
|
+
* Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
|
71
71
|
* @summary List all users
|
|
72
72
|
* @param {*} [options] Override http request option.
|
|
73
73
|
* @throws {RequiredError}
|
|
@@ -112,7 +112,7 @@ export declare const AuthenticationApiFactory: (configuration?: Configuration, b
|
|
|
112
112
|
*/
|
|
113
113
|
deleteSnapTradeUser(requestParameters: AuthenticationApiDeleteSnapTradeUserRequest, options?: AxiosRequestConfig): AxiosPromise<DeleteUserResponse>;
|
|
114
114
|
/**
|
|
115
|
-
* Returns a list of all registered user IDs.
|
|
115
|
+
* Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
|
116
116
|
* @summary List all users
|
|
117
117
|
* @param {*} [options] Override http request option.
|
|
118
118
|
* @throws {RequiredError}
|
|
@@ -204,7 +204,7 @@ export declare class AuthenticationApiGenerated extends BaseAPI {
|
|
|
204
204
|
*/
|
|
205
205
|
deleteSnapTradeUser(requestParameters: AuthenticationApiDeleteSnapTradeUserRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<DeleteUserResponse, any>>;
|
|
206
206
|
/**
|
|
207
|
-
* Returns a list of all registered user IDs.
|
|
207
|
+
* Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
|
208
208
|
* @summary List all users
|
|
209
209
|
* @param {*} [options] Override http request option.
|
|
210
210
|
* @throws {RequiredError}
|
|
@@ -81,7 +81,7 @@ const AuthenticationApiAxiosParamCreator = function (configuration) {
|
|
|
81
81
|
};
|
|
82
82
|
}),
|
|
83
83
|
/**
|
|
84
|
-
* Returns a list of all registered user IDs.
|
|
84
|
+
* Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
|
85
85
|
* @summary List all users
|
|
86
86
|
* @param {*} [options] Override http request option.
|
|
87
87
|
* @throws {RequiredError}
|
|
@@ -288,7 +288,7 @@ const AuthenticationApiFp = function (configuration) {
|
|
|
288
288
|
});
|
|
289
289
|
},
|
|
290
290
|
/**
|
|
291
|
-
* Returns a list of all registered user IDs.
|
|
291
|
+
* Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
|
292
292
|
* @summary List all users
|
|
293
293
|
* @param {*} [options] Override http request option.
|
|
294
294
|
* @throws {RequiredError}
|
|
@@ -374,7 +374,7 @@ const AuthenticationApiFactory = function (configuration, basePath, axios) {
|
|
|
374
374
|
return localVarFp.deleteSnapTradeUser(requestParameters, options).then((request) => request(axios, basePath));
|
|
375
375
|
},
|
|
376
376
|
/**
|
|
377
|
-
* Returns a list of all registered user IDs.
|
|
377
|
+
* Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
|
378
378
|
* @summary List all users
|
|
379
379
|
* @param {*} [options] Override http request option.
|
|
380
380
|
* @throws {RequiredError}
|
|
@@ -434,7 +434,7 @@ class AuthenticationApiGenerated extends base_1.BaseAPI {
|
|
|
434
434
|
return (0, exports.AuthenticationApiFp)(this.configuration).deleteSnapTradeUser(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
435
435
|
}
|
|
436
436
|
/**
|
|
437
|
-
* Returns a list of all registered user IDs.
|
|
437
|
+
* Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
|
438
438
|
* @summary List all users
|
|
439
439
|
* @param {*} [options] Override http request option.
|
|
440
440
|
* @throws {RequiredError}
|