snaptrade-typescript-sdk 13.2.5 → 13.2.6
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 +225 -225
- package/dist/browser.umd.js +6 -6
- package/dist/index.cjs +384 -384
- package/dist/index.d.cts +215 -215
- package/dist/index.d.mts +215 -215
- package/dist/index.d.ts +215 -215
- package/dist/index.mjs +384 -384
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -635,6 +635,158 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
635
635
|
};
|
|
636
636
|
},
|
|
637
637
|
/**
|
|
638
|
+
* Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs. This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. **Beta:** this endpoint and its response schema may change.
|
|
639
|
+
* @summary Get account order detail
|
|
640
|
+
* @param {string} accountId
|
|
641
|
+
* @param {string} brokerageOrderId
|
|
642
|
+
* @param {string} [userId]
|
|
643
|
+
* @param {string} [userSecret]
|
|
644
|
+
* @param {*} [options] Override http request option.
|
|
645
|
+
* @throws {RequiredError}
|
|
646
|
+
*/
|
|
647
|
+
getAccountOrder: async (accountId, brokerageOrderId, userId, userSecret, options = {}) => {
|
|
648
|
+
assertParamExists("getAccountOrder", "accountId", accountId);
|
|
649
|
+
assertParamExists("getAccountOrder", "brokerageOrderId", brokerageOrderId);
|
|
650
|
+
const localVarPath = `/accounts/{accountId}/orders/{brokerageOrderId}`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`))).replace(`{brokerageOrderId}`, encodeURIComponent(String(brokerageOrderId !== void 0 ? brokerageOrderId : `-brokerageOrderId-`)));
|
|
651
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
652
|
+
let baseOptions;
|
|
653
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
654
|
+
const localVarRequestOptions = {
|
|
655
|
+
method: "GET",
|
|
656
|
+
...baseOptions,
|
|
657
|
+
...options
|
|
658
|
+
};
|
|
659
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
660
|
+
const localVarQueryParameter = {};
|
|
661
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
662
|
+
await setApiKeyToObject({
|
|
663
|
+
object: localVarQueryParameter,
|
|
664
|
+
key: "clientId",
|
|
665
|
+
keyParamName: "clientId",
|
|
666
|
+
configuration
|
|
667
|
+
});
|
|
668
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
669
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
670
|
+
}
|
|
671
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
672
|
+
object: localVarQueryParameter,
|
|
673
|
+
key: "clientId",
|
|
674
|
+
keyParamName: "clientId",
|
|
675
|
+
configuration
|
|
676
|
+
});
|
|
677
|
+
const localVarOperationAuth = {
|
|
678
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
679
|
+
requestSigningByAuthMode: {
|
|
680
|
+
"commercialApiKey": {
|
|
681
|
+
secretParameter: "consumerKey",
|
|
682
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
683
|
+
},
|
|
684
|
+
"personalApiKey": {
|
|
685
|
+
secretParameter: "consumerKey",
|
|
686
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
selectedAuthMode: configuration?.authMode
|
|
690
|
+
};
|
|
691
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
692
|
+
localVarRequestOptions.headers = {
|
|
693
|
+
...localVarHeaderParameter,
|
|
694
|
+
...headersFromBaseOptions,
|
|
695
|
+
...options.headers
|
|
696
|
+
};
|
|
697
|
+
requestBeforeHook({
|
|
698
|
+
queryParameters: localVarQueryParameter,
|
|
699
|
+
requestConfig: localVarRequestOptions,
|
|
700
|
+
path: localVarPath,
|
|
701
|
+
configuration,
|
|
702
|
+
pathTemplate: "/accounts/{accountId}/orders/{brokerageOrderId}",
|
|
703
|
+
httpMethod: "GET",
|
|
704
|
+
operationAuth: localVarOperationAuth
|
|
705
|
+
});
|
|
706
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
707
|
+
return {
|
|
708
|
+
url: toPathString(localVarUrlObj),
|
|
709
|
+
options: localVarRequestOptions
|
|
710
|
+
};
|
|
711
|
+
},
|
|
712
|
+
/**
|
|
713
|
+
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Beta:** this endpoint and its response schema may change. 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.
|
|
714
|
+
* @summary List all account orders
|
|
715
|
+
* @param {string} accountId
|
|
716
|
+
* @param {'all' | 'open' | 'executed'} [state] defaults to \"all\"
|
|
717
|
+
* @param {number} [days] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
718
|
+
* @param {string} [userId]
|
|
719
|
+
* @param {string} [userSecret]
|
|
720
|
+
* @param {*} [options] Override http request option.
|
|
721
|
+
* @throws {RequiredError}
|
|
722
|
+
*/
|
|
723
|
+
getAllAccountOrders: async (accountId, state, days, userId, userSecret, options = {}) => {
|
|
724
|
+
assertParamExists("getAllAccountOrders", "accountId", accountId);
|
|
725
|
+
const localVarPath = `/accounts/{accountId}/orders/all`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
726
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
727
|
+
let baseOptions;
|
|
728
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
729
|
+
const localVarRequestOptions = {
|
|
730
|
+
method: "GET",
|
|
731
|
+
...baseOptions,
|
|
732
|
+
...options
|
|
733
|
+
};
|
|
734
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
735
|
+
const localVarQueryParameter = {};
|
|
736
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
737
|
+
await setApiKeyToObject({
|
|
738
|
+
object: localVarQueryParameter,
|
|
739
|
+
key: "clientId",
|
|
740
|
+
keyParamName: "clientId",
|
|
741
|
+
configuration
|
|
742
|
+
});
|
|
743
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
744
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
745
|
+
}
|
|
746
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
747
|
+
object: localVarQueryParameter,
|
|
748
|
+
key: "clientId",
|
|
749
|
+
keyParamName: "clientId",
|
|
750
|
+
configuration
|
|
751
|
+
});
|
|
752
|
+
if (state !== void 0) localVarQueryParameter["state"] = state;
|
|
753
|
+
if (days !== void 0) localVarQueryParameter["days"] = days;
|
|
754
|
+
const localVarOperationAuth = {
|
|
755
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
756
|
+
requestSigningByAuthMode: {
|
|
757
|
+
"commercialApiKey": {
|
|
758
|
+
secretParameter: "consumerKey",
|
|
759
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
760
|
+
},
|
|
761
|
+
"personalApiKey": {
|
|
762
|
+
secretParameter: "consumerKey",
|
|
763
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
selectedAuthMode: configuration?.authMode
|
|
767
|
+
};
|
|
768
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
769
|
+
localVarRequestOptions.headers = {
|
|
770
|
+
...localVarHeaderParameter,
|
|
771
|
+
...headersFromBaseOptions,
|
|
772
|
+
...options.headers
|
|
773
|
+
};
|
|
774
|
+
requestBeforeHook({
|
|
775
|
+
queryParameters: localVarQueryParameter,
|
|
776
|
+
requestConfig: localVarRequestOptions,
|
|
777
|
+
path: localVarPath,
|
|
778
|
+
configuration,
|
|
779
|
+
pathTemplate: "/accounts/{accountId}/orders/all",
|
|
780
|
+
httpMethod: "GET",
|
|
781
|
+
operationAuth: localVarOperationAuth
|
|
782
|
+
});
|
|
783
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
784
|
+
return {
|
|
785
|
+
url: toPathString(localVarUrlObj),
|
|
786
|
+
options: localVarRequestOptions
|
|
787
|
+
};
|
|
788
|
+
},
|
|
789
|
+
/**
|
|
638
790
|
* Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, preferred stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. **Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change. Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `preferred_stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). 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.
|
|
639
791
|
* @summary List all account positions
|
|
640
792
|
* @param {string} accountId
|
|
@@ -713,6 +865,81 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
713
865
|
};
|
|
714
866
|
},
|
|
715
867
|
/**
|
|
868
|
+
* A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Beta:** this endpoint and its response schema may change. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
869
|
+
* @summary List all account recent orders (last 24 hours only)
|
|
870
|
+
* @param {string} accountId
|
|
871
|
+
* @param {boolean} [onlyExecuted] Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
|
|
872
|
+
* @param {string} [userId]
|
|
873
|
+
* @param {string} [userSecret]
|
|
874
|
+
* @param {*} [options] Override http request option.
|
|
875
|
+
* @throws {RequiredError}
|
|
876
|
+
*/
|
|
877
|
+
getAllAccountRecentOrders: async (accountId, onlyExecuted, userId, userSecret, options = {}) => {
|
|
878
|
+
assertParamExists("getAllAccountRecentOrders", "accountId", accountId);
|
|
879
|
+
const localVarPath = `/accounts/{accountId}/orders/recent`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
880
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
881
|
+
let baseOptions;
|
|
882
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
883
|
+
const localVarRequestOptions = {
|
|
884
|
+
method: "GET",
|
|
885
|
+
...baseOptions,
|
|
886
|
+
...options
|
|
887
|
+
};
|
|
888
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
889
|
+
const localVarQueryParameter = {};
|
|
890
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
891
|
+
await setApiKeyToObject({
|
|
892
|
+
object: localVarQueryParameter,
|
|
893
|
+
key: "clientId",
|
|
894
|
+
keyParamName: "clientId",
|
|
895
|
+
configuration
|
|
896
|
+
});
|
|
897
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
898
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
899
|
+
}
|
|
900
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
901
|
+
object: localVarQueryParameter,
|
|
902
|
+
key: "clientId",
|
|
903
|
+
keyParamName: "clientId",
|
|
904
|
+
configuration
|
|
905
|
+
});
|
|
906
|
+
if (onlyExecuted !== void 0) localVarQueryParameter["only_executed"] = onlyExecuted;
|
|
907
|
+
const localVarOperationAuth = {
|
|
908
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
909
|
+
requestSigningByAuthMode: {
|
|
910
|
+
"commercialApiKey": {
|
|
911
|
+
secretParameter: "consumerKey",
|
|
912
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
913
|
+
},
|
|
914
|
+
"personalApiKey": {
|
|
915
|
+
secretParameter: "consumerKey",
|
|
916
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
917
|
+
}
|
|
918
|
+
},
|
|
919
|
+
selectedAuthMode: configuration?.authMode
|
|
920
|
+
};
|
|
921
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
922
|
+
localVarRequestOptions.headers = {
|
|
923
|
+
...localVarHeaderParameter,
|
|
924
|
+
...headersFromBaseOptions,
|
|
925
|
+
...options.headers
|
|
926
|
+
};
|
|
927
|
+
requestBeforeHook({
|
|
928
|
+
queryParameters: localVarQueryParameter,
|
|
929
|
+
requestConfig: localVarRequestOptions,
|
|
930
|
+
path: localVarPath,
|
|
931
|
+
configuration,
|
|
932
|
+
pathTemplate: "/accounts/{accountId}/orders/recent",
|
|
933
|
+
httpMethod: "GET",
|
|
934
|
+
operationAuth: localVarOperationAuth
|
|
935
|
+
});
|
|
936
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
937
|
+
return {
|
|
938
|
+
url: toPathString(localVarUrlObj),
|
|
939
|
+
options: localVarRequestOptions
|
|
940
|
+
};
|
|
941
|
+
},
|
|
942
|
+
/**
|
|
716
943
|
* Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
717
944
|
* @summary List account balances
|
|
718
945
|
* @param {string} accountId
|
|
@@ -1613,20 +1840,16 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1613
1840
|
});
|
|
1614
1841
|
},
|
|
1615
1842
|
/**
|
|
1616
|
-
* Returns
|
|
1617
|
-
* @summary
|
|
1618
|
-
* @param {
|
|
1843
|
+
* Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs. This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. **Beta:** this endpoint and its response schema may change.
|
|
1844
|
+
* @summary Get account order detail
|
|
1845
|
+
* @param {AccountInformationApiGetAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
1619
1846
|
* @param {*} [options] Override http request option.
|
|
1620
1847
|
* @throws {RequiredError}
|
|
1621
1848
|
*/
|
|
1622
|
-
async
|
|
1849
|
+
async getAccountOrder(...args) {
|
|
1623
1850
|
const [requestParameters = {}, options] = args;
|
|
1624
|
-
return createRequestFunction(await localVarAxiosParamCreator.
|
|
1625
|
-
authModes: [
|
|
1626
|
-
"commercialApiKey",
|
|
1627
|
-
"personalApiKey",
|
|
1628
|
-
"oauth"
|
|
1629
|
-
],
|
|
1851
|
+
return createRequestFunction(await localVarAxiosParamCreator.getAccountOrder(requestParameters.accountId, requestParameters.brokerageOrderId, requestParameters.userId, requestParameters.userSecret, options), axios, BASE_PATH, configuration, {
|
|
1852
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
1630
1853
|
requestSigningByAuthMode: {
|
|
1631
1854
|
"commercialApiKey": {
|
|
1632
1855
|
secretParameter: "consumerKey",
|
|
@@ -1640,20 +1863,16 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1640
1863
|
});
|
|
1641
1864
|
},
|
|
1642
1865
|
/**
|
|
1643
|
-
* Returns a list of
|
|
1644
|
-
* @summary List account
|
|
1645
|
-
* @param {
|
|
1866
|
+
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Beta:** this endpoint and its response schema may change. 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.
|
|
1867
|
+
* @summary List all account orders
|
|
1868
|
+
* @param {AccountInformationApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
1646
1869
|
* @param {*} [options] Override http request option.
|
|
1647
1870
|
* @throws {RequiredError}
|
|
1648
1871
|
*/
|
|
1649
|
-
async
|
|
1872
|
+
async getAllAccountOrders(...args) {
|
|
1650
1873
|
const [requestParameters = {}, options] = args;
|
|
1651
|
-
return createRequestFunction(await localVarAxiosParamCreator.
|
|
1652
|
-
authModes: [
|
|
1653
|
-
"commercialApiKey",
|
|
1654
|
-
"personalApiKey",
|
|
1655
|
-
"oauth"
|
|
1656
|
-
],
|
|
1874
|
+
return createRequestFunction(await localVarAxiosParamCreator.getAllAccountOrders(requestParameters.accountId, requestParameters.state, requestParameters.days, requestParameters.userId, requestParameters.userSecret, options), axios, BASE_PATH, configuration, {
|
|
1875
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
1657
1876
|
requestSigningByAuthMode: {
|
|
1658
1877
|
"commercialApiKey": {
|
|
1659
1878
|
secretParameter: "consumerKey",
|
|
@@ -1667,10 +1886,87 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1667
1886
|
});
|
|
1668
1887
|
},
|
|
1669
1888
|
/**
|
|
1670
|
-
*
|
|
1671
|
-
* @summary
|
|
1672
|
-
* @param {
|
|
1673
|
-
* @param {*} [options] Override http request option.
|
|
1889
|
+
* Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, preferred stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. **Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change. Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `preferred_stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). 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.
|
|
1890
|
+
* @summary List all account positions
|
|
1891
|
+
* @param {AccountInformationApiGetAllAccountPositionsRequest<TAuth>} requestParameters Request parameters.
|
|
1892
|
+
* @param {*} [options] Override http request option.
|
|
1893
|
+
* @throws {RequiredError}
|
|
1894
|
+
*/
|
|
1895
|
+
async getAllAccountPositions(...args) {
|
|
1896
|
+
const [requestParameters = {}, options] = args;
|
|
1897
|
+
return createRequestFunction(await localVarAxiosParamCreator.getAllAccountPositions(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), axios, BASE_PATH, configuration, {
|
|
1898
|
+
authModes: [
|
|
1899
|
+
"commercialApiKey",
|
|
1900
|
+
"personalApiKey",
|
|
1901
|
+
"oauth"
|
|
1902
|
+
],
|
|
1903
|
+
requestSigningByAuthMode: {
|
|
1904
|
+
"commercialApiKey": {
|
|
1905
|
+
secretParameter: "consumerKey",
|
|
1906
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
1907
|
+
},
|
|
1908
|
+
"personalApiKey": {
|
|
1909
|
+
secretParameter: "consumerKey",
|
|
1910
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
});
|
|
1914
|
+
},
|
|
1915
|
+
/**
|
|
1916
|
+
* A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Beta:** this endpoint and its response schema may change. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
1917
|
+
* @summary List all account recent orders (last 24 hours only)
|
|
1918
|
+
* @param {AccountInformationApiGetAllAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
1919
|
+
* @param {*} [options] Override http request option.
|
|
1920
|
+
* @throws {RequiredError}
|
|
1921
|
+
*/
|
|
1922
|
+
async getAllAccountRecentOrders(...args) {
|
|
1923
|
+
const [requestParameters = {}, options] = args;
|
|
1924
|
+
return createRequestFunction(await localVarAxiosParamCreator.getAllAccountRecentOrders(requestParameters.accountId, requestParameters.onlyExecuted, requestParameters.userId, requestParameters.userSecret, options), axios, BASE_PATH, configuration, {
|
|
1925
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
1926
|
+
requestSigningByAuthMode: {
|
|
1927
|
+
"commercialApiKey": {
|
|
1928
|
+
secretParameter: "consumerKey",
|
|
1929
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
1930
|
+
},
|
|
1931
|
+
"personalApiKey": {
|
|
1932
|
+
secretParameter: "consumerKey",
|
|
1933
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
});
|
|
1937
|
+
},
|
|
1938
|
+
/**
|
|
1939
|
+
* Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1940
|
+
* @summary List account balances
|
|
1941
|
+
* @param {AccountInformationApiGetUserAccountBalanceRequest<TAuth>} requestParameters Request parameters.
|
|
1942
|
+
* @param {*} [options] Override http request option.
|
|
1943
|
+
* @throws {RequiredError}
|
|
1944
|
+
*/
|
|
1945
|
+
async getUserAccountBalance(...args) {
|
|
1946
|
+
const [requestParameters = {}, options] = args;
|
|
1947
|
+
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountBalance(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), axios, BASE_PATH, configuration, {
|
|
1948
|
+
authModes: [
|
|
1949
|
+
"commercialApiKey",
|
|
1950
|
+
"personalApiKey",
|
|
1951
|
+
"oauth"
|
|
1952
|
+
],
|
|
1953
|
+
requestSigningByAuthMode: {
|
|
1954
|
+
"commercialApiKey": {
|
|
1955
|
+
secretParameter: "consumerKey",
|
|
1956
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
1957
|
+
},
|
|
1958
|
+
"personalApiKey": {
|
|
1959
|
+
secretParameter: "consumerKey",
|
|
1960
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
});
|
|
1964
|
+
},
|
|
1965
|
+
/**
|
|
1966
|
+
* **Deprecated.** Use the [get account details](/reference/Account%20Information/AccountInformation_getAccountDetails) endpoint instead, which supports all account types, including investment, deposit, line of credit, annuity, and mortgage accounts. Returns account detail known to SnapTrade for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1967
|
+
* @summary Get account detail
|
|
1968
|
+
* @param {AccountInformationApiGetUserAccountDetailsRequest<TAuth>} requestParameters Request parameters.
|
|
1969
|
+
* @param {*} [options] Override http request option.
|
|
1674
1970
|
* @deprecated
|
|
1675
1971
|
* @throws {RequiredError}
|
|
1676
1972
|
*/
|
|
@@ -1959,6 +2255,26 @@ const AccountInformationApiFactory = function(configuration, basePath, axios) {
|
|
|
1959
2255
|
return localVarFp.getAccountDetails(...args).then((request) => request(axios, basePath));
|
|
1960
2256
|
},
|
|
1961
2257
|
/**
|
|
2258
|
+
* Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs. This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. **Beta:** this endpoint and its response schema may change.
|
|
2259
|
+
* @summary Get account order detail
|
|
2260
|
+
* @param {AccountInformationApiGetAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
2261
|
+
* @param {*} [options] Override http request option.
|
|
2262
|
+
* @throws {RequiredError}
|
|
2263
|
+
*/
|
|
2264
|
+
getAccountOrder(...args) {
|
|
2265
|
+
return localVarFp.getAccountOrder(...args).then((request) => request(axios, basePath));
|
|
2266
|
+
},
|
|
2267
|
+
/**
|
|
2268
|
+
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Beta:** this endpoint and its response schema may change. 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.
|
|
2269
|
+
* @summary List all account orders
|
|
2270
|
+
* @param {AccountInformationApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
2271
|
+
* @param {*} [options] Override http request option.
|
|
2272
|
+
* @throws {RequiredError}
|
|
2273
|
+
*/
|
|
2274
|
+
getAllAccountOrders(...args) {
|
|
2275
|
+
return localVarFp.getAllAccountOrders(...args).then((request) => request(axios, basePath));
|
|
2276
|
+
},
|
|
2277
|
+
/**
|
|
1962
2278
|
* Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, preferred stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. **Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change. Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `preferred_stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). 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.
|
|
1963
2279
|
* @summary List all account positions
|
|
1964
2280
|
* @param {AccountInformationApiGetAllAccountPositionsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1969,6 +2285,16 @@ const AccountInformationApiFactory = function(configuration, basePath, axios) {
|
|
|
1969
2285
|
return localVarFp.getAllAccountPositions(...args).then((request) => request(axios, basePath));
|
|
1970
2286
|
},
|
|
1971
2287
|
/**
|
|
2288
|
+
* A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Beta:** this endpoint and its response schema may change. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
2289
|
+
* @summary List all account recent orders (last 24 hours only)
|
|
2290
|
+
* @param {AccountInformationApiGetAllAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
2291
|
+
* @param {*} [options] Override http request option.
|
|
2292
|
+
* @throws {RequiredError}
|
|
2293
|
+
*/
|
|
2294
|
+
getAllAccountRecentOrders(...args) {
|
|
2295
|
+
return localVarFp.getAllAccountRecentOrders(...args).then((request) => request(axios, basePath));
|
|
2296
|
+
},
|
|
2297
|
+
/**
|
|
1972
2298
|
* Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1973
2299
|
* @summary List account balances
|
|
1974
2300
|
* @param {AccountInformationApiGetUserAccountBalanceRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -2125,6 +2451,28 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
2125
2451
|
return AccountInformationApiFp(this.configuration).getAccountDetails(...args).then((request) => request(this.axios, this.basePath));
|
|
2126
2452
|
}
|
|
2127
2453
|
/**
|
|
2454
|
+
* Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs. This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. **Beta:** this endpoint and its response schema may change.
|
|
2455
|
+
* @summary Get account order detail
|
|
2456
|
+
* @param {AccountInformationApiGetAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
2457
|
+
* @param {*} [options] Override http request option.
|
|
2458
|
+
* @throws {RequiredError}
|
|
2459
|
+
* @memberof AccountInformationApiGenerated
|
|
2460
|
+
*/
|
|
2461
|
+
getAccountOrder(...args) {
|
|
2462
|
+
return AccountInformationApiFp(this.configuration).getAccountOrder(...args).then((request) => request(this.axios, this.basePath));
|
|
2463
|
+
}
|
|
2464
|
+
/**
|
|
2465
|
+
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Beta:** this endpoint and its response schema may change. 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.
|
|
2466
|
+
* @summary List all account orders
|
|
2467
|
+
* @param {AccountInformationApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
2468
|
+
* @param {*} [options] Override http request option.
|
|
2469
|
+
* @throws {RequiredError}
|
|
2470
|
+
* @memberof AccountInformationApiGenerated
|
|
2471
|
+
*/
|
|
2472
|
+
getAllAccountOrders(...args) {
|
|
2473
|
+
return AccountInformationApiFp(this.configuration).getAllAccountOrders(...args).then((request) => request(this.axios, this.basePath));
|
|
2474
|
+
}
|
|
2475
|
+
/**
|
|
2128
2476
|
* Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, preferred stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. **Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change. Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `preferred_stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). 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.
|
|
2129
2477
|
* @summary List all account positions
|
|
2130
2478
|
* @param {AccountInformationApiGetAllAccountPositionsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -2136,6 +2484,17 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
2136
2484
|
return AccountInformationApiFp(this.configuration).getAllAccountPositions(...args).then((request) => request(this.axios, this.basePath));
|
|
2137
2485
|
}
|
|
2138
2486
|
/**
|
|
2487
|
+
* A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Beta:** this endpoint and its response schema may change. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
2488
|
+
* @summary List all account recent orders (last 24 hours only)
|
|
2489
|
+
* @param {AccountInformationApiGetAllAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
2490
|
+
* @param {*} [options] Override http request option.
|
|
2491
|
+
* @throws {RequiredError}
|
|
2492
|
+
* @memberof AccountInformationApiGenerated
|
|
2493
|
+
*/
|
|
2494
|
+
getAllAccountRecentOrders(...args) {
|
|
2495
|
+
return AccountInformationApiFp(this.configuration).getAllAccountRecentOrders(...args).then((request) => request(this.axios, this.basePath));
|
|
2496
|
+
}
|
|
2497
|
+
/**
|
|
2139
2498
|
* Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
2140
2499
|
* @summary List account balances
|
|
2141
2500
|
* @param {AccountInformationApiGetUserAccountBalanceRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -4227,233 +4586,6 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4227
4586
|
};
|
|
4228
4587
|
},
|
|
4229
4588
|
/**
|
|
4230
|
-
* Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs. This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. **Experimental:** this endpoint may change without notice.
|
|
4231
|
-
* @summary Get account order detail
|
|
4232
|
-
* @param {string} accountId
|
|
4233
|
-
* @param {string} brokerageOrderId
|
|
4234
|
-
* @param {string} [userId]
|
|
4235
|
-
* @param {string} [userSecret]
|
|
4236
|
-
* @param {*} [options] Override http request option.
|
|
4237
|
-
* @throws {RequiredError}
|
|
4238
|
-
*/
|
|
4239
|
-
getAccountOrder: async (accountId, brokerageOrderId, userId, userSecret, options = {}) => {
|
|
4240
|
-
assertParamExists("getAccountOrder", "accountId", accountId);
|
|
4241
|
-
assertParamExists("getAccountOrder", "brokerageOrderId", brokerageOrderId);
|
|
4242
|
-
const localVarPath = `/accounts/{accountId}/orders/{brokerageOrderId}`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`))).replace(`{brokerageOrderId}`, encodeURIComponent(String(brokerageOrderId !== void 0 ? brokerageOrderId : `-brokerageOrderId-`)));
|
|
4243
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4244
|
-
let baseOptions;
|
|
4245
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
4246
|
-
const localVarRequestOptions = {
|
|
4247
|
-
method: "GET",
|
|
4248
|
-
...baseOptions,
|
|
4249
|
-
...options
|
|
4250
|
-
};
|
|
4251
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4252
|
-
const localVarQueryParameter = {};
|
|
4253
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
4254
|
-
await setApiKeyToObject({
|
|
4255
|
-
object: localVarQueryParameter,
|
|
4256
|
-
key: "clientId",
|
|
4257
|
-
keyParamName: "clientId",
|
|
4258
|
-
configuration
|
|
4259
|
-
});
|
|
4260
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
4261
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
4262
|
-
}
|
|
4263
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4264
|
-
object: localVarQueryParameter,
|
|
4265
|
-
key: "clientId",
|
|
4266
|
-
keyParamName: "clientId",
|
|
4267
|
-
configuration
|
|
4268
|
-
});
|
|
4269
|
-
const localVarOperationAuth = {
|
|
4270
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4271
|
-
requestSigningByAuthMode: {
|
|
4272
|
-
"commercialApiKey": {
|
|
4273
|
-
secretParameter: "consumerKey",
|
|
4274
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4275
|
-
},
|
|
4276
|
-
"personalApiKey": {
|
|
4277
|
-
secretParameter: "consumerKey",
|
|
4278
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4279
|
-
}
|
|
4280
|
-
},
|
|
4281
|
-
selectedAuthMode: configuration?.authMode
|
|
4282
|
-
};
|
|
4283
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4284
|
-
localVarRequestOptions.headers = {
|
|
4285
|
-
...localVarHeaderParameter,
|
|
4286
|
-
...headersFromBaseOptions,
|
|
4287
|
-
...options.headers
|
|
4288
|
-
};
|
|
4289
|
-
requestBeforeHook({
|
|
4290
|
-
queryParameters: localVarQueryParameter,
|
|
4291
|
-
requestConfig: localVarRequestOptions,
|
|
4292
|
-
path: localVarPath,
|
|
4293
|
-
configuration,
|
|
4294
|
-
pathTemplate: "/accounts/{accountId}/orders/{brokerageOrderId}",
|
|
4295
|
-
httpMethod: "GET",
|
|
4296
|
-
operationAuth: localVarOperationAuth
|
|
4297
|
-
});
|
|
4298
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4299
|
-
return {
|
|
4300
|
-
url: toPathString(localVarUrlObj),
|
|
4301
|
-
options: localVarRequestOptions
|
|
4302
|
-
};
|
|
4303
|
-
},
|
|
4304
|
-
/**
|
|
4305
|
-
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. 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.
|
|
4306
|
-
* @summary List all account orders
|
|
4307
|
-
* @param {string} accountId
|
|
4308
|
-
* @param {'all' | 'open' | 'executed'} [state] defaults to \"all\"
|
|
4309
|
-
* @param {number} [days] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
4310
|
-
* @param {string} [userId]
|
|
4311
|
-
* @param {string} [userSecret]
|
|
4312
|
-
* @param {*} [options] Override http request option.
|
|
4313
|
-
* @throws {RequiredError}
|
|
4314
|
-
*/
|
|
4315
|
-
getAllAccountOrders: async (accountId, state, days, userId, userSecret, options = {}) => {
|
|
4316
|
-
assertParamExists("getAllAccountOrders", "accountId", accountId);
|
|
4317
|
-
const localVarPath = `/accounts/{accountId}/orders/all`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
4318
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4319
|
-
let baseOptions;
|
|
4320
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
4321
|
-
const localVarRequestOptions = {
|
|
4322
|
-
method: "GET",
|
|
4323
|
-
...baseOptions,
|
|
4324
|
-
...options
|
|
4325
|
-
};
|
|
4326
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4327
|
-
const localVarQueryParameter = {};
|
|
4328
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
4329
|
-
await setApiKeyToObject({
|
|
4330
|
-
object: localVarQueryParameter,
|
|
4331
|
-
key: "clientId",
|
|
4332
|
-
keyParamName: "clientId",
|
|
4333
|
-
configuration
|
|
4334
|
-
});
|
|
4335
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
4336
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
4337
|
-
}
|
|
4338
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4339
|
-
object: localVarQueryParameter,
|
|
4340
|
-
key: "clientId",
|
|
4341
|
-
keyParamName: "clientId",
|
|
4342
|
-
configuration
|
|
4343
|
-
});
|
|
4344
|
-
if (state !== void 0) localVarQueryParameter["state"] = state;
|
|
4345
|
-
if (days !== void 0) localVarQueryParameter["days"] = days;
|
|
4346
|
-
const localVarOperationAuth = {
|
|
4347
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4348
|
-
requestSigningByAuthMode: {
|
|
4349
|
-
"commercialApiKey": {
|
|
4350
|
-
secretParameter: "consumerKey",
|
|
4351
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4352
|
-
},
|
|
4353
|
-
"personalApiKey": {
|
|
4354
|
-
secretParameter: "consumerKey",
|
|
4355
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4356
|
-
}
|
|
4357
|
-
},
|
|
4358
|
-
selectedAuthMode: configuration?.authMode
|
|
4359
|
-
};
|
|
4360
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4361
|
-
localVarRequestOptions.headers = {
|
|
4362
|
-
...localVarHeaderParameter,
|
|
4363
|
-
...headersFromBaseOptions,
|
|
4364
|
-
...options.headers
|
|
4365
|
-
};
|
|
4366
|
-
requestBeforeHook({
|
|
4367
|
-
queryParameters: localVarQueryParameter,
|
|
4368
|
-
requestConfig: localVarRequestOptions,
|
|
4369
|
-
path: localVarPath,
|
|
4370
|
-
configuration,
|
|
4371
|
-
pathTemplate: "/accounts/{accountId}/orders/all",
|
|
4372
|
-
httpMethod: "GET",
|
|
4373
|
-
operationAuth: localVarOperationAuth
|
|
4374
|
-
});
|
|
4375
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4376
|
-
return {
|
|
4377
|
-
url: toPathString(localVarUrlObj),
|
|
4378
|
-
options: localVarRequestOptions
|
|
4379
|
-
};
|
|
4380
|
-
},
|
|
4381
|
-
/**
|
|
4382
|
-
* A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Experimental:** this endpoint may change without notice. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
4383
|
-
* @summary List all account recent orders (last 24 hours only)
|
|
4384
|
-
* @param {string} accountId
|
|
4385
|
-
* @param {boolean} [onlyExecuted] Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
|
|
4386
|
-
* @param {string} [userId]
|
|
4387
|
-
* @param {string} [userSecret]
|
|
4388
|
-
* @param {*} [options] Override http request option.
|
|
4389
|
-
* @throws {RequiredError}
|
|
4390
|
-
*/
|
|
4391
|
-
getAllAccountRecentOrders: async (accountId, onlyExecuted, userId, userSecret, options = {}) => {
|
|
4392
|
-
assertParamExists("getAllAccountRecentOrders", "accountId", accountId);
|
|
4393
|
-
const localVarPath = `/accounts/{accountId}/orders/recent`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
4394
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4395
|
-
let baseOptions;
|
|
4396
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
4397
|
-
const localVarRequestOptions = {
|
|
4398
|
-
method: "GET",
|
|
4399
|
-
...baseOptions,
|
|
4400
|
-
...options
|
|
4401
|
-
};
|
|
4402
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4403
|
-
const localVarQueryParameter = {};
|
|
4404
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
4405
|
-
await setApiKeyToObject({
|
|
4406
|
-
object: localVarQueryParameter,
|
|
4407
|
-
key: "clientId",
|
|
4408
|
-
keyParamName: "clientId",
|
|
4409
|
-
configuration
|
|
4410
|
-
});
|
|
4411
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
4412
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
4413
|
-
}
|
|
4414
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4415
|
-
object: localVarQueryParameter,
|
|
4416
|
-
key: "clientId",
|
|
4417
|
-
keyParamName: "clientId",
|
|
4418
|
-
configuration
|
|
4419
|
-
});
|
|
4420
|
-
if (onlyExecuted !== void 0) localVarQueryParameter["only_executed"] = onlyExecuted;
|
|
4421
|
-
const localVarOperationAuth = {
|
|
4422
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4423
|
-
requestSigningByAuthMode: {
|
|
4424
|
-
"commercialApiKey": {
|
|
4425
|
-
secretParameter: "consumerKey",
|
|
4426
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4427
|
-
},
|
|
4428
|
-
"personalApiKey": {
|
|
4429
|
-
secretParameter: "consumerKey",
|
|
4430
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4431
|
-
}
|
|
4432
|
-
},
|
|
4433
|
-
selectedAuthMode: configuration?.authMode
|
|
4434
|
-
};
|
|
4435
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4436
|
-
localVarRequestOptions.headers = {
|
|
4437
|
-
...localVarHeaderParameter,
|
|
4438
|
-
...headersFromBaseOptions,
|
|
4439
|
-
...options.headers
|
|
4440
|
-
};
|
|
4441
|
-
requestBeforeHook({
|
|
4442
|
-
queryParameters: localVarQueryParameter,
|
|
4443
|
-
requestConfig: localVarRequestOptions,
|
|
4444
|
-
path: localVarPath,
|
|
4445
|
-
configuration,
|
|
4446
|
-
pathTemplate: "/accounts/{accountId}/orders/recent",
|
|
4447
|
-
httpMethod: "GET",
|
|
4448
|
-
operationAuth: localVarOperationAuth
|
|
4449
|
-
});
|
|
4450
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4451
|
-
return {
|
|
4452
|
-
url: toPathString(localVarUrlObj),
|
|
4453
|
-
options: localVarRequestOptions
|
|
4454
|
-
};
|
|
4455
|
-
},
|
|
4456
|
-
/**
|
|
4457
4589
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
4458
4590
|
* @summary Get account order detail (V2)
|
|
4459
4591
|
* @param {string} accountId
|
|
@@ -4904,75 +5036,6 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4904
5036
|
});
|
|
4905
5037
|
},
|
|
4906
5038
|
/**
|
|
4907
|
-
* Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs. This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. **Experimental:** this endpoint may change without notice.
|
|
4908
|
-
* @summary Get account order detail
|
|
4909
|
-
* @param {ExperimentalEndpointsApiGetAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
4910
|
-
* @param {*} [options] Override http request option.
|
|
4911
|
-
* @throws {RequiredError}
|
|
4912
|
-
*/
|
|
4913
|
-
async getAccountOrder(...args) {
|
|
4914
|
-
const [requestParameters = {}, options] = args;
|
|
4915
|
-
return createRequestFunction(await localVarAxiosParamCreator.getAccountOrder(requestParameters.accountId, requestParameters.brokerageOrderId, requestParameters.userId, requestParameters.userSecret, options), axios, BASE_PATH, configuration, {
|
|
4916
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4917
|
-
requestSigningByAuthMode: {
|
|
4918
|
-
"commercialApiKey": {
|
|
4919
|
-
secretParameter: "consumerKey",
|
|
4920
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4921
|
-
},
|
|
4922
|
-
"personalApiKey": {
|
|
4923
|
-
secretParameter: "consumerKey",
|
|
4924
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4925
|
-
}
|
|
4926
|
-
}
|
|
4927
|
-
});
|
|
4928
|
-
},
|
|
4929
|
-
/**
|
|
4930
|
-
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. 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.
|
|
4931
|
-
* @summary List all account orders
|
|
4932
|
-
* @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
4933
|
-
* @param {*} [options] Override http request option.
|
|
4934
|
-
* @throws {RequiredError}
|
|
4935
|
-
*/
|
|
4936
|
-
async getAllAccountOrders(...args) {
|
|
4937
|
-
const [requestParameters = {}, options] = args;
|
|
4938
|
-
return createRequestFunction(await localVarAxiosParamCreator.getAllAccountOrders(requestParameters.accountId, requestParameters.state, requestParameters.days, requestParameters.userId, requestParameters.userSecret, options), axios, BASE_PATH, configuration, {
|
|
4939
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4940
|
-
requestSigningByAuthMode: {
|
|
4941
|
-
"commercialApiKey": {
|
|
4942
|
-
secretParameter: "consumerKey",
|
|
4943
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4944
|
-
},
|
|
4945
|
-
"personalApiKey": {
|
|
4946
|
-
secretParameter: "consumerKey",
|
|
4947
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4948
|
-
}
|
|
4949
|
-
}
|
|
4950
|
-
});
|
|
4951
|
-
},
|
|
4952
|
-
/**
|
|
4953
|
-
* A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Experimental:** this endpoint may change without notice. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
4954
|
-
* @summary List all account recent orders (last 24 hours only)
|
|
4955
|
-
* @param {ExperimentalEndpointsApiGetAllAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
4956
|
-
* @param {*} [options] Override http request option.
|
|
4957
|
-
* @throws {RequiredError}
|
|
4958
|
-
*/
|
|
4959
|
-
async getAllAccountRecentOrders(...args) {
|
|
4960
|
-
const [requestParameters = {}, options] = args;
|
|
4961
|
-
return createRequestFunction(await localVarAxiosParamCreator.getAllAccountRecentOrders(requestParameters.accountId, requestParameters.onlyExecuted, requestParameters.userId, requestParameters.userSecret, options), axios, BASE_PATH, configuration, {
|
|
4962
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4963
|
-
requestSigningByAuthMode: {
|
|
4964
|
-
"commercialApiKey": {
|
|
4965
|
-
secretParameter: "consumerKey",
|
|
4966
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4967
|
-
},
|
|
4968
|
-
"personalApiKey": {
|
|
4969
|
-
secretParameter: "consumerKey",
|
|
4970
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4971
|
-
}
|
|
4972
|
-
}
|
|
4973
|
-
});
|
|
4974
|
-
},
|
|
4975
|
-
/**
|
|
4976
5039
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
4977
5040
|
* @summary Get account order detail (V2)
|
|
4978
5041
|
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
|
|
@@ -5144,36 +5207,6 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios)
|
|
|
5144
5207
|
return localVarFp.cancelSubscription(...args).then((request) => request(axios, basePath));
|
|
5145
5208
|
},
|
|
5146
5209
|
/**
|
|
5147
|
-
* Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs. This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. **Experimental:** this endpoint may change without notice.
|
|
5148
|
-
* @summary Get account order detail
|
|
5149
|
-
* @param {ExperimentalEndpointsApiGetAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
5150
|
-
* @param {*} [options] Override http request option.
|
|
5151
|
-
* @throws {RequiredError}
|
|
5152
|
-
*/
|
|
5153
|
-
getAccountOrder(...args) {
|
|
5154
|
-
return localVarFp.getAccountOrder(...args).then((request) => request(axios, basePath));
|
|
5155
|
-
},
|
|
5156
|
-
/**
|
|
5157
|
-
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. 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.
|
|
5158
|
-
* @summary List all account orders
|
|
5159
|
-
* @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
5160
|
-
* @param {*} [options] Override http request option.
|
|
5161
|
-
* @throws {RequiredError}
|
|
5162
|
-
*/
|
|
5163
|
-
getAllAccountOrders(...args) {
|
|
5164
|
-
return localVarFp.getAllAccountOrders(...args).then((request) => request(axios, basePath));
|
|
5165
|
-
},
|
|
5166
|
-
/**
|
|
5167
|
-
* A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Experimental:** this endpoint may change without notice. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
5168
|
-
* @summary List all account recent orders (last 24 hours only)
|
|
5169
|
-
* @param {ExperimentalEndpointsApiGetAllAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
5170
|
-
* @param {*} [options] Override http request option.
|
|
5171
|
-
* @throws {RequiredError}
|
|
5172
|
-
*/
|
|
5173
|
-
getAllAccountRecentOrders(...args) {
|
|
5174
|
-
return localVarFp.getAllAccountRecentOrders(...args).then((request) => request(axios, basePath));
|
|
5175
|
-
},
|
|
5176
|
-
/**
|
|
5177
5210
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
5178
5211
|
* @summary Get account order detail (V2)
|
|
5179
5212
|
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
|
|
@@ -5254,39 +5287,6 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
5254
5287
|
return ExperimentalEndpointsApiFp(this.configuration).cancelSubscription(...args).then((request) => request(this.axios, this.basePath));
|
|
5255
5288
|
}
|
|
5256
5289
|
/**
|
|
5257
|
-
* Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs. This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. **Experimental:** this endpoint may change without notice.
|
|
5258
|
-
* @summary Get account order detail
|
|
5259
|
-
* @param {ExperimentalEndpointsApiGetAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
5260
|
-
* @param {*} [options] Override http request option.
|
|
5261
|
-
* @throws {RequiredError}
|
|
5262
|
-
* @memberof ExperimentalEndpointsApiGenerated
|
|
5263
|
-
*/
|
|
5264
|
-
getAccountOrder(...args) {
|
|
5265
|
-
return ExperimentalEndpointsApiFp(this.configuration).getAccountOrder(...args).then((request) => request(this.axios, this.basePath));
|
|
5266
|
-
}
|
|
5267
|
-
/**
|
|
5268
|
-
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. 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.
|
|
5269
|
-
* @summary List all account orders
|
|
5270
|
-
* @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
5271
|
-
* @param {*} [options] Override http request option.
|
|
5272
|
-
* @throws {RequiredError}
|
|
5273
|
-
* @memberof ExperimentalEndpointsApiGenerated
|
|
5274
|
-
*/
|
|
5275
|
-
getAllAccountOrders(...args) {
|
|
5276
|
-
return ExperimentalEndpointsApiFp(this.configuration).getAllAccountOrders(...args).then((request) => request(this.axios, this.basePath));
|
|
5277
|
-
}
|
|
5278
|
-
/**
|
|
5279
|
-
* A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Experimental:** this endpoint may change without notice. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
5280
|
-
* @summary List all account recent orders (last 24 hours only)
|
|
5281
|
-
* @param {ExperimentalEndpointsApiGetAllAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
5282
|
-
* @param {*} [options] Override http request option.
|
|
5283
|
-
* @throws {RequiredError}
|
|
5284
|
-
* @memberof ExperimentalEndpointsApiGenerated
|
|
5285
|
-
*/
|
|
5286
|
-
getAllAccountRecentOrders(...args) {
|
|
5287
|
-
return ExperimentalEndpointsApiFp(this.configuration).getAllAccountRecentOrders(...args).then((request) => request(this.axios, this.basePath));
|
|
5288
|
-
}
|
|
5289
|
-
/**
|
|
5290
5290
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
5291
5291
|
* @summary Get account order detail (V2)
|
|
5292
5292
|
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
|
|
@@ -8667,7 +8667,7 @@ var Configuration = class {
|
|
|
8667
8667
|
if (param.auth.mode === "oauth") this.accessToken = param.auth.accessToken;
|
|
8668
8668
|
this.basePath = param.basePath;
|
|
8669
8669
|
this.baseOptions = param.baseOptions ?? {};
|
|
8670
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/13.2.
|
|
8670
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/13.2.6/typescript" : param.userAgent;
|
|
8671
8671
|
this.formDataCtor = param.formDataCtor;
|
|
8672
8672
|
}
|
|
8673
8673
|
/**
|