PolarNet 1.1.1
See the version list below for details.
dotnet add package PolarNet --version 1.1.1
NuGet\Install-Package PolarNet -Version 1.1.1
<PackageReference Include="PolarNet" Version="1.1.1" />
<PackageVersion Include="PolarNet" Version="1.1.1" />
<PackageReference Include="PolarNet" />
paket add PolarNet --version 1.1.1
#r "nuget: PolarNet, 1.1.1"
#:package PolarNet@1.1.1
#addin nuget:?package=PolarNet&version=1.1.1
#tool nuget:?package=PolarNet&version=1.1.1
PolarNet
Thin C# client library for Polar API with samples (console + ASP.NET webhook).
Supported frameworks: netstandard2.0, netstandard2.1, .NET 8, .NET 9
Project structure
polar.net/
├── src/ # Class library (packable)
│ ├── Models/ # Typed API models (split per class)
│ ├── Services/ # Low-level HTTP service
│ ├── PolarClient.cs # Public client facade
│ ├── PolarClientOptions.cs # Client options
│ └── polar.net.csproj
├── samples/
│ ├── polar.sample/ # Console app demonstrating API calls
│ └── polar.webhook/ # ASP.NET webhook receiver sample
├── tests/ # xUnit tests
└── README.md
Quick start
- Clone & restore
git clone https://github.com/lisa3907/polar.net.git
cd polar.net
dotnet restore
- Build the solution
dotnet build -c Debug
- Run the console sample (dotnet run uses the sample project)
cd samples/polar.sample
dotnet run
Notes:
- The samples read configuration from
appsettings.json(no code edits required). Set your values in:samples/polar.sample/appsettings.jsonsamples/polar.webhook/appsettings.json
- Start the ASP.NET webhook sample from
samples/polar.webhookwithdotnet run.
Minimal config used by samples/tests:
{
"PolarSettings": {
"UseSandbox": true,
"SandboxApiUrl": "https://sandbox-api.polar.sh",
"ProductionApiUrl": "https://api.polar.sh",
"AccessToken": "<SANDBOX_OAT>",
"OrganizationId": "<ORG_ID>",
"ProductId": "<PRODUCT_ID>",
"PriceId": "<PRICE_ID>"
}
}
Using the library (programmatic)
Add a project reference to src/polar.net.csproj (already wired for samples), then:
var client = new PolarNet.PolarClient(new PolarNet.PolarClientOptions
{
AccessToken = "<SANDBOX_OAT>",
BaseUrl = "https://sandbox-api.polar.sh", // no trailing slash
OrganizationId = "<ORG_ID>",
DefaultProductId = "<PRODUCT_ID>",
DefaultPriceId = "<PRICE_ID>"
});
var org = await client.GetOrganizationAsync();
Implemented endpoints (current)
- Organization: GET
/v1/organizations/{organization_id} - Products: GET
/v1/products?organization_id={org}· GET/v1/products/{id} - Prices: GET
/v1/prices?organization_id={org}[&product_id={pid}]· GET/v1/prices/{id} - Customers: POST
/v1/customers· GET/v1/customers?organization_id={org}· GET/v1/customers/{id}· GET/v1/customers/{id}/state - Subscriptions: POST
/v1/subscriptions· GET/v1/subscriptions?organization_id={org}· GET/v1/subscriptions/{id}· DELETE/v1/subscriptions/{id} - Checkouts (custom): POST
/v1/checkouts/custom· GET/v1/checkouts/custom/{id} - Orders: GET
/v1/orders?organization_id={org}· GET/v1/orders/{id} - Benefits: GET
/v1/benefits?organization_id={org}
Test card info
Stripe test cards useful in Sandbox when testing paid products:
- Success: 4242 4242 4242 4242
- Failure: 4000 0000 0000 0002
- 3D Secure: 4000 0025 0000 3155
Troubleshooting
- 401 Unauthorized: Verify the token is sandbox, valid scopes, and not expired.
- 404 Not Found: Verify IDs exist in your sandbox.
- 422 Unprocessable Entity: Check request payload and required fields.
Configuration notes
- Authentication uses a Bearer Organization Access Token in the
Authorizationheader. - Set
BaseUrlto the host (sandbox:https://sandbox-api.polar.sh, production:https://api.polar.sh). - Some helper methods use defaults from options (
OrganizationId,DefaultProductId,DefaultPriceId).
License
MIT License — see LICENSE.md
References
- Polar Documentation: https://docs.polar.sh
- Polar Sandbox: https://sandbox.polar.sh
- Polar API Reference: https://docs.polar.sh/api-reference
- Polar: https://polar.sh
👥 Team
Core Development Team
- SEONGAHN - Lead Developer & Project Architect (lisa@odinsoft.co.kr)
- YUJIN - Senior Developer & Exchange Integration Specialist (yoojin@odinsoft.co.kr)
- SEJIN - Software Developer & API Implementation (saejin@odinsoft.co.kr)
📞 Support & Contact
- 🐛 Issues: GitHub Issues
- 📧 Email: help@odinsoft.co.kr
📄 License
MIT License - see LICENSE.md for details.
Built with ❤️ by the ODINSOFT Team | ⭐ Star us on GitHub
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 is compatible. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- System.Net.Http (>= 4.3.4)
-
.NETStandard 2.1
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- System.Net.Http (>= 4.3.4)
-
net8.0
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- System.Net.Http (>= 4.3.4)
-
net9.0
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- System.Net.Http (>= 4.3.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
PolarNet v1.1.1 — 2025-08-23
Highlights
- Change: CreateCheckoutAsync now requires a non-empty successUrl; throws ArgumentException otherwise.
- Refactor: Consolidated PolarClient constructors by delegating to the handler-based overload (removed duplicate init logic).
- Docs: Standardized XML docs across the codebase (converted single-line <summary> to multiline, added explicit docs for PolarWebhookEventHandlerBase and SendAsync, clarified Dispose and pagination params).
- Webhooks/Tests: Added unit tests for signature verification, envelope parsing, and dispatch; improved sample webhook with in-memory event store and a GET /api/webhook/events endpoint for E2E verification.
Migration Notes
- Pass a valid successUrl when calling CreateCheckoutAsync.
- No other public API changes expected; existing consumers should continue to work.
Targets
- netstandard2.0, netstandard2.1, net8.0, net9.0.
Thank you for using PolarNet!