Skip to main content

Overview

Customers represent individuals or organizations that purchase your products. They can have subscriptions, orders, and benefits.

The Customer Object

id
string
required
Unique identifier for the customer
email
string
required
Customer’s email address
name
string
Customer’s name
external_id
string
Your internal ID for this customer
billing_address
object
Billing address
tax_id
string
Tax ID (VAT number, etc.)
organization_id
string
required
Organization owning this customer
metadata
object
Custom metadata
created_at
string
required
Creation timestamp

List Customers

cURL
curl -X GET "https://api.polar.sh/v1/customers" \
  -H "Authorization: Bearer polar_pat_..."

Query Parameters

organization_id
string
Filter by organization
email
string
Filter by exact email
query
string
Search by name, email, or external ID
metadata
object
Filter by metadata

Get Customer

cURL
curl -X GET "https://api.polar.sh/v1/customers/{id}" \
  -H "Authorization: Bearer polar_pat_..."

Path Parameters

id
string
required
Customer ID

Get Customer by External ID

cURL
curl -X GET "https://api.polar.sh/v1/customers/external/{external_id}" \
  -H "Authorization: Bearer polar_pat_..."

Path Parameters

external_id
string
required
Your external customer ID

Create Customer

cURL
curl -X POST "https://api.polar.sh/v1/customers" \
  -H "Authorization: Bearer polar_pat_..." \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "name": "John Doe",
    "external_id": "user_12345",
    "organization_id": "org_123"
  }'

Request Body

email
string
required
Customer’s email address
name
string
Customer’s name
external_id
string
Your internal customer ID
billing_address
object
Billing address
tax_id
string
Tax ID
organization_id
string
Organization ID (required unless using org token)
metadata
object
Custom metadata

Update Customer

cURL
curl -X PATCH "https://api.polar.sh/v1/customers/{id}" \
  -H "Authorization: Bearer polar_pat_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Doe",
    "metadata": {
      "tier": "premium"
    }
  }'

Path Parameters

id
string
required
Customer ID

Request Body

All fields optional.
email
string
Update email
name
string
Update name
billing_address
object
Update billing address
tax_id
string
Update tax ID
metadata
object
Update metadata

Update by External ID

cURL
curl -X PATCH "https://api.polar.sh/v1/customers/external/{external_id}" \
  -H "Authorization: Bearer polar_pat_..." \
  -H "Content-Type: application/json" \
  -d '{"name": "Jane Doe"}'

Delete Customer

cURL
curl -X DELETE "https://api.polar.sh/v1/customers/{id}" \
  -H "Authorization: Bearer polar_pat_..."
This immediately cancels all active subscriptions and revokes all benefits. Customer information is retained for historical orders.

Path Parameters

id
string
required
Customer ID

Query Parameters

anonymize
boolean
default:"false"
Also anonymize personal data for GDPR compliance

Response

204
No Content
Customer deleted

Get Customer State

cURL
curl -X GET "https://api.polar.sh/v1/customers/{id}/state" \
  -H "Authorization: Bearer polar_pat_..."
Get a comprehensive overview of the customer’s subscriptions and benefits.

Path Parameters

id
string
required
Customer ID

Response

customer
object
Customer object
subscriptions
array
Active subscriptions
benefits
array
Active benefits

Export Customers

cURL
curl -X GET "https://api.polar.sh/v1/customers/export" \
  -H "Authorization: Bearer polar_pat_..."

Response

Returns a CSV file with customer data.

Examples

Create Customer with External ID

curl -X POST "https://api.polar.sh/v1/customers" \
  -H "Authorization: Bearer polar_pat_..." \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "name": "John Doe",
    "external_id": "user_abc123",
    "organization_id": "org_xyz",
    "metadata": {
      "signup_source": "website",
      "plan": "trial"
    }
  }'

Update Customer Billing Address

curl -X PATCH "https://api.polar.sh/v1/customers/cust_123" \
  -H "Authorization: Bearer polar_pat_..." \
  -H "Content-Type: application/json" \
  -d '{
    "billing_address": {
      "line1": "123 Main St",
      "city": "San Francisco",
      "state": "CA",
      "postal_code": "94102",
      "country": "US"
    }
  }'

Get Customer by Your ID

curl -X GET "https://api.polar.sh/v1/customers/external/user_abc123" \
  -H "Authorization: Bearer polar_pat_..."

Delete and Anonymize

curl -X DELETE "https://api.polar.sh/v1/customers/cust_123?anonymize=true" \
  -H "Authorization: Bearer polar_pat_..."

Build docs developers (and LLMs) love