Skip to content
Get the kit

Paddle

Paddle is a merchant of record: it is the legal seller in each transaction and owns global sales tax, PCI, refunds, and chargebacks. Like Polar, there is no tax configuration on your side.

Pick paddle at the wizard’s Payment provider question (--payments paddle): your clone then keeps the Paddle code next to Stripe’s, and the website keeps its /pay page. The wizard removes both on any other answer; to add Paddle to a clone configured for another provider, copy its files back from the kit first (Switch providers lists them).

  1. Create the sandbox seller at sandbox-vendors.paddle.com. No website approval is needed in the sandbox.
  2. Get the API key. Developer tools → Authentication → create an API key (it looks like pdl_…_apikey_…). Keys expire, 90 days by default and one year at most; a dead key is the first thing to check if billing stops.

The wizard’s payments step does the rest, except creating the webhook: it prints the webhook URL, you add it as a destination in the dashboard (Developer tools → Notifications), and the step stores the secret you paste. It stops with the same command when the key or the Blaze plan is missing (what it asks):

Terminal window
pnpm create extstart --payments-setup

By hand, from backend/functions:

Terminal window
cp .env.example .env

In that .env, replace <your-project-id> with your Firebase project id. Then select Paddle, on the sandbox while you test:

backend/functions/.env
PAYMENT_PROVIDER=paddle
PADDLE_SANDBOX=true

Without PAYMENT_PROVIDER=paddle the deploy runs Stripe and asks for Stripe’s secrets.

Terminal window
firebase functions:secrets:set PADDLE_API_KEY
Terminal window
pnpm seed:paddle

Create the webhook. Developer tools → Notifications → add a destination pointing at your function URL ending in /api/billing/webhook. The function URL is https://us-central1-<project-id>.cloudfunctions.net/api. Copy its secret (pdl_ntfset_…), store it, deploy:

Terminal window
firebase functions:secrets:set PADDLE_WEBHOOK_SECRET
Terminal window
pnpm firebase:deploy

Either way, set the default payment link (below) before the first checkout.

Paddle has no lookup-key field, so the script stores the kit’s plan keys in each price’s custom data. Trials live on prices in Paddle’s model, so when BILLING_TRIAL_DAYS is above 0 (from the environment, or backend/functions/.env on the Firebase stack) every recurring plan gets two seeded variants: a cardless-trial price and a base price; the backend picks the right one per user, with trial-once enforced server-side. At 0, the default, the seed creates base prices only, and checkout uses the base price even where a trial variant already exists. Keep the value equal to the days of a trial: { days, card: true } in paywall.config.ts.

Paddle refuses to create any transaction until your account has a default payment link, the page its checkout opens on. The website template ships one at /pay; the checkout runs in Paddle’s overlay on that page, and the extension only ever opens a URL. To set it: fill paddle.clientToken in apps/site/src/site.ts (the client-side token from Developer tools → Authentication), deploy your site, then Dashboard → Checkout → Checkout settings → set the default payment link to https://<your-site>/pay. If a checkout fails with transaction_default_checkout_url_not_set, that step was skipped; the kit’s error message says so.

  • The test card 4242 4242 4242 4242 works in the sandbox.
  • Going live: in the live seller account, create an API key and a client-side token, seed again, add the production webhook, and set the default payment link. Remove PADDLE_SANDBOX, and in apps/site/src/site.ts set paddle.sandbox: false with the live clientToken. Paddle also requires approving your website’s domain under Checkout → Website approval.