Skip to content

PaymentKit

Pingado reads trials, purchases, renewals and refunds from PaymentKit webhooks, and links each one to the visitor who paid.

  1. In Settings → Payment Providers, select Connect next to PaymentKit. Pingado shows your webhook URL.
  2. In PaymentKit, go to Developers → Webhooks → Add endpoint and paste the URL.
  3. Select these events:
    • checkout.session.created
    • customer.subscription.created
    • customer.subscription.updated
    • invoice.paid
    • payment.refunded
    • invoice.refunded
  4. Copy the endpoint’s signing secret (whsec_…) and paste it into Pingado.

PaymentKit checkout sessions have no free-form metadata, so the visitor ID travels in a custom field.

  1. In PaymentKit, go to Settings → Custom Fields and add a text field named pg_vid for Checkout sessions, and another for Subscriptions so renewals carry it too.
  2. 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 button
const vid = window.pingado?.vid()
await fetch('/api/checkout', { method: 'POST', body: JSON.stringify({ plan, vid }) })
// On your server
await 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.

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.