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.

How it works#

1
Connect your organization

Connect Polar from your app's Marketplace page with an organization access token and the webhook secret.

2
Map products to entitlements

Each Polar product ID matches a CashSDK product and the entitlement it unlocks.

3
Receive signed webhooks

Paid orders become revenue, each refund comes back out by its own amount, and subscription events grant and end access.

Connect Polar#

1
Create an access token

In Polar, open your organization's settings and create an organization access token. Copy it.

2
Add it to CashSDK

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.

3
Register the webhook

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.

4
Activate

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. canceled means it will not renew: access stays until the current period ends. revoked ends 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#

1
Test in the sandbox

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.

2
Switch to production

Add a Production connection with your production token, its own webhook and secret. Your CashSDK publishable key does not change.

Next steps#