Files
Dmitry bfe74ca47c chore(app): перегенерировать Dart-клиент
Портфели, создание счетов, ручные события, PATCH инструмента, ScopeCardOut, MetricsStatusOut, логотипы в HoldingOut.
2026-09-19 22:14:07 +03:00

9.5 KiB

fintracker_api.api.InstrumentsApi

Load the API package

import 'package:fintracker_api/api.dart';

All URIs are relative to http://localhost

Method HTTP request Description
instrumentsGet GET /api/v1/instruments/{instrument_id} Get
instrumentsList GET /api/v1/instruments List
instrumentsPatch PATCH /api/v1/instruments/{instrument_id} Patch
instrumentsPending GET /api/v1/instruments/pending Pending
instrumentsPendingResolve POST /api/v1/instruments/pending/{pending_id}/resolve Pending Resolve
instrumentsSetManualPrice POST /api/v1/instruments/{instrument_id}/prices Set Manual Price

instrumentsGet

InstrumentDetail instrumentsGet(instrumentId, scope, pricesFrom)

Get

One instrument with its position, open lots, events and price history.

Example

import 'package:fintracker_api/api.dart';

final api = FintrackerApi().getInstrumentsApi();
final int instrumentId = 56; // int | 
final String scope = scope_example; // String | all | account:<id> | portfolio:<id>
final DateTime pricesFrom = 2013-10-20; // DateTime | 

try {
    final response = api.instrumentsGet(instrumentId, scope, pricesFrom);
    print(response);
} on DioException catch (e) {
    print('Exception when calling InstrumentsApi->instrumentsGet: $e\n');
}

Parameters

Name Type Description Notes
instrumentId int
scope String all account:
pricesFrom DateTime [optional]

Return type

InstrumentDetail

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

instrumentsList

List instrumentsList(q, assetClass, heldOnly, limit)

List

Example

import 'package:fintracker_api/api.dart';

final api = FintrackerApi().getInstrumentsApi();
final String q = q_example; // String | substring of ticker, name or ISIN
final String assetClass = assetClass_example; // String | share | bond | etf | fund | currency | index | …
final bool heldOnly = true; // bool | only instruments with an open lot
final int limit = 56; // int | 

try {
    final response = api.instrumentsList(q, assetClass, heldOnly, limit);
    print(response);
} on DioException catch (e) {
    print('Exception when calling InstrumentsApi->instrumentsList: $e\n');
}

Parameters

Name Type Description Notes
q String substring of ticker, name or ISIN [optional]
assetClass String share bond
heldOnly bool only instruments with an open lot [optional] [default to false]
limit int [optional] [default to 100]

Return type

List<InstrumentOut>

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

instrumentsPatch

InstrumentOut instrumentsPatch(instrumentId, instrumentPatch)

Patch

Correct an instrument by hand: name, board, lot, asset class, sector. The lot only rounds the quantities the rebalancing suggests; the asset class decides the bucket it lands in. Neither is refreshed here — call POST /metrics/refresh after, same as /rules/apply.

Example

import 'package:fintracker_api/api.dart';

final api = FintrackerApi().getInstrumentsApi();
final int instrumentId = 56; // int | 
final InstrumentPatch instrumentPatch = ; // InstrumentPatch | 

try {
    final response = api.instrumentsPatch(instrumentId, instrumentPatch);
    print(response);
} on DioException catch (e) {
    print('Exception when calling InstrumentsApi->instrumentsPatch: $e\n');
}

Parameters

Name Type Description Notes
instrumentId int
instrumentPatch InstrumentPatch

Return type

InstrumentOut

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

instrumentsPending

List instrumentsPending(status, limit, offset)

Pending

Instruments a report named that nothing in the master resolves to.

Example

import 'package:fintracker_api/api.dart';

final api = FintrackerApi().getInstrumentsApi();
final String status = status_example; // String | pending | resolved | ignored | all
final int limit = 56; // int | 
final int offset = 56; // int | 

try {
    final response = api.instrumentsPending(status, limit, offset);
    print(response);
} on DioException catch (e) {
    print('Exception when calling InstrumentsApi->instrumentsPending: $e\n');
}

Parameters

Name Type Description Notes
status String pending resolved
limit int [optional] [default to 100]
offset int [optional] [default to 0]

Return type

List<PendingInstrumentOut>

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

instrumentsPendingResolve

PendingResolveResult instrumentsPendingResolve(pendingId, pendingResolveRequest)

Pending Resolve

Link, create or ignore — then bind the events that were waiting and rebuild the lots.

Example

import 'package:fintracker_api/api.dart';

final api = FintrackerApi().getInstrumentsApi();
final int pendingId = 56; // int | 
final PendingResolveRequest pendingResolveRequest = ; // PendingResolveRequest | 

try {
    final response = api.instrumentsPendingResolve(pendingId, pendingResolveRequest);
    print(response);
} on DioException catch (e) {
    print('Exception when calling InstrumentsApi->instrumentsPendingResolve: $e\n');
}

Parameters

Name Type Description Notes
pendingId int
pendingResolveRequest PendingResolveRequest

Return type

PendingResolveResult

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

instrumentsSetManualPrice

PriceManualOut instrumentsSetManualPrice(instrumentId, priceManualIn)

Set Manual Price

Set (or replace) the manual price of instrument_id on body.d. For what no exchange quotes: real estate, crypto, a custom holding, an OTC bond nobody lists. One row per (instrument, day) — a second call for the same day replaces it rather than piling up duplicates the price series would then have to pick between. Does not itself refresh metric_*; call POST /metrics/refresh after, same as /rules/apply.

Example

import 'package:fintracker_api/api.dart';

final api = FintrackerApi().getInstrumentsApi();
final int instrumentId = 56; // int | 
final PriceManualIn priceManualIn = ; // PriceManualIn | 

try {
    final response = api.instrumentsSetManualPrice(instrumentId, priceManualIn);
    print(response);
} on DioException catch (e) {
    print('Exception when calling InstrumentsApi->instrumentsSetManualPrice: $e\n');
}

Parameters

Name Type Description Notes
instrumentId int
priceManualIn PriceManualIn

Return type

PriceManualOut

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]