Documentation Index
Fetch the complete documentation index at: https://docs.fype.dev/llms.txt
Use this file to discover all available pages before exploring further.
Testing & Debugging Webhooks
Webhooks are asynchronous by nature, which can make testing them locally a challenge. Fype provides several tools to help you verify your webhook integration seamlessly.1. Local Development with ngrok
Since Fype’s servers need to reach your local development machine, you must use a tunneling service to expose your local port to the internet.- Install ngrok: Download and install ngrok.
- Expose your port: If your server is running on port
3000, run: - Update fype Dashboard: Copy the
httpsURL provided by ngrok (e.g.,https://random-id.ngrok-free.app) and append your webhook path (e.g.,/webhooks/fype). Add this as a Test Mode webhook endpoint in the Fype Dashboard.
2. The “Trigger Test Webhook” Tool
The Fype Dashboard includes a specialized tool to manually trigger simulated events. This allows you to test your listener without creating a real checkout session.- Go to Developers > Webhooks.
- Ensure you have added a Test Mode endpoint.
- Click the Trigger Test Webhook button.
- Fype will immediately generate a
payment.succeededevent for a dummy payment and enqueue it for delivery to your test endpoints.
3. Simulator Interactive Testing
When using afype_test_... API key, the hosted checkout page renders an Interactive Simulator.
- Initiate a payment and open the
checkout_url. - In the simulator console, click Simulate Success.
- Fype will process the mock payment and trigger a
payment.succeededwebhook to your server. - You can also test error flows by clicking Simulate Card Decline (
payment.failed) or Simulate UPI Timeout.
4. Auditing Delivery Logs
If you are not receiving webhooks, check the Delivery Logs in the Fype Dashboard:- Status Code: View the exact HTTP response code your server returned (e.g.,
200,404,500). - Response Body: See the first 2KB of your server’s response. This is invaluable for debugging internal server errors.
- Latency: Check how long your server took to respond.
- Retry History: Fype retries failed deliveries up to 5 times. You can see the schedule and status of each attempt.
5. Common Issues
Signature Verification Fails
- Raw Body: Ensure you are using the raw request body for HMAC verification. If your framework (like Express or NestJS) parses JSON automatically, you must retrieve the raw buffer before it is parsed.
- Webhook Secret: Verify that the
whsec_...secret in your environment matches the one shown in the Fype Dashboard for that specific endpoint.
403 Forbidden
- ngrok User Agent: Some ngrok configurations block requests without a specific User-Agent. Fype uses
Fype-Webhooks/v1.0. - IP Whitelisting: Ensure your server is not blocking requests from external IPs.
Webhooks arrive out of order
While rare, network latencies can cause webhooks to arrive out of sequence. Always check thecreated_at timestamp in the payload and use the Payment ID to perform idempotent updates.