DocsPolar

Polar

Integrate Polar payments with PayKit.

PayKit provides seamless Polar integration with a unified API that works across all payment providers.

Quick Start

Install the Polar provider:


Setup

Method 1: Environment Variables


Method 2: Direct Configuration


Basic Usage


Webhook Setup

Enable Events

In your Polar dashboard, enable the following webhook events:

  • order.paid
  • checkout.created
  • customer.created
  • customer.updated
  • subscription.created
  • subscription.updated
  • subscription.canceled

Next.js API Route


Vite.js


Custom Fields

Polar supports custom fields that users can fill during checkout. PayKit automatically includes these in the webhook metadata as $customFieldData for resources like invoices and subscriptions.

The $customFieldData is of type PaykitMetadata and needs to be parsed to access the values. It's available in both subscription and invoice retrieval:

Environment Variables


Support