snaptrade-typescript-sdk 12.2.17 → 12.2.19

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 CHANGED
@@ -63,7 +63,7 @@ backoff with jitter rather than from the headers.
63
63
  See https://docs.snaptrade.com/docs/ratelimiting.
64
64
 
65
65
 
66
- [![npm](https://img.shields.io/badge/npm-v12.2.17-blue)](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/12.2.17)
66
+ [![npm](https://img.shields.io/badge/npm-v12.2.19-blue)](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/12.2.19)
67
67
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
68
68
 
69
69
  </div>
@@ -113,6 +113,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
113
113
  * [`snaptrade.experimentalEndpoints.getUserAccountRecentOrdersV2`](#snaptradeexperimentalendpointsgetuseraccountrecentordersv2)
114
114
  * [`snaptrade.experimentalEndpoints.listAllUserAccounts`](#snaptradeexperimentalendpointslistalluseraccounts)
115
115
  * [`snaptrade.experimentalEndpoints.listSubscriptions`](#snaptradeexperimentalendpointslistsubscriptions)
116
+ * [`snaptrade.experimentalEndpoints.placeSimpleOrder`](#snaptradeexperimentalendpointsplacesimpleorder)
116
117
  * [`snaptrade.referenceData.getPartnerInfo`](#snaptradereferencedatagetpartnerinfo)
117
118
  * [`snaptrade.referenceData.getStockExchanges`](#snaptradereferencedatagetstockexchanges)
118
119
  * [`snaptrade.referenceData.getSymbols`](#snaptradereferencedatagetsymbols)
@@ -395,6 +396,8 @@ Optional comma separated list of transaction types to filter by. SnapTrade does
395
396
 
396
397
  An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
397
398
 
399
+ The data may contain gaps and is best used for charting account value trends. It should not be relied on as a complete or exact record of historical account values.
400
+
398
401
 
399
402
  #### 🛠️ Usage<a id="🛠️-usage"></a>
400
403
 
@@ -895,6 +898,8 @@ Check your API key on the [Customer Dashboard billing page](https://dashboard.sn
895
898
 
896
899
  If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
897
900
 
901
+ Concurrent live holdings requests for the same account fail immediately with HTTP 409 and error code `1166`. Wait for the in-flight request to complete before retrying.
902
+
898
903
 
899
904
  #### 🛠️ Usage<a id="🛠️-usage"></a>
900
905
 
@@ -2273,6 +2278,145 @@ const listSubscriptionsResponse =
2273
2278
  ---
2274
2279
 
2275
2280
 
2281
+ ### `snaptrade.experimentalEndpoints.placeSimpleOrder`<a id="snaptradeexperimentalendpointsplacesimpleorder"></a>
2282
+
2283
+ **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase.
2284
+
2285
+ Equity and equity-option orders use the existing brokerage trading capabilities. Futures and future options are currently supported only on tastytrade. Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages).
2286
+
2287
+ An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders.
2288
+
2289
+ All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or the exact tastytrade BrokerageInstrument ticker for futures and future options, including any spaces.
2290
+
2291
+ A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
2292
+
2293
+
2294
+ #### 🛠️ Usage<a id="🛠️-usage"></a>
2295
+
2296
+ ##### Commercial API Key Auth<a id="commercial-api-key-auth"></a>
2297
+
2298
+ ```typescript
2299
+ const placeSimpleOrderResponse =
2300
+ await commercialApiKeyClient.experimentalEndpoints.placeSimpleOrder({
2301
+ order_type: "stop_limit",
2302
+ time_in_force: "day",
2303
+ legs: [
2304
+ {
2305
+ instrument: {
2306
+ kind: "future",
2307
+ symbol: "/ESZ6",
2308
+ },
2309
+ action: "buy",
2310
+ units: "1.25",
2311
+ },
2312
+ ],
2313
+ accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
2314
+ limit_price: "1.25",
2315
+ stop_price: "1.25",
2316
+ price_effect: "debit",
2317
+ client_order_id: "550e8400-e29b-41d4-a716-446655440000",
2318
+ expiry_date: "2026-12-18T20:00:00.000Z",
2319
+ notional_value: "1.25",
2320
+ trading_session: "regular",
2321
+ userId: "snaptrade-user-123",
2322
+ userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
2323
+ });
2324
+ ```
2325
+
2326
+ Required credentials for this mode:
2327
+
2328
+ - `userId` (string, required): SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
2329
+
2330
+ - `userSecret` (string, required): SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
2331
+
2332
+ ##### Personal API Key Auth<a id="personal-api-key-auth"></a>
2333
+
2334
+ ```typescript
2335
+ const placeSimpleOrderResponse =
2336
+ await personalApiKeyClient.experimentalEndpoints.placeSimpleOrder({
2337
+ order_type: "stop_limit",
2338
+ time_in_force: "day",
2339
+ legs: [
2340
+ {
2341
+ instrument: {
2342
+ kind: "future",
2343
+ symbol: "/ESZ6",
2344
+ },
2345
+ action: "buy",
2346
+ units: "1.25",
2347
+ },
2348
+ ],
2349
+ accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
2350
+ limit_price: "1.25",
2351
+ stop_price: "1.25",
2352
+ price_effect: "debit",
2353
+ client_order_id: "550e8400-e29b-41d4-a716-446655440000",
2354
+ expiry_date: "2026-12-18T20:00:00.000Z",
2355
+ notional_value: "1.25",
2356
+ trading_session: "regular",
2357
+ });
2358
+ ```
2359
+
2360
+ The client identifies the user in this mode. Do not pass `userId` `userSecret` to this method.
2361
+
2362
+
2363
+ #### ⚙️ Parameters<a id="⚙️-parameters"></a>
2364
+
2365
+ ##### order_type: `string`<a id="order_type-string"></a>
2366
+
2367
+ ##### time_in_force: `string`<a id="time_in_force-string"></a>
2368
+
2369
+ Order duration, subject to brokerage and execution-path support. gtd requires expiry_date and a non-market single-leg equity/option order. Existing single-leg option routing does not support ioc. Futures and multi-leg orders do not support gtd through this endpoint.
2370
+
2371
+ ##### legs: [`SimpleTradeLeg`](./models/simple-trade-leg.ts)[]<a id="legs-simpletradelegmodelssimple-trade-legts"></a>
2372
+
2373
+ Legs of one brokerage order. Use equity/option legs or future/future_option legs, without mixing the two families. Brokerage strategy and leg-count limits apply.
2374
+
2375
+ ##### accountId: `string`<a id="accountid-string"></a>
2376
+
2377
+ The ID of the account to execute the trade on.
2378
+
2379
+ ##### limit_price: [`string`](./models/model-string.ts)<a id="limit_price-stringmodelsmodel-stringts"></a>
2380
+
2381
+ Required for limit and stop_limit orders, except that multi-leg price_effect even implies zero. Must be omitted or null for market and stop orders. For multi-leg orders this is the net strategy price. Negative prices are accepted only for futures-family orders, subject to brokerage support.
2382
+
2383
+ ##### stop_price: [`string`](./models/model-string.ts)<a id="stop_price-stringmodelsmodel-stringts"></a>
2384
+
2385
+ Required for stop and stop_limit orders. Must be omitted or null for market and limit orders. Must be positive for equity/option orders; futures-family trigger prices are subject to brokerage support.
2386
+
2387
+ ##### price_effect: `string`<a id="price_effect-string"></a>
2388
+
2389
+ Only applicable to multi-leg limit and stop_limit orders. Requirements and supported values depend on the brokerage; tastytrade requires credit or debit. even implies a zero limit_price, which may be omitted and must be zero if supplied. Single-leg price effects are derived from the action.
2390
+
2391
+ ##### client_order_id: [`string`](./models/model-string.ts)<a id="client_order_id-stringmodelsmodel-stringts"></a>
2392
+
2393
+ Optional canonical UUID, forwarded where the existing execution path supports it and for tastytrade futures orders. Requires the existing client-order-ID enablement; when disabled the value is ignored. Brokerage behavior on duplicates varies; SnapTrade does not enforce uniqueness. Tastytrade uses this as external-identifier for correlation and does not deduplicate submissions.
2394
+
2395
+ ##### expiry_date: `string`<a id="expiry_date-string"></a>
2396
+
2397
+ ISO 8601 expiry timestamp, required for gtd and invalid with other durations. A missing timezone is treated as UTC. Supported only through existing single-leg Public and Sandbox execution paths.
2398
+
2399
+ ##### notional_value: [`string`](./models/model-string.ts)<a id="notional_value-stringmodelsmodel-stringts"></a>
2400
+
2401
+ Positive order value, supported only for a single-equity market order on eligible brokerages and partners. Mutually exclusive with leg units. Omit or set units to null when supplied.
2402
+
2403
+ ##### trading_session: `string`<a id="trading_session-string"></a>
2404
+
2405
+ extended uses existing single-leg equity/option brokerage support and requires extended-hours enablement. Futures and multi-leg orders only accept regular.
2406
+
2407
+ #### 🔄 Return<a id="🔄-return"></a>
2408
+
2409
+ [SimpleTradeResponse](./models/simple-trade-response.ts)
2410
+
2411
+ #### 🌐 Endpoint<a id="🌐-endpoint"></a>
2412
+
2413
+ `/accounts/{accountId}/trading/simple` `POST`
2414
+
2415
+ [🔙 **Back to Table of Contents**](#table-of-contents)
2416
+
2417
+ ---
2418
+
2419
+
2276
2420
  ### `snaptrade.referenceData.getPartnerInfo`<a id="snaptradereferencedatagetpartnerinfo"></a>
2277
2421
 
2278
2422
  Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.