API Base URL
All API requests should be made to:Authentication Methods
Personal Access Token (PAT)
Personal Access Tokens are ideal for server-side applications and scripts that need to access your personal resources.Generate a token
Navigate to your Polar settings and create a new Personal Access Token.
Personal Access Tokens have access to all resources in your personal account. Keep them secure and never commit them to version control.
Organization Access Token (OAT)
Organization Access Tokens are scoped to a specific organization and can have granular permissions.Generate a token
Go to your organization settings and create a new Organization Access Token with the required scopes.
Configure scopes
Select only the scopes needed for your application:
products:read,products:write- Product managementcustomers:read,customers:write- Customer managementsubscriptions:read,subscriptions:write- Subscription managementorders:read,orders:write- Order managementwebhooks:read,webhooks:write- Webhook management- And many more…
OAuth 2.0
OAuth 2.0 is ideal for applications that need to access Polar resources on behalf of users.Request authorization
Redirect users to the authorization endpoint with your client ID and requested scopes.
For detailed OAuth 2.0 implementation guidance, see our OAuth 2.0 documentation.
Customer Session Tokens
Customer session tokens are specialized tokens for authenticating customers on your organization. These are created programmatically for customer-facing features.Customer session tokens expire after 1 hour and are intended for short-lived customer portal sessions.
Available Scopes
When using OAuth 2.0 or Organization Access Tokens, you can request specific scopes:Identity Scopes
Identity Scopes
openid- OpenID Connect authenticationprofile- Read user profileemail- Read user email address
Resource Scopes
Resource Scopes
Each resource has read and write scopes:
organizations:read,organizations:writeproducts:read,products:writecustomers:read,customers:writesubscriptions:read,subscriptions:writeorders:read,orders:writebenefits:read,benefits:writediscounts:read,discounts:writewebhooks:read,webhooks:writeevents:read,events:writemeters:read,meters:writefiles:read,files:writelicense_keys:read,license_keys:writecheckouts:read,checkouts:writecheckout_links:read,checkout_links:writecustom_fields:read,custom_fields:writerefunds:read,refunds:writepayments:readtransactions:read,transactions:writepayouts:read,payouts:writedisputes:readmetrics:read
Portal Scopes
Portal Scopes
customer_portal:read,customer_portal:write- Customer portal accesscustomer_sessions:write- Create customer sessions
Rate Limiting
API requests are rate limited based on your authentication method:- Web sessions: Higher limits for dashboard usage
- OAuth 2.0 clients: Per-client rate limiting
- Organization tokens: Based on organization’s rate limit tier
- Personal tokens: Default rate limiting
Best Practices
Secure Storage
Store tokens securely using environment variables or a secrets management service. Never hardcode them in your application.
Principle of Least Privilege
Request only the scopes your application needs. Use Organization Access Tokens with minimal permissions.
Token Rotation
Regularly rotate your tokens and implement token refresh for OAuth 2.0 applications.
Error Handling
Handle authentication errors gracefully and implement retry logic with exponential backoff.
Next Steps
Sandbox Environment
Test your integration in the sandbox environment
Customer State API
Learn how to check customer entitlements
Webhooks
Set up webhooks for real-time notifications
API Reference
Explore the complete API documentation