PayPal
Attribute completed PayPal captures without giving Growth Rail your REST API secret.
Webhook events
| Event | What it signals | Growth Rail action |
|---|---|---|
PAYMENT.CAPTURE.COMPLETED | Purchase 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.
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.
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.
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.
createOrder: (_data, actions) => actions.order.create({
purchase_units: [{
amount: { value: total },
custom_id: GrowthRail.getAttributionToken(),
}],
}),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.
| Outcome | Meaning |
|---|---|
| Completed | Purchase proof and SDK attribution token matched. The referral reward has been triggered. |
| Awaiting attribution | The 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. |
| Ignored | The event was verified but no matching attribution claim exists and the hold window has expired, or the event type is out of scope. |
- 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.