Maton

Polar

Access the Polar API with managed OAuth authentication. Manage products, checkouts, orders, subscriptions, customers, refunds, discounts, benefits, license keys, meters, and metrics for software sold through Polar. All access runs through the Maton gateway and the maton CLI.

Permissions

Scopes

Choose which of these OAuth scopes the connection asks for when you connect, or pass them as scopes to Create Connection. Always scopes are added whatever you choose, By default ones are requested when you don't choose, and Optional ones only when you choose them. See Scopes.

ScopeRequested
openidAlways
profileAlways
emailAlways
user:readBy default
user:writeBy default
organizations:readBy default
organizations:writeBy default
custom_fields:readBy default
custom_fields:writeBy default
discounts:readBy default
discounts:writeBy default
checkout_links:readBy default
checkout_links:writeBy default
checkouts:readBy default
checkouts:writeBy default
transactions:readBy default
transactions:writeBy default
payouts:readBy default
payouts:writeBy default
products:readBy default
products:writeBy default
benefits:readBy default
benefits:writeBy default
events:readBy default
events:writeBy default
meters:readBy default
meters:writeBy default
files:readBy default
files:writeBy default
subscriptions:readBy default
subscriptions:writeBy default
customers:readBy default
customers:writeBy default
members:readBy default
members:writeBy default
wallets:readBy default
wallets:writeBy default
disputes:readBy default
disputes:writeBy default
customer_meters:readBy default
customer_sessions:writeBy default
member_sessions:writeBy default
customer_seats:readBy default
customer_seats:writeBy default
orders:readBy default
orders:writeBy default
refunds:readBy default
refunds:writeBy default
payments:readBy default
metrics:readBy default
metrics:writeBy default
webhooks:readBy default
webhooks:writeBy default
license_keys:readBy default
license_keys:writeBy default
customer_portal:readBy default
customer_portal:writeBy default
notifications:readBy default
notifications:writeBy default
notification_recipients:readBy default
notification_recipients:writeBy default

Suggested read access

In the Console, Read limits the connection to these 57 read-only endpoints, plus deny rules for any write endpoint a broader rule would otherwise match. Endpoints Maton has found to return credentials, start jobs, or spend credits are left out; a few reads that can change state or return a secret depending on their parameters stay in, and their descriptions say how. It is a suggestion: the saved rules are exactly the ones you see, and you can change them with Custom. See Access policy.

Reference

Identity

Get the Connected User

maton api '/polar/v1/oauth2/userinfo'

Response:

{
  "sub": "{user_id}",
  "email": "jane@example.com",
  "email_verified": true
}

name may be absent. GET /v1/users/me returns 403 NotPermitted for OAuth tokens even with every scope; use /v1/oauth2/userinfo.

Organizations

List Organizations

maton api '/polar/v1/organizations/'

Returns the organizations the token can reach, each with id, name, slug, status, default_presentment_currency, and capabilities. Use the id as organization_id elsewhere. Also accepts slug.

Get Organization

maton api '/polar/v1/organizations/{organization_id}'

Products

List Products

maton api '/polar/v1/products/?limit=10'

Query parameters:

  • organization_id - Filter by organization (repeat for several)
  • query - Search by name
  • is_archived - true or false
  • is_recurring - true for subscription products, false for one-time
  • benefit_id - Products granting this benefit
  • visibility - draft, private, or public
  • page, limit - Pagination (default limit 10, max 100)
  • sorting - e.g. -created_at (default), name, price_amount

Response (trimmed):

{
  "items": [
    {
      "id": "{product_id}",
      "name": "Pro Plan",
      "description": "Everything in Pro",
      "visibility": "public",
      "is_recurring": true,
      "recurring_interval": "month",
      "recurring_interval_count": 1,
      "is_archived": false,
      "organization_id": "{organization_id}",
      "prices": [
        {"id": "{price_id}", "amount_type": "fixed", "price_currency": "usd", "price_amount": 1900, "is_archived": false}
      ],
      "benefits": []
    }
  ],
  "pagination": {"total_count": 1, "max_page": 1}
}

Get Product

maton api '/polar/v1/products/{product_id}'

Create Product

maton api -X POST '/polar/v1/products/' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "name": "Pro Plan",
  "description": "Everything in Pro",
  "organization_id": "{organization_id}",
  "recurring_interval": "month",
  "prices": [
    {"amount_type": "fixed", "price_currency": "usd", "price_amount": 1900}
  ]
}
JSON

Note: name and prices are required. recurring_interval (day, week, month, year) makes it a subscription product; omit it (or send null) for a one-time purchase. Other price types (amount_type): custom (pay what you want), seat_based, unit_based, metered_unit, metered_tiers; a fixed price with price_amount 0 is free. New products default to public visibility, so they can be bought as soon as a checkout links to them; set "visibility": "draft" to review first.

Update Product

maton api -X PATCH '/polar/v1/products/{product_id}' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "description": "Everything in Pro, plus priority support"
}
JSON

Note: Sending prices replaces the price list: include existing prices as {"id": "{price_id}"} to keep them; any left out are removed from the product. A price change applies to new purchases. "is_archived": true stops new sales of the product; existing subscribers keep access.

A checkout link is a reusable, shareable URL that starts a checkout for one or more products.

maton api '/polar/v1/checkout-links/?limit=10'

Query parameters: organization_id, product_id, page, limit, sorting.

maton api -X POST '/polar/v1/checkout-links/' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "payment_processor": "stripe",
  "products": ["{product_id}"],
  "label": "Pricing page",
  "allow_discount_codes": true,
  "success_url": "https://example.com/thanks?checkout_id={CHECKOUT_ID}"
}
JSON

Note: {CHECKOUT_ID} is left literally; Polar substitutes it on redirect. payment_processor (stripe) and products are required. The response url is the shareable link.

maton api -X DELETE '/polar/v1/checkout-links/{checkout_link_id}'

Note: Anyone with the old URL can no longer buy through it.

Checkout Sessions

List Checkout Sessions

maton api '/polar/v1/checkouts/?limit=10'

Query parameters: organization_id, product_id, customer_id, external_customer_id, status (open, expired, confirmed, succeeded, failed), query, page, limit, sorting.

Get Checkout Session

maton api '/polar/v1/checkouts/{checkout_id}'

Create Checkout Session

maton api -X POST '/polar/v1/checkouts/' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "products": ["{product_id}"],
  "customer_email": "jane@example.com",
  "success_url": "https://example.com/thanks?checkout_id={CHECKOUT_ID}"
}
JSON

Note: products is required; the first is selected by default. Optional: customer_id or external_customer_id to link an existing customer, discount_id, allow_discount_codes, metadata. The response url is a one-off payment page for the customer; it charges nothing until they pay.

Orders

List Orders

maton api '/polar/v1/orders/?limit=10'

Query parameters:

  • organization_id, product_id, customer_id, external_customer_id, subscription_id, checkout_id, discount_id
  • status - draft, pending, paid, refunded, partially_refunded, void
  • product_billing_type - one_time or recurring
  • created_after, created_before - ISO 8601 timestamps
  • page, limit, sorting (e.g. -created_at, -amount)

Example:

maton api '/polar/v1/orders/?status=paid&created_after=2026-11-01T00:00:00Z&limit=25'

Response (trimmed):

{
  "items": [
    {
      "id": "{order_id}",
      "created_at": "2026-11-03T14:12:09Z",
      "status": "paid",
      "billing_reason": "subscription_cycle",
      "subtotal_amount": 1900,
      "discount_amount": 0,
      "tax_amount": 0,
      "total_amount": 1900,
      "refunded_amount": 0,
      "refundable_amount": 1900,
      "currency": "usd",
      "customer_id": "{customer_id}",
      "product_id": "{product_id}",
      "subscription_id": "{subscription_id}",
      "invoice_number": "INV-0001"
    }
  ],
  "pagination": {"total_count": 1, "max_page": 1}
}

Each order also embeds customer, product, subscription, and line items.

Get Order

maton api '/polar/v1/orders/{order_id}'

Get Order Invoice

maton api '/polar/v1/orders/{order_id}/invoice'

Note: Returns the invoice download url once it has been generated (is_invoice_generated on the order). POST /v1/orders/{order_id}/invoice triggers generation from the order's current billing details; ask first.

Subscriptions

List Subscriptions

maton api '/polar/v1/subscriptions/?active=true&limit=10'

Query parameters:

  • organization_id, product_id, customer_id, external_customer_id, discount_id
  • active - true for active subscriptions only
  • status - incomplete, trialing, active, past_due, canceled, unpaid, paused, ...
  • cancel_at_period_end - true for subscriptions scheduled to end
  • started_after, started_before, canceled_at_after, canceled_at_before
  • page, limit, sorting (e.g. -started_at)

Get Subscription

maton api '/polar/v1/subscriptions/{subscription_id}'

Note: Key fields: status, amount, currency, recurring_interval, current_period_end, cancel_at_period_end, customer, product.

Cancel Subscription at Period End

maton api -X PATCH '/polar/v1/subscriptions/{subscription_id}' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "cancel_at_period_end": true
}
JSON

Note: "cancel_at_period_end": false undoes a scheduled cancellation.

Change Plan

maton api -X PATCH '/polar/v1/subscriptions/{subscription_id}' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "product_id": "{new_product_id}",
  "proration_behavior": "prorate"
}
JSON

Note: Changes what the customer is billed. proration_behavior is invoice (charge the difference now), prorate (on the next invoice), next_period, or reset; omitted, the organization default applies. Other single-purpose bodies for this endpoint: {"discount_id": ...} (null removes it), {"trial_end": ...}, {"seats": ...}. Send one kind of change per request.

Revoke Subscription Immediately

maton api -X DELETE '/polar/v1/subscriptions/{subscription_id}'

Note: PATCH with {"revoke": true} does the same.

Customers

List Customers

maton api '/polar/v1/customers/?limit=10'

Query parameters: organization_id, email (exact match), query (name or email search), active, page, limit, sorting.

Example:

maton api '/polar/v1/customers/?email=jane%40example.com'

Get Customer

maton api '/polar/v1/customers/{customer_id}'
maton api '/polar/v1/customers/external/{external_id}'

Note: external_id is the user's own ID for the customer, if they set one.

Get Customer State

maton api '/polar/v1/customers/{customer_id}/state'

Note: Returns the customer with their active subscriptions, granted benefits, and meter balances in one call — the usual way to answer "what does this customer have access to?".

Update Customer

maton api -X PATCH '/polar/v1/customers/{customer_id}' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "name": "Jane Doe"
}
JSON

Note: Updatable: email, name, billing_address, tax_id, locale, external_id (set once), metadata. DELETE /v1/customers/{customer_id} cannot be undone: it immediately cancels the customer's active subscriptions and revokes all their benefits.

List Members

maton api '/polar/v1/members/?limit=10'
maton api '/polar/v1/customers/{customer_id}/members'

Note: Members are the people within a team customer.

Refunds

List Refunds

maton api '/polar/v1/refunds/?limit=10'

Query parameters: organization_id, order_id, subscription_id, customer_id, succeeded, page, limit, sorting.

Create Refund

maton api -X POST '/polar/v1/refunds/' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "order_id": "{order_id}",
  "amount": 1900,
  "reason": "customer_request",
  "comment": "Requested within 14 days"
}
JSON

Note: order_id, amount (cents, at least 1) and reason are required. reason is duplicate, fraudulent, customer_request, service_disruption, satisfaction_guarantee, or other. "revoke_benefits": true also revokes what the order granted; Polar allows it only for one-time purchases (a subscription's benefits end when the subscription is revoked).

Payments and Disputes

maton api '/polar/v1/payments/?limit=10'
maton api '/polar/v1/payments/{payment_id}'
maton api '/polar/v1/disputes/?limit=10'
maton api '/polar/v1/disputes/{dispute_id}'

Note: Payments filter by organization_id, checkout_id, order_id, customer_id, status (pending, succeeded, failed), method. Disputes filter by organization_id, order_id, status (needs_response, under_review, won, lost, ...). POST /v1/disputes/{dispute_id}/accept concedes the chargeback and the funds; only on explicit request.

Discounts

List Discounts

maton api '/polar/v1/discounts/?limit=10'

Query parameters: organization_id, query, page, limit, sorting.

Create Discount

maton api -X POST '/polar/v1/discounts/' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "name": "Launch week",
  "type": "percentage",
  "basis_points": 2000,
  "duration": "once",
  "code": "LAUNCH20",
  "max_redemptions": 100,
  "ends_at": "2026-12-31T23:59:59Z",
  "organization_id": "{organization_id}"
}
JSON

Note: basis_points is hundredths of a percent (2000 = 20%). For a fixed amount use "type": "fixed" with amount (cents) and currency. duration is once, forever, or repeating (with duration_in_months). products limits which products it applies to. Confirm the amount, code, and limits; a public code can be redeemed by anyone who has it.

Benefits and License Keys

maton api '/polar/v1/benefits/?limit=10'
maton api '/polar/v1/benefits/{benefit_id}/grants?limit=10'
maton api '/polar/v1/license-keys/?limit=10'
maton api '/polar/v1/license-keys/{license_key_id}'

Note: Benefits filter by organization_id, type (license_keys, downloadables, github_repository, discord, custom, meter_credit, feature_flag, ...). License keys filter by organization_id, benefit_id, status (granted, revoked, disabled); each carries the full key and a masked display_key.

Disable a License Key

maton api -X PATCH '/polar/v1/license-keys/{license_key_id}' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "status": "disabled"
}
JSON

Note: The customer's software stops validating; confirm the customer first. Also settable: limit_activations, limit_usage, expires_at.

Metrics

Get Metrics

maton api '/polar/v1/metrics/?start_date=2026-10-01&end_date=2026-10-31&interval=day'

Query parameters:

  • start_date, end_date, interval - Required. interval is hour, day, week, month, or year
  • timezone - IANA name, default UTC
  • organization_id, product_id, billing_type (one_time, recurring), customer_id
  • metrics - Limit to specific metric slugs (repeat for several)

Response (trimmed):

{
  "periods": [
    {"timestamp": "2026-10-01T00:00:00Z", "orders": 3, "revenue": 5700, "net_revenue": 5300, "active_subscriptions": 12, "monthly_recurring_revenue": 22800, "churned_subscriptions": 0}
  ],
  "totals": {"orders": 41, "revenue": 77900},
  "metrics": {"revenue": {"slug": "revenue", "display_name": "Revenue", "type": "currency"}}
}

Money metrics are in cents.

Get Metric Limits

maton api '/polar/v1/metrics/limits'

Returns min_date and, per interval, the allowed range in days (for example day up to 366 days, hour up to 7).

Usage Billing

maton api '/polar/v1/meters/?limit=10'
maton api '/polar/v1/meters/{meter_id}/quantities?start_timestamp=2026-11-01T00:00:00Z&end_timestamp=2026-11-26T00:00:00Z&interval=day'
maton api '/polar/v1/customer-meters/?customer_id={customer_id}'
maton api '/polar/v1/events/?limit=10'
maton api '/polar/v1/events/names'

Note: POST /v1/events/ingest records usage that customers are billed for; ingest only events the user supplies.

Other Read Endpoints

maton api '/polar/v1/custom-fields/?limit=10'
maton api '/polar/v1/files/?limit=10'
maton api '/polar/v1/benefit-grants/?limit=10'
maton api '/polar/v1/customer-seats?subscription_id={subscription_id}'

Note: customer-seats requires subscription_id or order_id (otherwise 400).

Webhook Endpoints

maton api '/polar/v1/webhooks/endpoints'
maton api '/polar/v1/webhooks/deliveries?endpoint_id={endpoint_id}&limit=10'

Create Webhook Endpoint

maton api -X POST '/polar/v1/webhooks/endpoints' -H 'Content-Type: application/json' --input - <<'JSON'
{
  "url": "https://hooks.example.com/polar",
  "format": "raw",
  "events": ["order.paid", "subscription.canceled"],
  "organization_id": "{organization_id}"
}
JSON

Note: url, format (raw, discord, slack) and events are required. The response includes the signing secret; treat it as a credential and do not print it. DELETE /v1/webhooks/endpoints/{endpoint_id} stops delivery.

Pagination

List endpoints take page (from 1) and limit (default 10, max 100) and return items with a pagination object:

{"items": [], "pagination": {"total_count": 42, "max_page": 5}}
maton api '/polar/v1/orders/?limit=100&page=1'
maton api '/polar/v1/orders/?limit=100&page=2'

Stop when page reaches max_page.

Notes

  • IDs are UUIDs; a malformed ID returns 422 RequestValidationError, an unknown one 404 ResourceNotFound.
  • Amounts are integers in the smallest currency unit; currencies are lowercase ISO codes (usd).
  • Timestamps are ISO 8601 (UTC).
  • Array filters repeat the parameter: ?product_id={a}&product_id={b}. sorting takes a field name, - prefix for descending.
  • Errors are JSON {"error": "...", "detail": ...}; validation errors list each field in detail.
  • Payouts, transactions and wallets have OAuth scopes but no endpoints in Polar's public API; they are not part of this reference.
  • Rate limit: Polar documents 500 requests per minute in production. On 429, wait for Retry-After.

Resources

On this page