What you’ll build
- Usage events flowing from your application into a meter
- A subscription product with a base fee, metered usage and included credits
- A checkout that links each purchase to the user in your application
- A webhook handler that keeps your application in sync with each customer’s access
Prerequisites
- A sandbox organization. Sign up at sandbox.polar.sh. The sandbox is fully isolated from production, so nothing here moves real money.
- An organization access token from the sandbox, created under Settings → Access Tokens. See Organization access tokens.
- The TypeScript SDK, the Python SDK or any HTTP client. Every example has a tab for each.
Use your own user IDs. Every Polar customer can carry an
external_id, set to the user’s ID in your application. The quickstart uses user_123 this way throughout, so you never store Polar’s customer IDs or map them back to your users. See External IDs.The path
1
Track usage
Send events from your application and aggregate them with a meter. Start here, even before you’ve decided on pricing.
Track usage →
2
Set up your catalog
Create a product that bills a base fee and metered usage, and includes credits.
Set up your catalog →
3
Integrate checkout & customers
Link Polar customers to your users and send them to checkout.
Integrate checkout →
4
Sync customer state
Listen to webhooks and read the customer state to grant access in your application.
Sync customer state →
Why usage comes first
Events are raw facts about what customers do in your product. Polar stores every event and computes usage from them when you ask, so:- You can start sending events before you’ve settled on pricing, and decide later what to charge for, if anything.
- Events sent with your own user ID are linked to the customer as soon as a customer with that external ID exists, even if the events came first.
- New meters work on events you’ve already sent, so you see real usage the moment you create them.
Start with usage
Send your first event and create a meter.

