snaptrade 2.0.123 → 2.0.124
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +39 -2
- data/lib/snaptrade/api/account_information_api.rb +111 -0
- data/lib/snaptrade/models/account_status.rb +2 -1
- data/lib/snaptrade/version.rb +1 -1
- data/spec/api/account_information_api_spec.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c52a939d269906ab92631ba9806d1d7a9f6fc2b06badd2260018ca5046b9e6f5
|
4
|
+
data.tar.gz: 1d7b5eee9b5ae12d88c244aa086c0c2a7d5e428b3defec7e64a433ded17ffb22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 406fe1174adad1ec1ad3962dae8c0c2098c9fc31ad30adbd6cbd8346a271ebf42f06285b129bd8d4f9283cdc16278125e5317aa245e9c4d36205c0b1ab5e8d3e
|
7
|
+
data.tar.gz: 710d59a5c10de48f22b51b9a36dd2077cdeb5a498c70e2553ae7cd8b012b6a62e2cf27854865479c289001f2dd70c780e182e45d2b5ab834f7ac261bb45e12fc
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
Connect brokerage accounts to your app for live positions and trading
|
8
8
|
|
9
|
-
[](https://rubygems.org/gems/snaptrade/versions/2.0.124)
|
10
10
|
[](https://snaptrade.com/)
|
11
11
|
|
12
12
|
</div>
|
@@ -23,6 +23,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
23
23
|
* [`snaptrade.account_information.get_all_user_holdings`](#snaptradeaccount_informationget_all_user_holdings)
|
24
24
|
* [`snaptrade.account_information.get_user_account_balance`](#snaptradeaccount_informationget_user_account_balance)
|
25
25
|
* [`snaptrade.account_information.get_user_account_details`](#snaptradeaccount_informationget_user_account_details)
|
26
|
+
* [`snaptrade.account_information.get_user_account_order_detail`](#snaptradeaccount_informationget_user_account_order_detail)
|
26
27
|
* [`snaptrade.account_information.get_user_account_orders`](#snaptradeaccount_informationget_user_account_orders)
|
27
28
|
* [`snaptrade.account_information.get_user_account_positions`](#snaptradeaccount_informationget_user_account_positions)
|
28
29
|
* [`snaptrade.account_information.get_user_account_recent_orders`](#snaptradeaccount_informationget_user_account_recent_orders)
|
@@ -83,7 +84,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
83
84
|
Add to Gemfile:
|
84
85
|
|
85
86
|
```ruby
|
86
|
-
gem 'snaptrade', '~> 2.0.
|
87
|
+
gem 'snaptrade', '~> 2.0.124'
|
87
88
|
```
|
88
89
|
|
89
90
|
## Getting Started<a id="getting-started"></a>
|
@@ -320,6 +321,42 @@ p result
|
|
320
321
|
---
|
321
322
|
|
322
323
|
|
324
|
+
### `snaptrade.account_information.get_user_account_order_detail`<a id="snaptradeaccount_informationget_user_account_order_detail"></a>
|
325
|
+
|
326
|
+
Returns the detail of a single order in the specified account. This endpoint is always realtime and does not rely on cached data.
|
327
|
+
|
328
|
+
|
329
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
330
|
+
|
331
|
+
```ruby
|
332
|
+
result = snaptrade.account_information.get_user_account_order_detail(
|
333
|
+
user_id: "snaptrade-user-123",
|
334
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
335
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
336
|
+
brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
337
|
+
)
|
338
|
+
p result
|
339
|
+
```
|
340
|
+
|
341
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
342
|
+
|
343
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
344
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
345
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
346
|
+
##### brokerage_order_id: `String`<a id="brokerage_order_id-string"></a>
|
347
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
348
|
+
|
349
|
+
[AccountOrderRecord](./lib/snaptrade/models/account_order_record.rb)
|
350
|
+
|
351
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
352
|
+
|
353
|
+
`/accounts/{accountId}/orders/{brokerageOrderId}` `GET`
|
354
|
+
|
355
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
356
|
+
|
357
|
+
---
|
358
|
+
|
359
|
+
|
323
360
|
### `snaptrade.account_information.get_user_account_orders`<a id="snaptradeaccount_informationget_user_account_orders"></a>
|
324
361
|
|
325
362
|
Returns a list of recent orders in the specified account.
|
@@ -497,6 +497,117 @@ module SnapTrade
|
|
497
497
|
end
|
498
498
|
|
499
499
|
|
500
|
+
# Get account order detail
|
501
|
+
#
|
502
|
+
# Returns the detail of a single order in the specified account. This endpoint is always realtime and does not rely on cached data.
|
503
|
+
#
|
504
|
+
# @param user_id [String]
|
505
|
+
# @param user_secret [String]
|
506
|
+
# @param account_id [String]
|
507
|
+
# @param brokerage_order_id [String]
|
508
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
509
|
+
def get_user_account_order_detail(user_id:, user_secret:, account_id:, brokerage_order_id:, extra: {})
|
510
|
+
data, _status_code, _headers = get_user_account_order_detail_with_http_info_impl(user_id, user_secret, account_id, brokerage_order_id, extra)
|
511
|
+
data
|
512
|
+
end
|
513
|
+
|
514
|
+
# Get account order detail
|
515
|
+
#
|
516
|
+
# Returns the detail of a single order in the specified account. This endpoint is always realtime and does not rely on cached data.
|
517
|
+
#
|
518
|
+
# @param user_id [String]
|
519
|
+
# @param user_secret [String]
|
520
|
+
# @param account_id [String]
|
521
|
+
# @param brokerage_order_id [String]
|
522
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
523
|
+
def get_user_account_order_detail_with_http_info(user_id:, user_secret:, account_id:, brokerage_order_id:, extra: {})
|
524
|
+
get_user_account_order_detail_with_http_info_impl(user_id, user_secret, account_id, brokerage_order_id, extra)
|
525
|
+
end
|
526
|
+
|
527
|
+
# Get account order detail
|
528
|
+
# Returns the detail of a single order in the specified account. This endpoint is always realtime and does not rely on cached data.
|
529
|
+
# @param user_id [String]
|
530
|
+
# @param user_secret [String]
|
531
|
+
# @param account_id [String]
|
532
|
+
# @param brokerage_order_id [String]
|
533
|
+
# @param [Hash] opts the optional parameters
|
534
|
+
# @return [AccountOrderRecord]
|
535
|
+
private def get_user_account_order_detail_impl(user_id, user_secret, account_id, brokerage_order_id, opts = {})
|
536
|
+
data, _status_code, _headers = get_user_account_order_detail_with_http_info(user_id, user_secret, account_id, brokerage_order_id, opts)
|
537
|
+
data
|
538
|
+
end
|
539
|
+
|
540
|
+
# Get account order detail
|
541
|
+
# Returns the detail of a single order in the specified account. This endpoint is always realtime and does not rely on cached data.
|
542
|
+
# @param user_id [String]
|
543
|
+
# @param user_secret [String]
|
544
|
+
# @param account_id [String]
|
545
|
+
# @param brokerage_order_id [String]
|
546
|
+
# @param [Hash] opts the optional parameters
|
547
|
+
# @return [Array<(AccountOrderRecord, Integer, Hash)>] AccountOrderRecord data, response status code and response headers
|
548
|
+
private def get_user_account_order_detail_with_http_info_impl(user_id, user_secret, account_id, brokerage_order_id, opts = {})
|
549
|
+
if @api_client.config.debugging
|
550
|
+
@api_client.config.logger.debug 'Calling API: AccountInformationApi.get_user_account_order_detail ...'
|
551
|
+
end
|
552
|
+
# verify the required parameter 'user_id' is set
|
553
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
554
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AccountInformationApi.get_user_account_order_detail"
|
555
|
+
end
|
556
|
+
# verify the required parameter 'user_secret' is set
|
557
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
558
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling AccountInformationApi.get_user_account_order_detail"
|
559
|
+
end
|
560
|
+
# verify the required parameter 'account_id' is set
|
561
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
562
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountInformationApi.get_user_account_order_detail"
|
563
|
+
end
|
564
|
+
# verify the required parameter 'brokerage_order_id' is set
|
565
|
+
if @api_client.config.client_side_validation && brokerage_order_id.nil?
|
566
|
+
fail ArgumentError, "Missing the required parameter 'brokerage_order_id' when calling AccountInformationApi.get_user_account_order_detail"
|
567
|
+
end
|
568
|
+
# resource path
|
569
|
+
local_var_path = '/accounts/{accountId}/orders/{brokerageOrderId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'brokerageOrderId' + '}', CGI.escape(brokerage_order_id.to_s))
|
570
|
+
|
571
|
+
# query parameters
|
572
|
+
query_params = opts[:query_params] || {}
|
573
|
+
query_params[:'userId'] = user_id
|
574
|
+
query_params[:'userSecret'] = user_secret
|
575
|
+
|
576
|
+
# header parameters
|
577
|
+
header_params = opts[:header_params] || {}
|
578
|
+
# HTTP header 'Accept' (if needed)
|
579
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
580
|
+
|
581
|
+
# form parameters
|
582
|
+
form_params = opts[:form_params] || {}
|
583
|
+
|
584
|
+
# http body (model)
|
585
|
+
post_body = opts[:debug_body]
|
586
|
+
|
587
|
+
# return_type
|
588
|
+
return_type = opts[:debug_return_type] || 'AccountOrderRecord'
|
589
|
+
|
590
|
+
# auth_names
|
591
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
592
|
+
|
593
|
+
new_options = opts.merge(
|
594
|
+
:operation => :"AccountInformationApi.get_user_account_order_detail",
|
595
|
+
:header_params => header_params,
|
596
|
+
:query_params => query_params,
|
597
|
+
:form_params => form_params,
|
598
|
+
:body => post_body,
|
599
|
+
:auth_names => auth_names,
|
600
|
+
:return_type => return_type
|
601
|
+
)
|
602
|
+
|
603
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
604
|
+
if @api_client.config.debugging
|
605
|
+
@api_client.config.logger.debug "API called: AccountInformationApi#get_user_account_order_detail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
606
|
+
end
|
607
|
+
return data, status_code, headers, response
|
608
|
+
end
|
609
|
+
|
610
|
+
|
500
611
|
# List account orders
|
501
612
|
#
|
502
613
|
# Returns a list of recent orders in the specified account.
|
@@ -15,9 +15,10 @@ module SnapTrade
|
|
15
15
|
OPEN = "open".freeze
|
16
16
|
CLOSED = "closed".freeze
|
17
17
|
ARCHIVED = "archived".freeze
|
18
|
+
UNAVAILABLE = "unavailable".freeze
|
18
19
|
|
19
20
|
def self.all_vars
|
20
|
-
@all_vars ||= [OPEN, CLOSED, ARCHIVED].freeze
|
21
|
+
@all_vars ||= [OPEN, CLOSED, ARCHIVED, UNAVAILABLE].freeze
|
21
22
|
end
|
22
23
|
|
23
24
|
# Builds the enum from string
|
data/lib/snaptrade/version.rb
CHANGED
@@ -88,6 +88,21 @@ describe 'AccountInformationApi' do
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
|
+
# unit tests for get_user_account_order_detail
|
92
|
+
# Get account order detail
|
93
|
+
# Returns the detail of a single order in the specified account. This endpoint is always realtime and does not rely on cached data.
|
94
|
+
# @param user_id
|
95
|
+
# @param user_secret
|
96
|
+
# @param account_id
|
97
|
+
# @param brokerage_order_id
|
98
|
+
# @param [Hash] opts the optional parameters
|
99
|
+
# @return [AccountOrderRecord]
|
100
|
+
describe 'get_user_account_order_detail test' do
|
101
|
+
it 'should work' do
|
102
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
91
106
|
# unit tests for get_user_account_orders
|
92
107
|
# List account orders
|
93
108
|
# Returns a list of recent orders in the specified account. The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snaptrade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.124
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SnapTrade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|