GrowthRailDocs

Webhook events

EventWhat it signalsGrowth Rail action
PAYMENT.CAPTURE.COMPLETEDPurchase confirmed by provider.Record purchase proof; join to pending SDK attribution claim.

How attribution works

A verified provider event proves the purchase happened — but not that the user was referred. Growth Rail completes a referral only when that event joins to the opaque attribution claim previously captured by the SDK on the referring user's device.

Identity rule: Growth Rail joins events to claims using stable IDs and opaque tokens. It never correlates users by email, name, phone number, or billing address.
1

Create the Growth Rail connection

Open Dashboard → Integrations → Purchases, choose PayPal, and create a Sandbox or Production connection. Copy the generated webhook endpoint URL — you will paste it into PayPal in the next step.

2

Register the webhook in PayPal

In PayPal Developer Dashboard → Apps & Credentials → Webhooks, add the copied endpoint and subscribe to PAYMENT.CAPTURE.COMPLETED.

Return to Growth Rail and save the PayPal webhook ID (not the client secret). Growth Rail encrypts and stores it — the raw value is never returned by the API after saving.

Security: Never commit webhook secrets to source control or log them. If a secret is compromised, rotate it in both PayPal and Growth Rail immediately.
3

Pass attribution data from your app

Set the purchase unit custom_id to the opaque Growth Rail attribution token. The SDK has already bound that token to the stable app user during initialization.

ts
createOrder: (_data, actions) => actions.order.create({
  purchase_units: [{
    amount: { value: total },
    custom_id: GrowthRail.getAttributionToken(),
  }],
}),
4

Verify end-to-end in test mode

Use the PayPal Sandbox REST app and buyer account to capture a payment, then verify PAYMENT.CAPTURE.COMPLETED in Growth Rail.

OutcomeMeaning
CompletedPurchase proof and SDK attribution token matched. The referral reward has been triggered.
Awaiting attributionThe webhook signature was valid, but the SDK claim has not arrived yet — or the stable user ID did not match a pending claim. The event is held; Growth Rail completes the referral when the claim arrives.
IgnoredThe event was verified but no matching attribution claim exists and the hold window has expired, or the event type is out of scope.
Provider-specific notes
  • Growth Rail validates PayPal's RSA signature using its allow-listed certificate URL and your webhook ID. Never paste a PayPal client secret into Growth Rail.
  • Sandbox and live REST apps have different webhook IDs and must use separate Growth Rail connections.
  • Refund and chargeback events do not automatically reverse issued rewards in the current version.