Skip to main content
The customer state is one object with everything you need to decide what a customer can access: their details, active subscriptions, granted benefits and active meters with balances. Read it by your own user ID, or receive it in the customer.state_changed webhook whenever it changes. See Customers for the concept. The examples use the sandbox client from the quickstart overview, on API version 2026-10.

Read the state

To use Polar’s customer ID, call getState (get_state in Python), or GET /v1/customers/{id}/state. To look up the same information by hand:
  • Open Customers
  • Select the customer
  • Overview lists their Subscriptions and Benefit Grants
  • Usage shows each meter’s consumed and credited units

Handle customer.state_changed

The webhook’s payload is the full state, so you don’t need to fetch anything:
Test it locally by forwarding your sandbox webhooks with the CLI:
Terminal
Without an SDK, verify signatures with a Standard Webhooks library.

The state object

Common checks:
  • A plan: a subscription in active_subscriptions with your product_id. A subscription canceled at period end stays here until it ends.
  • A feature flag: a grant in granted_benefits with your benefit_id, or with a benefit_metadata key you set on the benefit. See Feature flags.
  • Credits left: the balance of your meter in active_meters. Polar never blocks usage, so enforce limits in your app.
The state is per customer, not per member. For a team customer, it shows what the team bought. Check the member’s own benefit grants or seat to decide what an individual member can use.

When customer.state_changed fires

  • A customer is created, updated or deleted
  • A subscription is created, updated, canceled, revoked or renewed
  • A benefit is granted, updated or revoked
  • A meter balance changes, from usage or credits
  • A license key changes

Learn more