PaymentKit
Pingado reads trials, purchases, renewals and refunds from PaymentKit webhooks, and links each one to the visitor who paid.
1. Add the webhook
Section titled “1. Add the webhook”- In Settings → Payment Providers, select Connect next to PaymentKit. Pingado shows your webhook URL.
- In PaymentKit, go to Developers → Webhooks → Add endpoint and paste the URL.
- Select these events:
checkout.session.createdcustomer.subscription.createdcustomer.subscription.updatedinvoice.paidpayment.refundedinvoice.refunded
- Copy the endpoint’s signing secret (
whsec_…) and paste it into Pingado.
2. Pass the visitor ID through checkout
Section titled “2. Pass the visitor ID through checkout”PaymentKit checkout sessions have no free-form metadata, so the visitor ID travels in a custom field.
- In PaymentKit, go to Settings → Custom Fields and add a text field named
pg_vidfor Checkout sessions, and another for Subscriptions so renewals carry it too. - Send the visitor ID from the browser and set it when you create the checkout session.
// In the browser, when the customer clicks your checkout buttonconst vid = window.pingado?.vid()await fetch('/api/checkout', { method: 'POST', body: JSON.stringify({ plan, vid }) })// On your serverawait fetch(`https://app.paymentkit.com/api/${accountId}/checkout-sessions`, { method: 'POST', headers: { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ line_items: [{ price_id: priceId, quantity: 1 }], custom_fields: { pg_vid: vid ?? '' }, params_for_sub: { custom_fields: { pg_vid: vid ?? '' } }, success_url: 'https://yoursite.com/thanks', }),})Payment Links cannot carry the visitor ID. Pingado links those payments to an earlier lead with the same email.
How PaymentKit events become conversions
Section titled “How PaymentKit events become conversions”| PaymentKit event | Conversion |
|---|---|
customer.subscription.created or customer.subscription.updated, subscription in trial |
Trial started |
invoice.paid, first paid invoice of a subscription |
Purchase, including the first charge after a trial |
invoice.paid, later invoices |
Renewal |
invoice.paid, invoice without a subscription |
Purchase |
invoice.paid, invoice you raised by hand (manual) |
Not counted |
payment.refunded, invoice.refunded |
Refund |
Only self-serve purchases and subscriptions count. Invoices you create by hand in PaymentKit are never counted, whatever their amount. A checkout that never completes sends no conversion. Values are recorded without tax. Refunds are recorded, not sent to ad platforms.
Payments in a PaymentKit sandbox account are recorded as tests and never sent as real conversions. With a Meta test event code saved, they go to Meta’s Test events view, from Pingado’s servers only.