SchwabApi.Models 1.0.0-beta.1

This is a prerelease version of SchwabApi.Models.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package SchwabApi.Models --version 1.0.0-beta.1
                    
NuGet\Install-Package SchwabApi.Models -Version 1.0.0-beta.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SchwabApi.Models" Version="1.0.0-beta.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SchwabApi.Models" Version="1.0.0-beta.1" />
                    
Directory.Packages.props
<PackageReference Include="SchwabApi.Models" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SchwabApi.Models --version 1.0.0-beta.1
                    
#r "nuget: SchwabApi.Models, 1.0.0-beta.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SchwabApi.Models@1.0.0-beta.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SchwabApi.Models&version=1.0.0-beta.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SchwabApi.Models&version=1.0.0-beta.1&prerelease
                    
Install as a Cake Tool

SchwabApi.Models

Strongly-typed data models for Charles Schwab Trading API including accounts, market data, trading, and transactions.

Installation

dotnet add package SchwabApi.Models

Or via NuGet Package Manager:

Install-Package SchwabApi.Models

Features

  • 60+ Data Models: Complete coverage of Schwab API response types
  • 30+ Enumerations: Type-safe enums for order types, statuses, asset types, etc.
  • JSON Serialization: Configured for Schwab API naming conventions
  • Nullable Annotations: C# 10 nullable reference types for compile-time safety
  • XML Documentation: IntelliSense-friendly documentation for all public types

Usage

Models are automatically deserialized when using SchwabApi.Client:

using SchwabApi.Models.Accounts;
using SchwabApi.Client;

var client = serviceProvider.GetRequiredService<ISchwabApiClient>();

// Get account information
var account = await client.GetAsync<AccountResponse>("/trader/v1/accounts/12345678");

Console.WriteLine($"Account Value: ${account.SecuritiesAccount.CurrentBalances.LiquidationValue:N2}");

Model Categories

Accounts (SchwabApi.Models.Accounts)

  • AccountResponse - Account details with positions and balances
  • Position - Equity/option position data
  • Balance - Account balance information

Market Data (SchwabApi.Models.MarketData)

  • Quote - Real-time quote data
  • Candle - OHLCV price history
  • OptionChain - Option chain data
  • MoverResponse - Market movers

Trading (SchwabApi.Models.Trading)

  • OrderRequest - Order placement/modification
  • OrderResponse - Order status and details
  • OrderLeg - Multi-leg order components

Transactions (SchwabApi.Models.Transactions)

  • TransactionResponse - Account transaction history

Enums (SchwabApi.Models.Enums)

  • OrderType: MARKET, LIMIT, STOP, STOP_LIMIT
  • OrderStatus: PENDING, FILLED, CANCELED, REJECTED
  • AssetType: EQUITY, OPTION, MUTUAL_FUND
  • Instruction: BUY, SELL, BUY_TO_OPEN, SELL_TO_CLOSE

JSON Serialization

Models use custom SchwabJsonSerializerOptions for API compatibility:

using SchwabApi.Models;
using System.Text.Json;

var options = SchwabJsonSerializerOptions.Default;
var json = JsonSerializer.Serialize(order, options);

Documentation

License

MIT License - see LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated