PayPal gives you two ways to verify a webhook: ask PayPal's API, or check the CRC32 and RSA signature yourself. We compare how each works, the trade-offs, and the reasons verification fails.
PayPal gives you two ways to confirm a webhook really came from PayPal. With postback verification, you send the headers and body back to PayPal's verify-webhook-signature endpoint and it tells you SUCCESS or FAILURE. With self-verification, you download PayPal's certificate and check an RSA signature yourself. PayPal documents self-verification as the preferred approach. This post explains both, compares them, and covers the mistakes that make verification fail. All PayPal details below were checked against PayPal's developer docs on 2026-09-27.
What PayPal sends
Each webhook delivery carries these headers (PayPal webhooks):
| Header | Contents |
|---|---|
paypal-transmission-id | Unique ID for this transmission |
paypal-transmission-time | Timestamp of the transmission |
paypal-transmission-sig | Base64-encoded signature |
paypal-cert-url | URL of the certificate holding the public key |
paypal-auth-algo | Signing algorithm, SHA256withRSA |
According to the same page, PayPal expects a 2xx response, retries failed deliveries up to 25 times over 3 days, and requires the listener to be on HTTPS port 443.
Method 1: postback to verify-webhook-signature
You call POST /v1/notifications/verify-webhook-signature with the header values, your webhook ID and the event, and read verification_status from the response (Webhooks API v1).
async function verifyByPostback(headers: Record<string, string>, event: unknown, accessToken: string) { const res = await fetch('https://api-m.paypal.com/v1/notifications/verify-webhook-signature', { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${accessToken}` }, body: JSON.stringify({ auth_algo: headers['paypal-auth-algo'], cert_url: headers['paypal-cert-url'], transmission_id: headers['paypal-transmission-id'], transmission_sig: headers['paypal-transmission-sig'], transmission_time: headers['paypal-transmission-time'], webhook_id: process.env.PAYPAL_WEBHOOK_ID, webhook_event: event, }), signal: AbortSignal.timeout(5_000), }); if (!res.ok) throw new Error(`verify call failed: ${res.status}`); const { verification_status } = await res.json(); return verification_status === 'SUCCESS'; } Use https://api-m.sandbox.paypal.com for sandbox. The call needs an OAuth access token, so there's also a token request to cache and refresh.
The cost is that every incoming webhook now depends on an outbound API call. If that call is slow, your handler is slow; if it fails, you have to decide between rejecting a genuine event (and relying on PayPal's retries) or accepting an unverified one. Rejecting is the safe choice: return a 5xx so PayPal retries later.
One documented limitation: mock events from the webhook simulator don't support postback verification.
Method 2: self-verification with CRC32 and RSA
Here you rebuild the string PayPal signed and check the signature against the public key in PayPal's certificate. The signed string is:
<transmissionId>|<timeStamp>|<webhookId>|<crc32> -
transmissionIdandtimeStampcome from thepaypal-transmission-idandpaypal-transmission-timeheaders. -
webhookIdis the ID PayPal assigned when you subscribed your listener URL. It's your configuration, not something in the request. -
crc32is the CRC32 checksum of the raw request body, written as a decimal integer.
PayPal's own Node sample does this with buffer-crc32 and Node's crypto.createVerify('SHA256'), downloading and caching the certificate from paypal-cert-url. Here's a version with the pieces made explicit, plus a check on the certificate URL that the official sample doesn't include:
import crypto from 'node:crypto'; import crc32 from 'buffer-crc32'; const certCache = new Map<string, string>(); async function getCert(url: string): Promise<string> { const u = new URL(url); // Our own safeguard: only fetch certificates from PayPal over HTTPS if (u.protocol !== 'https:' || !(u.hostname === 'paypal.com' || u.hostname.endsWith('.paypal.com'))) { throw new Error(`unexpected cert host: ${u.hostname}`); } const hit = certCache.get(url); if (hit) return hit; const pem = await (await fetch(url, { signal: AbortSignal.timeout(5_000) })).text(); certCache.set(url, pem); return pem; } export async function verifyLocally(rawBody: Buffer, h: Record<string, string>): Promise<boolean> { const crc = crc32.unsigned(rawBody); // decimal, unsigned const message = `${h['paypal-transmission-id']}|${h['paypal-transmission-time']}|${process.env.PAYPAL_WEBHOOK_ID}|${crc}`; const cert = await getCert(h['paypal-cert-url']); const verifier = crypto.createVerify('SHA256'); verifier.update(message); return verifier.verify(cert, Buffer.from(h['paypal-transmission-sig'], 'base64')); } After the first delivery, the certificate is cached and verification is purely local.
Why check the certificate URL? The URL comes from a request header, which the sender controls. If you fetch whatever URL the header names and trust its key, an attacker can point you at their own certificate and sign whatever they like. Restricting the host to PayPal closes that gap; validating the certificate chain goes further. This check is our recommendation, not something PayPal's sample shows.
Comparing the two
| Postback | Self-verification | |
|---|---|---|
| PayPal's stance | Supported | Preferred |
| Extra network calls | One per webhook (plus OAuth tokens) | Certificate download, then cached |
| Latency added | The API round trip | Negligible after the first request |
| If PayPal's API is down | You can't verify | Keeps working |
| Code to write | Small | CRC32, string building, RSA verify, certificate cache |
| Simulator (mock) events | Not supported | Not covered by the docs; test with real sandbox transactions |
| Where mistakes happen | Webhook ID, sandbox vs live base URL | CRC32 encoding, raw body, webhook ID |
Why verification fails
- CRC32 in the wrong form. PayPal wants the decimal value. Hex strings fail, and so do signed 32-bit integers: any checksum with the high bit set comes out negative if you use a signed CRC function. PayPal's sample converts the 4-byte result through hex (
parseInt("0x" + crc32(event).toString('hex')));crc32.unsigned()gives the same number directly. - The body was parsed first. The CRC must be computed over the bytes you received. PayPal's docs say not to parse the body and re-stringify it. See Getting the raw request body in 8 frameworks.
- Wrong webhook ID. Sandbox and live are different subscriptions with different IDs, as are separate apps. A signature built with the wrong ID never matches.
- Postback against the wrong environment. A sandbox event checked against
api-m.paypal.com, or the other way round, fails. - Postback with simulator events. Documented as unsupported.
For causes that apply to every provider, such as proxies and clock skew, see Why webhook signature verification fails.
Handling retries
PayPal retries up to 25 times over 3 days (PayPal webhooks), so the same event can arrive more than once. Deduplicate on the event's id field before acting on it, and return 2xx for duplicates. The general pattern is in Handling duplicate webhooks.
Public-key signatures vs HMAC
PayPal signs with an RSA private key and you verify with the public key from its certificate. Most other providers (Stripe, GitHub, Shopify, Standard Webhooks) use HMAC with a shared secret. With public keys, the receiver never holds anything that could forge a message, but you have to get and trust the right key, which is where the certificate URL check above comes in. Webhook authentication methods compared covers the trade-offs in more depth.
If you send webhooks from your own product, Webhook Admin handles signing (Standard Webhooks format), retries and delivery logs: https://app.webhookadmin.com/signup
Quick FAQ
Which verification method should I use?
Self-verification, in most cases. PayPal calls it the preferred option, it adds no network round trip, and it keeps working if the verification API is slow or unavailable. Postback is simpler to write and a reasonable choice for low volume or a quick prototype.
Where do I find the webhook ID?
It's the ID PayPal assigns when you subscribe your listener URL to events, shown with the webhook in your app's settings and returned by the webhooks API. It's specific to that subscription, so sandbox and live, or two apps, have different IDs.
Can I verify events sent from the webhook simulator?
Not with the postback API. PayPal's docs state that mock events don't support postback verification. Test end-to-end verification with real sandbox transactions instead.
Thanks for reading! Do you verify PayPal webhooks with the postback API or locally, and why? Tell us in the comments.
This post first appeared on the Webhook Admin blog.