Skip to main content
Create a webhook endpoint to receive and process event notifications from Fintoc. Before you write code, account for how the endpoint stores events, acknowledges delivery, and handles errors. Read the webhook best practices guide before implementing your endpoint.

Key considerations

Fintoc sends a JSON POST request to every registered webhook endpoint when an event occurs. Parse the event details from the request body. Your webhook endpoint must accept POST requests, process the event data, and return an HTTP status code in the 2xx success range.

Save the received event

Each webhook event from Fintoc has a unique id. Save at least the event id in your application’s database so that you can process duplicate deliveries idempotently.

Return a 2xx response before processing

Your endpoint must return a 2xx HTTP status code to acknowledge receipt. Fintoc treats any other status code as a failed delivery. If Fintoc does not receive a 2xx status code, Fintoc retries the event. Fintoc stops retrying after the final delivery attempt. Return a 2xx status code before running complex logic. Process other webhook logic asynchronously. This pattern prevents HTTP timeouts from triggering retries after your endpoint receives the event.

Test the webhook

Webhook notifications occur only under specific conditions, so bugs in webhook handling can go unnoticed. Test your endpoint when you:
  • Create a webhook endpoint
  • Register a webhook endpoint
  • Make a change that can affect webhook reception

Sample code

Webhook handler
Webhook handler
Webhook handler