snaptrade 3.0.56 → 3.0.58

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.
@@ -239,406 +239,6 @@ module SnapTrade
239
239
  end
240
240
 
241
241
 
242
- # Get account order detail
243
- #
244
- # 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`.
245
- #
246
- # 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.
247
- #
248
- # 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.
249
- #
250
- # This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
251
- #
252
- # **Experimental:** this endpoint may change without notice.
253
- #
254
- # @param account_id [String]
255
- # @param brokerage_order_id [String]
256
- # @param user_id [String]
257
- # @param user_secret [String]
258
- # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
259
- def get_account_order(account_id:, brokerage_order_id:, user_id:, user_secret:, extra: {})
260
- data, _status_code, _headers = get_account_order_with_http_info_impl(account_id, brokerage_order_id, user_id, user_secret, extra)
261
- data
262
- end
263
-
264
- # Get account order detail
265
- #
266
- # 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`.
267
- #
268
- # 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.
269
- #
270
- # 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.
271
- #
272
- # This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
273
- #
274
- # **Experimental:** this endpoint may change without notice.
275
- #
276
- # @param account_id [String]
277
- # @param brokerage_order_id [String]
278
- # @param user_id [String]
279
- # @param user_secret [String]
280
- # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
281
- def get_account_order_with_http_info(account_id:, brokerage_order_id:, user_id:, user_secret:, extra: {})
282
- get_account_order_with_http_info_impl(account_id, brokerage_order_id, user_id, user_secret, extra)
283
- end
284
-
285
- # Get account order detail
286
- # 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.
287
- # @param account_id [String]
288
- # @param brokerage_order_id [String]
289
- # @param user_id [String]
290
- # @param user_secret [String]
291
- # @param [Hash] opts the optional parameters
292
- # @return [AccountOrder]
293
- private def get_account_order_impl(account_id, brokerage_order_id, user_id, user_secret, opts = {})
294
- data, _status_code, _headers = get_account_order_with_http_info(account_id, brokerage_order_id, user_id, user_secret, opts)
295
- data
296
- end
297
-
298
- # Get account order detail
299
- # 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.
300
- # @param account_id [String]
301
- # @param brokerage_order_id [String]
302
- # @param user_id [String]
303
- # @param user_secret [String]
304
- # @param [Hash] opts the optional parameters
305
- # @return [Array<(AccountOrder, Integer, Hash)>] AccountOrder data, response status code and response headers
306
- private def get_account_order_with_http_info_impl(account_id, brokerage_order_id, user_id, user_secret, opts = {})
307
- if @api_client.config.debugging
308
- @api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.get_account_order ...'
309
- end
310
- # verify the required parameter 'account_id' is set
311
- if @api_client.config.client_side_validation && account_id.nil?
312
- fail ArgumentError, "Missing the required parameter 'account_id' when calling ExperimentalEndpointsApi.get_account_order"
313
- end
314
- # verify the required parameter 'brokerage_order_id' is set
315
- if @api_client.config.client_side_validation && brokerage_order_id.nil?
316
- fail ArgumentError, "Missing the required parameter 'brokerage_order_id' when calling ExperimentalEndpointsApi.get_account_order"
317
- end
318
- # verify the required parameter 'user_id' is set
319
- if @api_client.config.client_side_validation && user_id.nil?
320
- fail ArgumentError, "Missing the required parameter 'user_id' when calling ExperimentalEndpointsApi.get_account_order"
321
- end
322
- # verify the required parameter 'user_secret' is set
323
- if @api_client.config.client_side_validation && user_secret.nil?
324
- fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.get_account_order"
325
- end
326
- # resource path
327
- local_var_path = '/accounts/{accountId}/orders/{brokerageOrderId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'brokerageOrderId' + '}', CGI.escape(brokerage_order_id.to_s))
328
-
329
- # query parameters
330
- query_params = opts[:query_params] || {}
331
- query_params[:'userId'] = user_id
332
- query_params[:'userSecret'] = user_secret
333
-
334
- # header parameters
335
- header_params = opts[:header_params] || {}
336
- # HTTP header 'Accept' (if needed)
337
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
338
-
339
- # form parameters
340
- form_params = opts[:form_params] || {}
341
-
342
- # http body (model)
343
- post_body = opts[:debug_body]
344
-
345
- # return_type
346
- return_type = opts[:debug_return_type] || 'AccountOrder'
347
-
348
- # auth_names
349
- auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
350
-
351
- new_options = opts.merge(
352
- :operation => :"ExperimentalEndpointsApi.get_account_order",
353
- :header_params => header_params,
354
- :query_params => query_params,
355
- :form_params => form_params,
356
- :body => post_body,
357
- :auth_names => auth_names,
358
- :return_type => return_type
359
- )
360
-
361
- data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
362
- if @api_client.config.debugging
363
- @api_client.config.logger.debug "API called: ExperimentalEndpointsApi#get_account_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
364
- end
365
- return data, status_code, headers, response
366
- end
367
-
368
-
369
- # List all account orders
370
- #
371
- # Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`.
372
- #
373
- # 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`.
374
- #
375
- # `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`.
376
- #
377
- # **Experimental:** this endpoint may change without notice.
378
- #
379
- # 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.
380
- #
381
- # @param user_id [String]
382
- # @param user_secret [String]
383
- # @param account_id [String]
384
- # @param state [String] defaults to \"all\"
385
- # @param days [Integer] 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.
386
- # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
387
- def get_all_account_orders(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {})
388
- extra[:state] = state if state != SENTINEL
389
- extra[:days] = days if days != SENTINEL
390
- data, _status_code, _headers = get_all_account_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
391
- data
392
- end
393
-
394
- # List all account orders
395
- #
396
- # Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`.
397
- #
398
- # 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`.
399
- #
400
- # `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`.
401
- #
402
- # **Experimental:** this endpoint may change without notice.
403
- #
404
- # 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.
405
- #
406
- # @param user_id [String]
407
- # @param user_secret [String]
408
- # @param account_id [String]
409
- # @param state [String] defaults to \"all\"
410
- # @param days [Integer] 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.
411
- # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
412
- def get_all_account_orders_with_http_info(user_id:, user_secret:, account_id:, state: SENTINEL, days: SENTINEL, extra: {})
413
- extra[:state] = state if state != SENTINEL
414
- extra[:days] = days if days != SENTINEL
415
- get_all_account_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
416
- end
417
-
418
- # List all account orders
419
- # 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.
420
- # @param user_id [String]
421
- # @param user_secret [String]
422
- # @param account_id [String]
423
- # @param [Hash] opts the optional parameters
424
- # @option opts [String] :state defaults to \"all\"
425
- # @option opts [Integer] :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.
426
- # @return [AllAccountOrdersResponse]
427
- private def get_all_account_orders_impl(user_id, user_secret, account_id, opts = {})
428
- data, _status_code, _headers = get_all_account_orders_with_http_info(user_id, user_secret, account_id, opts)
429
- data
430
- end
431
-
432
- # List all account orders
433
- # Returns a list of recent orders in the specified account, in the same &#x60;kind&#x60;-discriminated format as &#x60;/accounts/{accountId}/positions/all&#x60;. Every order carries a &#x60;legs&#x60; list with at least one leg. Each leg&#39;s &#x60;instrument&#x60; uses the same &#x60;Instrument&#x60; union as positions; switch on &#x60;instrument.kind&#x60; 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 &#x60;group.id&#x60;. &#x60;order_type&#x60; is an object discriminated by &#x60;kind&#x60;. Each kind declares the price fields it requires (&#x60;limit_price&#x60; on &#x60;limit&#x60;, &#x60;stop_price&#x60; on &#x60;stop&#x60;, both on &#x60;stop_limit&#x60;, &#x60;trail&#x60; on &#x60;trailing_stop&#x60;), 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, &#x60;kind&#x60; is &#x60;other&#x60; and the brokerage&#39;s own label is in &#x60;raw_type&#x60;. **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.
434
- # @param user_id [String]
435
- # @param user_secret [String]
436
- # @param account_id [String]
437
- # @param [Hash] opts the optional parameters
438
- # @option opts [String] :state defaults to \"all\"
439
- # @option opts [Integer] :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.
440
- # @return [Array<(AllAccountOrdersResponse, Integer, Hash)>] AllAccountOrdersResponse data, response status code and response headers
441
- private def get_all_account_orders_with_http_info_impl(user_id, user_secret, account_id, opts = {})
442
- if @api_client.config.debugging
443
- @api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.get_all_account_orders ...'
444
- end
445
- # verify the required parameter 'user_id' is set
446
- if @api_client.config.client_side_validation && user_id.nil?
447
- fail ArgumentError, "Missing the required parameter 'user_id' when calling ExperimentalEndpointsApi.get_all_account_orders"
448
- end
449
- # verify the required parameter 'user_secret' is set
450
- if @api_client.config.client_side_validation && user_secret.nil?
451
- fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.get_all_account_orders"
452
- end
453
- # verify the required parameter 'account_id' is set
454
- if @api_client.config.client_side_validation && account_id.nil?
455
- fail ArgumentError, "Missing the required parameter 'account_id' when calling ExperimentalEndpointsApi.get_all_account_orders"
456
- end
457
- allowable_values = ["all", "open", "executed"]
458
- if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
459
- fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
460
- end
461
- if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] > 90
462
- fail ArgumentError, 'invalid value for "opts[:"days"]" when calling ExperimentalEndpointsApi.get_all_account_orders, must be smaller than or equal to 90.'
463
- end
464
-
465
- if @api_client.config.client_side_validation && !opts[:'days'].nil? && opts[:'days'] < 1
466
- fail ArgumentError, 'invalid value for "opts[:"days"]" when calling ExperimentalEndpointsApi.get_all_account_orders, must be greater than or equal to 1.'
467
- end
468
-
469
- # resource path
470
- local_var_path = '/accounts/{accountId}/orders/all'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
471
-
472
- # query parameters
473
- query_params = opts[:query_params] || {}
474
- query_params[:'userId'] = user_id
475
- query_params[:'userSecret'] = user_secret
476
- query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
477
- query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
478
-
479
- # header parameters
480
- header_params = opts[:header_params] || {}
481
- # HTTP header 'Accept' (if needed)
482
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
483
-
484
- # form parameters
485
- form_params = opts[:form_params] || {}
486
-
487
- # http body (model)
488
- post_body = opts[:debug_body]
489
-
490
- # return_type
491
- return_type = opts[:debug_return_type] || 'AllAccountOrdersResponse'
492
-
493
- # auth_names
494
- auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
495
-
496
- new_options = opts.merge(
497
- :operation => :"ExperimentalEndpointsApi.get_all_account_orders",
498
- :header_params => header_params,
499
- :query_params => query_params,
500
- :form_params => form_params,
501
- :body => post_body,
502
- :auth_names => auth_names,
503
- :return_type => return_type
504
- )
505
-
506
- data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
507
- if @api_client.config.debugging
508
- @api_client.config.logger.debug "API called: ExperimentalEndpointsApi#get_all_account_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
509
- end
510
- return data, status_code, headers, response
511
- end
512
-
513
-
514
- # List all account recent orders (last 24 hours only)
515
- #
516
- # 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.
517
- # 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.
518
- # 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.
519
- # By default only returns executed orders, but that can be changed by setting *only_executed* to false.
520
- #
521
- # 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.
522
- #
523
- # **Experimental:** this endpoint may change without notice.
524
- #
525
- # **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)**
526
- #
527
- # @param user_id [String]
528
- # @param user_secret [String]
529
- # @param account_id [String]
530
- # @param only_executed [Boolean] Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
531
- # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
532
- def get_all_account_recent_orders(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {})
533
- extra[:only_executed] = only_executed if only_executed != SENTINEL
534
- data, _status_code, _headers = get_all_account_recent_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
535
- data
536
- end
537
-
538
- # List all account recent orders (last 24 hours only)
539
- #
540
- # 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.
541
- # 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.
542
- # 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.
543
- # By default only returns executed orders, but that can be changed by setting *only_executed* to false.
544
- #
545
- # 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.
546
- #
547
- # **Experimental:** this endpoint may change without notice.
548
- #
549
- # **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)**
550
- #
551
- # @param user_id [String]
552
- # @param user_secret [String]
553
- # @param account_id [String]
554
- # @param only_executed [Boolean] Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
555
- # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
556
- def get_all_account_recent_orders_with_http_info(user_id:, user_secret:, account_id:, only_executed: SENTINEL, extra: {})
557
- extra[:only_executed] = only_executed if only_executed != SENTINEL
558
- get_all_account_recent_orders_with_http_info_impl(user_id, user_secret, account_id, extra)
559
- end
560
-
561
- # List all account recent orders (last 24 hours only)
562
- # 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)**
563
- # @param user_id [String]
564
- # @param user_secret [String]
565
- # @param account_id [String]
566
- # @param [Hash] opts the optional parameters
567
- # @option opts [Boolean] :only_executed Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
568
- # @return [AllAccountOrdersResponse]
569
- private def get_all_account_recent_orders_impl(user_id, user_secret, account_id, opts = {})
570
- data, _status_code, _headers = get_all_account_recent_orders_with_http_info(user_id, user_secret, account_id, opts)
571
- data
572
- end
573
-
574
- # List all account recent orders (last 24 hours only)
575
- # A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same &#x60;kind&#x60;-discriminated format as &#x60;/accounts/{accountId}/orders/all&#x60;. 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 &#x60;/accounts/{accountId}/orders/all&#x60; 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 &#x60;legs&#x60; list with at least one leg; switch on &#x60;legs[].instrument.kind&#x60; and &#x60;order_type.kind&#x60; to know which fields are present. &#x60;data_freshness.as_of&#x60; 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)**
576
- # @param user_id [String]
577
- # @param user_secret [String]
578
- # @param account_id [String]
579
- # @param [Hash] opts the optional parameters
580
- # @option opts [Boolean] :only_executed Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
581
- # @return [Array<(AllAccountOrdersResponse, Integer, Hash)>] AllAccountOrdersResponse data, response status code and response headers
582
- private def get_all_account_recent_orders_with_http_info_impl(user_id, user_secret, account_id, opts = {})
583
- if @api_client.config.debugging
584
- @api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.get_all_account_recent_orders ...'
585
- end
586
- # verify the required parameter 'user_id' is set
587
- if @api_client.config.client_side_validation && user_id.nil?
588
- fail ArgumentError, "Missing the required parameter 'user_id' when calling ExperimentalEndpointsApi.get_all_account_recent_orders"
589
- end
590
- # verify the required parameter 'user_secret' is set
591
- if @api_client.config.client_side_validation && user_secret.nil?
592
- fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.get_all_account_recent_orders"
593
- end
594
- # verify the required parameter 'account_id' is set
595
- if @api_client.config.client_side_validation && account_id.nil?
596
- fail ArgumentError, "Missing the required parameter 'account_id' when calling ExperimentalEndpointsApi.get_all_account_recent_orders"
597
- end
598
- # resource path
599
- local_var_path = '/accounts/{accountId}/orders/recent'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
600
-
601
- # query parameters
602
- query_params = opts[:query_params] || {}
603
- query_params[:'userId'] = user_id
604
- query_params[:'userSecret'] = user_secret
605
- query_params[:'only_executed'] = opts[:'only_executed'] if !opts[:'only_executed'].nil?
606
-
607
- # header parameters
608
- header_params = opts[:header_params] || {}
609
- # HTTP header 'Accept' (if needed)
610
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
611
-
612
- # form parameters
613
- form_params = opts[:form_params] || {}
614
-
615
- # http body (model)
616
- post_body = opts[:debug_body]
617
-
618
- # return_type
619
- return_type = opts[:debug_return_type] || 'AllAccountOrdersResponse'
620
-
621
- # auth_names
622
- auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
623
-
624
- new_options = opts.merge(
625
- :operation => :"ExperimentalEndpointsApi.get_all_account_recent_orders",
626
- :header_params => header_params,
627
- :query_params => query_params,
628
- :form_params => form_params,
629
- :body => post_body,
630
- :auth_names => auth_names,
631
- :return_type => return_type
632
- )
633
-
634
- data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
635
- if @api_client.config.debugging
636
- @api_client.config.logger.debug "API called: ExperimentalEndpointsApi#get_all_account_recent_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
637
- end
638
- return data, status_code, headers, response
639
- end
640
-
641
-
642
242
  # Get account order detail (V2)
643
243
  #
644
244
  # Returns the detail of a single order using the brokerage order ID provided as a path parameter.
@@ -50,7 +50,7 @@ module SnapTrade
50
50
  # The account type as provided by the brokerage
51
51
  attr_accessor :raw_type
52
52
 
53
- # The category of the account, normalized across institutions. Returns `null` if the category could not be determined. Use this field to filter out non-investment accounts if your integration only supports trading / holdings flows. See [Filtering Accounts by Category](https://docs.snaptrade.com/docs/filtering-accounts-by-category) for more information. - `INVESTMENT`: A brokerage / investment account (equities, options, crypto, etc.). - `DEPOSIT`: A bank deposit account (checking, savings). - `LOC`: A line of credit account. - `ANNUITY`: An annuity contract account.
53
+ # The category of the account, normalized across institutions. Returns `null` if the category could not be determined. Use this field to filter out non-investment accounts if your integration only supports trading / holdings flows. See [Filtering Accounts by Category](https://docs.snaptrade.com/docs/filtering-accounts-by-category) for more information. - `INVESTMENT`: A brokerage / investment account (equities, options, crypto, etc.). - `DEPOSIT`: A bank deposit account (checking, savings). - `LOC`: A line of credit account. - `ANNUITY`: An annuity contract account. - `MORTGAGE`: A mortgage account.
54
54
  attr_accessor :account_category
55
55
 
56
56
  # Additional information about the account, such as account type, status, etc. This information is specific to the brokerage and there's no standard format for this data. This field is deprecated and subject to removal in a future version.
@@ -16,9 +16,10 @@ module SnapTrade
16
16
  DEPOSIT = "DEPOSIT".freeze
17
17
  LOC = "LOC".freeze
18
18
  ANNUITY = "ANNUITY".freeze
19
+ MORTGAGE = "MORTGAGE".freeze
19
20
 
20
21
  def self.all_vars
21
- @all_vars ||= [INVESTMENT, DEPOSIT, LOC, ANNUITY].freeze
22
+ @all_vars ||= [INVESTMENT, DEPOSIT, LOC, ANNUITY, MORTGAGE].freeze
22
23
  end
23
24
 
24
25
  # Builds the enum from string
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # An annuity contract account under a connection. Akoya accounts returned in the `annuityAccount` category use this kind; investment accounts holding annuity products remain `investment` accounts. `net_value` is the contract's surrender/cash value (`netPresentValue` from Akoya), not available cash. It is real-time or cached depending on the caller's plan, and always cached on `AccountInformation_listAllUserAccounts`.
14
+ # An annuity contract account under a connection. Investment accounts holding annuity products remain `investment` accounts. `net_value` is the contract's surrender/cash value, not available cash. It is real-time or cached depending on the caller's plan, and always cached on `AccountInformation_listAllUserAccounts`.
15
15
  class AnnuityAccount
16
16
  # Discriminator for the account kind.
17
17
  attr_accessor :kind
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Contains sync status for an annuity contract's value. Akoya annuity accounts do not expose transactions, orders, or positions, so those fields are omitted. `balances` is derived from the last successful holdings sync and is null if never synced. It tracks the contract value, not available cash.
14
+ # Contains sync status for an annuity contract's value. Transactions, orders, and positions are omitted. `balances` is derived from the last successful holdings sync and is null if never synced. It tracks the contract value, not available cash.
15
15
  class AnnuityAccountSyncStatus
16
16
  # The last time the annuity contract value was successfully synced by SnapTrade.
17
17
  attr_accessor :balances
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # A single account under a connection, from the `kind`-discriminated union used by `Connections_listConnectionAccounts` and `AccountInformation_listAllUserAccounts`. Use `kind` to determine which schema is present. `investment`, `deposit`, `line_of_credit`, and `annuity` are implemented today.
14
+ # A single account under a connection, from the `kind`-discriminated union used by `Connections_listConnectionAccounts` and `AccountInformation_listAllUserAccounts`. Use `kind` to determine which schema is present. `investment`, `deposit`, `line_of_credit`, `annuity`, and `mortgage` are implemented today.
15
15
  module ConnectionAccount
16
16
  class << self
17
17
  # List of class defined in oneOf (OpenAPI v3)
@@ -20,7 +20,8 @@ module SnapTrade
20
20
  :'AnnuityAccount',
21
21
  :'DepositAccount',
22
22
  :'InvestmentAccount',
23
- :'LineOfCreditAccount'
23
+ :'LineOfCreditAccount',
24
+ :'MortgageAccount'
24
25
  ]
25
26
  end
26
27
 
@@ -35,7 +36,8 @@ module SnapTrade
35
36
  :'annuity' => :'AnnuityAccount',
36
37
  :'deposit' => :'DepositAccount',
37
38
  :'investment' => :'InvestmentAccount',
38
- :'line_of_credit' => :'LineOfCreditAccount'
39
+ :'line_of_credit' => :'LineOfCreditAccount',
40
+ :'mortgage' => :'MortgageAccount'
39
41
  }
40
42
  end
41
43