Polar
1. Add the webhook
Section titled “1. Add the webhook”- In Settings → Integrations, select Connect next to Polar. Pingado shows your webhook URL.
- In Polar, go to Settings → Webhooks → Add endpoint, paste the URL, and choose the Raw format.
- Select
order.createdandsubscription.created. - Copy the webhook secret and paste it into Pingado.
2. Set the success URL
Section titled “2. Set the success URL”https://yoursite.com/thanks?checkout_id={CHECKOUT_ID}3. Pass the visitor ID through checkout
Section titled “3. Pass the visitor ID through checkout”When you create checkouts with the Polar API, set the visitor ID in the checkout metadata:
const checkout = await polar.checkouts.create({ products: [productId], metadata: { pg_vid: vid }, successUrl: 'https://yoursite.com/thanks?checkout_id={CHECKOUT_ID}',})Get vid in the browser with window.pingado.vid() and send it to your server with the checkout request.