How to get paypal request id in webhook

90 Views Asked by At

Is it possible to get the PayPal-Request-Id from the API call thru the webhook?

I store the data from the API call in the frontend and do not want to store the data again via the webhook. However, the webhook is needed in case the webhook is triggered by Paypal.com UI.

Currently I match the timestamp in the response header of the API call with the timestamp in the webhook body. Is there a better solution?

1

There are 1 best solutions below

0
Preston PHX On

It depends on what the Webhook event is in regard to. When creating PayPal orders using the v2/checkout/orders API, for example, you can set a unique invoice_id or an arbitrary custom_id for each purchase_unit. These values will be returned in webhooks for that order and resulting captures.