Skip to main content
Flux Pass integrates with Polar for subscription management and payments. Prices are handled in USD by Polar and converted to PLN for display.

Checkout

GET /api/polar/checkout
Generates a Polar checkout session and redirects the user to the payment page. Requires authentication.
plan
string
required
Subscription plan. One of: pro-lite, pro.
billingCycle
string
required
Billing cycle. One of: monthly, yearly.

Response 303

Redirects to the Polar checkout URL.

Response 400

{
  "message": "Invalid plan or billingCycle"
}

Customer portal

GET /api/polar/portal
Creates a Polar customer portal session and redirects the user. The portal allows users to manage their subscription, view invoices, and update payment methods.

Response 307

Redirects to the Polar customer portal URL.

Response 400

{
  "message": "No Polar customer ID found. Please contact support."
}

Webhooks

POST /api/webhooks/drop
Receives Polar webhook events for the DROP service. This endpoint is called by Polar’s servers - do not call it manually.
This endpoint processes webhook payloads from Polar. It is not intended for client use.

Handled events

EventAction
subscription.createdSets user tier to the subscription plan, marks as premium
subscription.updatedUpdates tier and premium status based on subscription state
subscription.activeSame as subscription.updated
subscription.canceledMarks subscription status as canceled (access continues until period end)
subscription.revokedImmediately revokes premium access, resets to free tier
customer.createdLinks Polar customer ID to user entitlement
customer.updatedUpdates Polar customer ID
customer.deletedRemoves Polar customer data, resets to free tier

Response 200

{
  "received": true
}