After installation, openDocumentation Index
Fetch the complete documentation index at: https://danestvesllc-2b77d201.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
config/polar.php to review every option. All secrets are read from environment variables — add them to your .env file and never commit them to version control. The sections below explain each setting, where to find the required values in the Polar dashboard, and what the defaults mean.
Access token
- Sandbox:
https://sandbox.polar.sh/dashboard/<org_slug>/settings - Production:
https://polar.sh/dashboard/<org_slug>/settings
Organization ID (optional)
validateLicenseKey, activateLicenseKey, and deactivateLicenseKey — require an explicit organisation ID. Setting it here once means you never have to pass it on every call. If you leave it unset you must pass the organizationId argument explicitly every time you call those methods.
Server environment
| Value | Base URL | Use for |
|---|---|---|
sandbox (default) | https://sandbox-api.polar.sh | Local development, CI, staging |
production | https://api.polar.sh | Live customers |
sandbox — you can test checkouts, subscriptions, and webhooks with no risk to real customer data. Remember to switch to production before going live.
Webhook secret
- Sandbox:
https://sandbox.polar.sh/dashboard/<org_slug>/settings/webhooks - Production:
https://polar.sh/dashboard/<org_slug>/settings/webhooks
https://yourdomain.com/polar/webhook (replace polar if you have customised POLAR_PATH).
Supported events
Subscribe your webhook to all of the following event types so the package can react to every billing lifecycle change. If an event type is missing, the corresponding Laravel event won’t be dispatched and your database may fall out of sync.| Category | Events |
|---|---|
| Order | order.created, order.updated |
| Subscription | subscription.created, subscription.updated, subscription.active, subscription.canceled, subscription.revoked |
| Benefit grant | benefit_grant.created, benefit_grant.updated, benefit_grant.revoked |
| Checkout | checkout.created, checkout.updated, checkout.expired |
| Customer | customer.created, customer.updated, customer.deleted, customer.state_changed |
| Product | product.created, product.updated |
| Benefit | benefit.created, benefit.updated |
Route path
polar produces:
POST /polar/webhook— webhook endpointGET /polar/...— any other package routes
polar conflicts with an existing route in your application. Remember to update the webhook URL in the Polar dashboard to match.
Default redirect URL
->withSuccessUrl(...) at call time.
Currency locale
| Locale | Format |
|---|---|
en (default) | $1,234.56 |
de | 1.234,56 $ |
fr | 1 234,56 € |
Non-English locales require the PHP
intl extension. Run php -m | grep intl to confirm it is enabled on your server.Full example .env
Next steps
Billable trait
Add billing capabilities to your Eloquent models.
Webhooks
Learn how to listen for and handle Polar webhook events in your application.