Skip to content
Back to skills

Polar Knowledge Patch

BSecurity

Polar

  • 25 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 5, 2026
developmentpythonapi

Works with

  • cli
  • api
  • mcp

Security analysis

B88/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 7 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill polar-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Polar Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Polar Knowledge Patch
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-polar-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-polar-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: polar-knowledge-patch
description: Polar
version: null
license: MIT
metadata:
  author: Nevaberry
---


# Polar

Use this skill when implementing Polar clients, authentication, checkout,
subscriptions, benefits, customer self-service, usage metering, or integrations.

## Reference index

| Reference | Topics |
| --- | --- |
| [Catalog, Pricing, and Checkout](references/catalog-pricing-and-checkout.md) | Product variants, currencies, ad-hoc prices, taxes, payment methods, embedding, return URLs, attribution, discounts, trial abuse, WebMCP |
| [Clients, Authentication, and Operations](references/clients-auth-and-operations.md) | Preview SDKs, Customer Portal tokens, pagination, quotas, OAuth2, SSO, verified domains, chat and MCP, agent account handoff, Zapier |
| [Customers, Billing, and Self-Service](references/customers-billing-and-self-service.md) | External IDs, credit balances, refunds, invoices, portal privacy, customer emails, DNS validation, payouts, Stripe migration |
| [Events, Meters, and Metrics](references/events-meters-and-metrics.md) | Event hierarchy, deduplication, member usage, costs, system events, meter units and lifecycle, webhooks, revenue metrics |
| [Subscriptions, Members, and Benefits](references/subscriptions-members-and-benefits.md) | Customer State, billing intervals, direct creation, pricing migration, scheduled changes, pauses, members, ownership, seats, feature flags, licenses, revocation |

## Breaking changes, deprecations, and changed defaults

### Checkout product fields and interval ownership

Offer monthly and yearly plans as separate products with their own prices and
benefits. Pass both IDs when creating a Checkout Session so buyers can choose one:

```json
{"products":["<monthly-product-id>","<yearly-product-id>"]}
```

This replaces the deprecated `product_id` and `product_price_id` fields.
Existing products with mixed intervals still work, but pricing edits show a warning.
Read `recurring_interval` from `Product`: `ProductPrice.type` and
`ProductPrice.recurring_interval` are deprecated.

### Metrics selection

Use the `metrics` query parameter to select which metrics to compute.
The deprecated `focus_metrics` parameter was removed. Order-based metrics include
paid and refunded orders; cumulative revenue includes history before the requested
date range.

### License expiration and benefit revocation

License-key activation now enforces `expires_at`.
After failed payment, benefits are revoked immediately by default. A configurable
grace period can keep ordinary benefits and seat benefits active through the
payment retry window.

### Embed allowlist

Configure allowed hosts in **Settings → Preferences → Embedding**. The first entry
restricts embedding to listed hosts. Organizations created on or after August 4,
2026 need an allowlist before they can embed.

### Invoice numbering

Invoices default to per-customer numbering, starting at 1 for each customer.
Organization-wide numbering remains available in settings.

## Clients, authentication, and requests

### Preview SDK setup

The `2026-04` SDKs require an explicit prerelease install. Clients default to
production. Set `environment` to `"sandbox"` and use a token issued in the sandbox,
which has its own users, organizations, and data.

```sh
npm install @polar-sh/sdk@next
```

```ts
import { createPolar } from "@polar-sh/sdk/2026-04";

const polar = createPolar({
  accessToken: process.env.POLAR_ACCESS_TOKEN!,
  environment: "sandbox",
});
const state = await polar.customers.getStateExternal("customer_external_id");
```

Python uses `pip install --pre polar-sdk` or `uv add polar-sdk --prerelease allow`.
The Python import and client example are in
[Clients, Authentication, and Operations](references/clients-auth-and-operations.md).

### Customer Portal tokens

Keep the organization access token on the server. Create a Customer Session through
`POST /v1/customer-sessions/`, then send the returned customer access token as a
bearer token to access the signed-in customer's own data.

### Pagination and quotas

List endpoints use one-based `page`; `limit` defaults to 10 and caps at 100.
Read `items` and advance through `pagination.max_page`; `pagination.total_count`
counts all matches for the query.

Production allows 500 requests/minute and sandbox allows 100 requests/minute per
organization, customer, or OAuth2 client. Unauthenticated license-key validation,
activation, and deactivation are limited to 3 requests/second in both environments.
On HTTP 429, use `Retry-After` to time the retry.

## Checkout and customer identity

### Prices, currencies, and tax

Add prices in several currencies to a single product; checkout selects the currency
according to the buyer's region. A single fixed-amount discount can carry different
amounts per currency. A Checkout Session can override a product's catalog price
for an individual purchase through the API or SDK, using fixed, free, or custom prices.

Use the organization's default tax behavior to offer tax-inclusive prices.
Free and other zero-amount orders bypass tax calculation.

### External IDs and return URLs

Use `external_id` to tie a customer to your own account ID; use the dedicated
external-ID operations for `GET`, `PATCH`, and `DELETE`. List Customers also matches
this ID through `query`. Set `external_customer_id` when creating a Checkout Session
to assign the ID to the newly created customer after successful checkout.

Set `return_url` when creating a Checkout Session or Customer Session to give buyers
a way back to your app. Static checkout links also support a custom return URL in
the dashboard.

### Discount limits and trials

Set `max_redemptions_per_customer` on discount creation or update. A matching
customer ID, payment card, or email after stripping plus aliases counts as the same buyer.
Enable **Prevent trial abuse** in **Settings → Subscription** to match repeat trials
by plus-normalized email or payment-method fingerprint. Blocked buyers can still
subscribe at the regular price. Pass `{"allow_trial":false}` when creating a Checkout
Session to disable its trial.

## Subscription changes and entitlements

### Pricing migration and billing schedules

Update a subscription to its existing product to move it from archived pricing to
the product's current pricing. The dashboard calls this **Upgrade pricing**;
proration uses the active subscription prices.

The API can change the current billing period's end date and computes the resulting
proration automatically. Make the change before the subscription is canceled.
Use `next_period` proration behavior to defer product swaps, price updates, or
seat-count changes to the next billing cycle. Pending changes appear on subscription
objects and webhooks, in the merchant dashboard, and in the customer portal.

### Pauses and resumes

Use Update Subscription to schedule a pause at period end, optionally with an
automatic resume date. At the pause, billing stops and benefits are revoked while
the payment method stays on file. Resuming starts a new billing period and charges
immediately. Enable **Enable subscription pause** under **Settings → Customer portal**
for self-service and handle `subscription.paused` and `subscription.resumed`.

### Customer State, members, and seats

Customer State combines active subscriptions and granted benefits in one response
and is also available as a webhook. The API includes trialing subscriptions, so an
entitlement check based on Customer State must account for the trial period.

Member sessions use the `polar_mst_` prefix and preserve the member's identity and
permissions. Owners and billing managers can manage the team; benefit grants can
target individual members. Seat-based pricing works for subscriptions and one-time
purchases. Customers can adjust subscription seat counts in the portal with
automatic proration.

## Usage, meters, and webhook delivery

Use event `parent_id` to attach an event to a parent and `external_id` as the ingestion
idempotency key. Send `member_id` or `external_member_id` for member-level usage
attribution; ingestion validates the member. Events can carry costs at sub-cent
precision for customer and product breakdowns.

Set a meter's display unit and value multiplier to price raw usage in billing units
such as millions of tokens. Pass `timezone` to the meter quantities endpoint to
group results by local date. Granting meter credits creates a customer meter when
needed. A meter can be archived once active products and benefits no longer reference it.

Webhook payloads include a timestamp. Endpoints are disabled after 10 consecutive
failures by default, and organization members receive email. Events skipped while
disabled do not count as failures. Re-enable the endpoint manually in the dashboard
after resolving delivery issues. If restricting webhook source IPs, account for the
ranges added October 27, 2025; see the
[delivery reference](references/events-meters-and-metrics.md).

## SSO and migration

On the Scale plan, connect an OpenID Connect provider under **Settings → SSO**.
SSO setup requires a verified domain: add a domain you own under **Settings → Domains**
and verify it with a DNS TXT record. Successful sign-in automatically makes the user
an organization member. Enforcing SSO makes the identity provider the only sign-in
route, so revoking access there removes access to the organization.

Organizations with an eligible Stripe account can use **Settings → Migrations** to
import customers and products, transfer saved cards, and switch subscriptions over
when ready.

Files in this skill

  • SKILL.md7.8 KB
  • coverage.json341 B
  • references/catalog-pricing-and-checkout.md2.3 KB
  • references/clients-auth-and-operations.md2.5 KB
  • references/customers-billing-and-self-service.md1.4 KB
  • references/events-meters-and-metrics.md1.1 KB
  • references/subscriptions-members-and-benefits.md1.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.