Webhook URL

A webhook is an HTTP endpoint that receives events from Zwitch. Webhooks allow you to be notified about payment events.

You can set up webhooks from your Dashboard and configure separate URLs for live and sandbox modes.

Setup Webhook URL

To set webhooks:

  1. Log into your Zwitch Dashboard and navigate to the Developers section.
  2. Click on the PG API Keys
  3. Inside Developer API, setup your Webhook URLs
  4. Click Save to enable Webhooks.
{
  "amount": "55.30",
  "currency": "INR",
  "mtx": null,
  "attempts": 1,
  "id": "pt_BRgoBYuhcr4Q3Jz",
  "entity": "payment_token",
  "status": "paid",
  "udf": {
    "jithi": "ssss",
    "test": "test"
  },
  "event": "payment_token_paid",
  "payment": {
    "amount": "55.30",
    "currency": "INR",
    "payment_error_code": null,
    "payment_error_description": null,
    "id": "py_BRgoBjah1ICsqXE",
    "entity": "payment",
    "status": "captured",
    "payment_instrument": {
      "entity": "payment_instrument",
      "id": 1000,
      "name": "mock",
      "type_id": 1000,
      "type_name": null
    },
    "customer": {
      "contact_number": "8682008771",
      "email_id": "[email protected]",
      "id": "cs_BRaSbZJUZUQvJUp",
      "entity": "customer"
    },
    "card": {
      "customer_id": "cs_BRaSbZJUZUQvJUp",
      "card_type": "2",
      "card_network": "visa",
      "id": "sb_card_attr_BRetpEQTRDszw27",
      "entity": "card"
    }
  }
}

The table below lists the webhook events available for Payments.

Webhook EventDescription
payment_capturedTriggered when a payment is successfully completed.
payment_failedTriggered when a payment failed
payment_pendingTriggered when a payment is in a pending state
payment_cancelledTriggered when a payment is cancelled
payment_token_createdTriggered when a payment token is created
payment_token_attemptedTriggered when payment for a payment token has been initiated
payment_token_paidTriggered when payment for a payment token has been successful