Skip to main content

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.

Webhook Overview

Webhooks allow Fype to notify your application when an event occurs in your account. Webhooks are particularly useful for asynchronous events like successful payment captures or processed refunds.

Why Use Webhooks?

While you can poll the Fype API for the status of a payment, webhooks are more efficient and reliable. They allow you to:
  • Fulfill orders immediately after payment.
  • Sync your database with the payment status.
  • Send confirmation emails to customers.
  • Handle edge cases like payments that are completed after a customer closes the browser.

Webhook Lifecycle

  1. Event Occurs: A payment succeeds on the gateway.
  2. Normalization: Fype receives the gateway’s notification and normalizes it into a standard Fype Event.
  3. Delivery: Fype’s webhook worker sends a POST request to your configured URL.
  4. Acknowledgement: Your server should respond with a 200 OK status code.
  5. Retries: If your server is down or returns an error, Fype will retry the delivery with exponential backoff.

Configurable Endpoints

You can configure up to 5 webhook endpoints per environment (Test/Live) in the Developers > Webhooks section of the dashboard.

Payload Structure

Fype sends a JSON payload for every event.
{
  "id": "evt_...",
  "type": "payment.succeeded",
  "created_at": "2024-03-28T10:00:00Z",
  "data": {
    "object": {
      "id": "pay_...",
      "amount": 50000,
      "currency": "INR",
      "status": "succeeded",
      "reference_id": "order_12345",
      "metadata": {}
    }
  }
}

Retry Policy

If delivery fails, Fype retries according to the following schedule:
  • 1st Retry: 1 minute
  • 2nd Retry: 5 minutes
  • 3rd Retry: 30 minutes
  • 4th Retry: 2 hours
  • 5th Retry: 6 hours
After 5 failed attempts, the delivery is marked as failed and no further attempts are made. You can view the failure details in the dashboard.