Hi Rakesh,
This is not complicated think stripe also just like other GET API where it might return the status of payment. For each it will have a trans ID so Implement an idempotency key table to track processed events. Just by using a stored object and a Logic.
For example :
Entity: WebhookEventLog
- EventId (String, Unique indexed)
- Source (String)
- ReceivedOn (DateTime)
- ProcessingStatus (Enum: Received/Processing/Completed/Failed)
Microflow logic: extract EventId from payload, retrieve WebhookEventLog by EventId, if found and Completed return HTTP 200 immediately, if not found create record with Processing status, execute business logic, update to Completed, on error set Failed and return HTTP 500 so the provider retries.
I hope this helps