Skip to main content
An external ID is the ID a customer has in your own system, stored on their Polar customer. Set external_id to your user’s ID, and you can use that ID wherever the API asks for a customer. The examples use API version 2026-10.

Why use your own IDs

Without an external ID, you’d store Polar’s customer ID next to each user and look it up before every call. Webhooks would arrive with an ID you have to map back to a user, and you’d have to handle the ones that arrive before your mapping is saved. With an external ID, there’s nothing to map:
  • No extra column. You call the API with the user ID you already have.
  • No reconciliation. Webhook payloads and the customer state include external_id, so you know which user they’re about.
  • No ordering problems. You can send usage events for a user before their Polar customer exists. Polar links them once a customer with that external ID is created.

Set an external ID

Create the customer when a user signs up, with your user ID as external_id:
From the CLI: polar customers create --email jane@example.com --external-id user_123. In the dashboard, fill in External ID when you create the customer. You don’t have to create the customer first. A Checkout Session created with external_customer_id links the purchase to the customer with that external ID, or creates one with it. Rules:
  • An external ID is unique within your organization.
  • Once set, it can’t be changed. You can add one to an existing customer that doesn’t have one yet.
  • Deleting a customer clears their external ID, so it can be used again.

Use it in API calls

Every endpoint that reads, updates or deletes a single customer has a variant under /v1/customers/external/{external_id}. To create a customer with one, pass external_id in the request body. Reading a customer’s subscriptions, benefits and meters by your user ID:
Elsewhere, pass it as external_customer_id: For example, all subscriptions for one user:

Read it in webhooks

Orders, subscriptions and benefit grants embed their customer, so data.customer.external_id tells you which user a webhook is about. The customer.state_changed payload has external_id at the top level.

Members

On a team customer, each member can have its own external_id, unique within that customer. Address a member with /v1/customers/external/{external_id}/members/{member_external_id}, and attribute usage to them with external_member_id on an event.

Event IDs are different

An event’s own external_id is not a customer ID. It’s your unique ID for the event, used to deduplicate retries and link child events to a parent. The customer is external_customer_id.

Learn more