Beta. The Polar connector is built and tested against Polar's documented, signed webhook events. It has not yet run against a live Polar organization in production. Try it in Polar's sandbox first.
Polar
Connect Polar (a developer-native merchant of record with usage-based billing) so its orders become CashSDK revenue and its subscriptions grant access.
Polar is a developer-native merchant of record with usage-based billing. It is built for teams selling to developers while still handling tax as the seller of record. Connect it to CashSDK and Polar orders, renewals included, sit next to your in-app revenue, while its subscriptions grant and end the entitlements your apps check.
Polar meters and bills usage itself. CashSDK records the orders Polar bills, so usage charges show up as revenue. It does not read meters, benefits, license keys or downloads.
How it works#
Connect Polar from your app's Marketplace page with an organization access token and the webhook secret.
Each Polar product ID matches a CashSDK product and the entitlement it unlocks.
Paid orders become revenue, each refund comes back out by its own amount, and subscription events grant and end access.
Connect Polar#
In Polar, open your organization's settings and create an organization access token. Copy it.
In the dashboard, open your app's Marketplace page, choose Polar and select Connect. Pick Sandbox for a Polar sandbox organization or Production for your live one, and paste the token. Leave the webhook secret empty for now. Credentials are stored encrypted at rest. If the page offers Connect with Polar, you can approve access there instead of pasting a token.
Copy the connection's webhook URL from the Connected list and add it in
Polar under Settings → Webhooks. Subscribe to order.paid,
refund.created, subscription.created, subscription.active,
subscription.updated, subscription.canceled, subscription.uncanceled
and subscription.revoked.
Copy the endpoint's webhook secret. Back in CashSDK, select Reconnect, enter the token and that secret, then select Activate. A connection without a webhook secret cannot be activated.
Map your catalog#
Polar events name the product. Payments for products your app does not sell are
skipped, so for each Polar product create a product in
CashSDK whose identifier is the Polar product ID and attach the
entitlement it unlocks. To point a Polar product at an
existing product instead, map it with map_marketplace_catalog
(prompt setup).
- A one-time order unlocks a non-consumable product for good.
- A subscription grants access while it is active.
canceledmeans it will not renew: access stays until the current period ends.revokedends access at once. - A refund comes off your revenue by its own amount. A refund of the whole order also ends the access that order gave.
Who gets access#
Put your app user ID in cashsdk_user_id in the checkout or subscription metadata.
CashSDK reads it from the subscription events and remembers it for that
subscription. Without it, and for one-time orders, the Polar customer ID stands in
for the user. Link it to the right user with the link_marketplace_user tool on
the MCP server.
Test and go live#
With a Sandbox connection to a Polar sandbox organization, complete a checkout. Confirm the order appears under Transactions and the entitlement is granted to your test user.
Add a Production connection with your production token, its own webhook and secret. Your CashSDK publishable key does not change.