---
page_source: https://docs.juspay.io/agoda-integration/docs/order/webhooks
page_title: Webhooks
---


# **Webhooks** 



After the completion of every payment/refund call, Juspay will provide direct notification to your server regarding the event. These are called Webhooks. You must configure a valid HTTPS endpoint that is reachable from our servers to consume these notifications. Our servers will push data using HTTPS POST call to your endpoint.

Based on the API version configured in the dashboard, webhooks will be triggered for the events below.

* Payment Success
* Payment Failure
* Refund Success
* Refund failure
* Order Creation
* Transaction Creation
* Refund Moved to Manual Review.
* Chargeback Received
* Chargeback Resolved (In Merchant/ Customer favor)
* Chargeback Cancelled
* Chargeback Refunded
* Chargeback Expired
* Chargeback under review
* Chargeback Evidence Required


#### **Why webhooks?** 



Payment redirection using customers' browsers are not reliable all the time. There would be instances where customers' devices would be on low-quality connections and thereby the final redirection might not succeed. In such cases, a webhook call can help you complete the order for the customer.

But care must be taken while consuming the webhook data. Since you might receive both webhook and customer redirection around the same time, you should not process the order twice. This is true for most cases.

In very rare scenarios, our webhook call pertaining to order might hit your server more than once. This can happen due to network fluctuations. So, care must be taken to ensure that such scenarios are handled too.


#### **Events** 




| Event Name | Description | Webhook API version |
|---|---|---|
| ORDER_SUCCEEDED | Generated when payment is successful for an order | For all the versions |
| ORDER_REFUNDED | Generated when a refund is successful | For all the versions |
| ORDER_FAILED | Generated when an order payment fails | For all the versions >= "2016-07-19" |
| ORDER_REFUND_FAILED | Generated when an order refund fails | For all the versions |
| TXN_CREATED | Generated when payment is initiated for an order | For all the versions >= "2016-10-27" |
| REFUND_MANUAL_REVIEW_NEEDED | Generated when the refund status is ambiguous and the refund has to be manually reconciled by the merchant with the payment processor. | For all the versions |
| REFUND_INITIATED | Generated when refund is initiated for an order | For all the versions |
| AUTO_REFUND_SUCCEEDED | Generated when the transaction is auto refunded and refund is success | For all the versions >= "2019-11-11" |
| AUTO_REFUND_FAILED | Generated when the transaction is auto refunded and refund is failure | For all the versions >= "2019-11-11" |
| MANDATE_CREATED | Generated when the mandate is created | For all the versions |
| MANDATE_ACTIVATED | Generated when the mandate is successful registered | For all the versions |
| MANDATE_FAILED | Generated when the mandate registration fails | For all the versions |
| MANDATE_REVOKED | Generated when the mandate is revoked by the merchant | For all the versions |
| NOTIFICATION_FAILED | Generated when the mandate notification is failed | For all the versions |
| NOTIFICATION_SUCCEEDED | Generated when the mandate notification is success | For all the versions |
| ORDER_AUTHORIZED | Generated for pre-auth enabled transactions when the payment is AUTHORIZED | For all the versions |
| TXN_CHARGED | Transaction level webhook, generated when a transaction become successful | For all the versions >="2020-10-31" |
| TXN_FAILED | Transaction level webhook, generated when a transaction fails | For all the versions >="2020-10-31" |
| CHARGEBACK_RECEIVED | Generated when a chargeback is received | For all the versions >="2020-10-31" |
| CHARGEBACK_RESOLVED_IN_MERCHANT_FAVOUR | Generated when a chargeback is resolved in merchant favor | For all the versions >="2020-10-31" |
| CHARGEBACK_RESOLVED_IN_CUSTOMER_FAVOUR | Generated when a chargeback is resolved in customer favor | For all the versions >="2020-10-31" |
| CHARGEBACK_CANCELED | Generated when a chargeback is cancelled | For all the versions >="2020-10-31" |
| CHARGEBACK_ALREADY_REFUNDED | Generated when a chargeback is already refunded | For all the versions >="2020-10-31" |
| CHARGEBACK_EXPIRED | Generated when a chargeback is expired | For all the versions >="2020-10-31" |
| CHARGEBACK_UNDER_REVIEW | Generated when a chargeback is under review | For all the versions >="2020-10-31" |
| CHARGEBACK_EVIDENCE_REQUIRED | Generated when evidence is required for a raised chargeback | For all the versions >="2020-10-31" |


Webhook API version can be configured in the dashboard > Settings > Webhooks Tab > Webhook API version


#### **Response structure for Webhook** 




#### JSON Code Snippet:

```json
{
  "id": "evt_gsu1c0r7umcfrxeb",
  "date_created": "2015-06-03T10:42:25Z",
  "event_name": "<event_name>",
  "content": {
    "order": {
        /* Complete order data as obtained from /order/:order_id API */
    }
  } 
}

```



#### **Webhook Authentication** 



We support Basic HTTP Authentication for your Webhook URL. Using Username and password fields to authenticate the webhook call is mandatory. Please ensure that special characters like @ are not used in username.


#### **Handling Failures** 




#### If your server is not reachable and we receive a non-200 response when we are attempting webhook notification, we would mark the webhook notified section in our dashboard as False. Hence, consume webhooks on with 200 response code.




#### **You would receive webhook events from the following IPs** 



Production:13.126.232.1335.154.93.24865.2.117.443.110.250.172

Sandbox:52.221.151.24913.228.4.19513.234.141.1653.111.27.223.109.41.51


#### **Caveats:** 



Although our webhooks are reliable, it is always suggested that you use our GetOrderStatus API to poll our systems, in case you do not receive the webhooks in time.

This will handle the cases where the webhooks could not be notified to your system. The threshold beyond which you start polling our system can be decided basis your business use case.



## Sample Code Snippets:
### Payload:

#### ORDER_SUCCEEDED Code Snippet:

```order_succeeded
{
  "id": "evt_V2_b737837102414514ae0e9717a9f2664d",
  "event_name": "ORDER_SUCCEEDED",
  "date_created": "2023-08-10T07:00:48Z",
  "content": {
    "order": {
      "offers": [],
      "txn_id": "ms-sample_ord_200-1",
      "udf7": "FILTERED",
      "payment_method": "VISA",
      "txn_uuid": "moziqFZtYKQkTsRFGXX",
      "metadata": {
        "payment_page_client_id": "FILTERED",
        "merchant_payload": "{\"customerPhone\":\"999999999\",\"customerEmail\":\"1111111\"}",
        "payment_page_sdk_payload": "FILTERED",
        "payment_links": {
          "web": "https://api.juspay.in/orders/ordeh_a9eb2884e4fe4738b70c3d51e6397d34/payment-page",
          "iframe": "https://api.juspay.in/orders/ordeh_a9eb2884e4fe4738b70c3d51e6397d34/payment-page",
          "mobile": "https://api.juspay.in/orders/ordeh_a9eb2884e4fe4738b70c3d51e6397d34/payment-page"
        }
      },
      "udf5": "FILTERED",
      "status_id": 21,
      "amount_refunded": 0,
      "udf9": "FILTERED",
      "status": "CHARGED",
      "bank_error_message": "",
      "id": "ordeh_a9eb2884e4fe4738b70c3d51e6397d34",
      "auth_type": "THREE_DS",
      "udf3": "",
      "udf6": "FILTERED",
      "udf10": "FILTERED",
      "effective_amount": 1,
      "product_id": "",
      "order_id": "sample_ord_200",
      "return_url": "https://shop.merchant.com",
      "payment_gateway_response": {
        "gateway_response": {
          "authCode": "ybbjy9",
          "resMessage": "FILTERED",
          "mandateToken": "FILTERED",
          "resCode": "200"
        },
        "created": "2023-08-10T07:00:48Z",
        "auth_id_code": "ybbjy9"
      },
      "udf1": "",
      "currency": "SGD",
      "udf4": "",
      "customer_id": "FILTERED",
      "date_created": "1111111T07:00:40Z",
      "gateway_id": 100,
      "payment_links": {
        "web": "https://api.juspay.in/merchant/pay/ordeh_a9eb2884e4fe4738b70c3d51e6397d34",
        "iframe": "https://api.juspay.in/merchant/ipay/ordeh_a9eb2884e4fe4738b70c3d51e6397d34",
        "mobile": "https://api.juspay.in/merchant/pay/ordeh_a9eb2884e4fe4738b70c3d51e6397d34?mobile=true"
      },
      "maximum_eligible_refund_amount": "FILTERED",
      "txn_detail": {
        "express_checkout": true,
        "txn_id": "ms-sample_ord_200-1",
        "txn_amount": 1,
        "error_message": "",
        "txn_uuid": "moziqFZtYKQkTsRFGXX",
        "created": "2023-08-10T07:00:46Z",
        "metadata": { "payment_channel": "WEB", "microapp": "hyperpay" },
        "gateway": "DUMMY",
        "status": "CHARGED",
        "net_amount": 1,
        "order_id": "sample_ord_200",
        "currency": "SGD",
        "error_code": "",
        "gateway_id": 100,
        "txn_flow_type": "FILTERED",
        "redirect": true
      },
      "bank_error_code": "",
      "udf8": "FILTERED",
      "payment_method_type": "CARD",
      "customer_phone": "FILTERED",
      "merchant_id": "ms",
      "customer_email": "FILTERED",
      "udf2": "",
      "amount": 1,
      "refunded": false,
      "card": "FILTERED"
    }
  }
}

```

#### ORDER_FAILED Code Snippet:

```order_failed
{
  "id": "evt_V2_f139d51b776541bdbccf6cf49234bc8c",
  "event_name": "ORDER_FAILED",
  "date_created": "2023-08-10T07:19:10Z",
  "content": {
    "order": {
      "offers": [],
      "txn_id": "ms-sample_ord_502-1",
      "udf7": "",
      "payment_method": "VISA",
      "txn_uuid": "mozjMqS7hbYyLR6fdw1",
      "metadata": {
        "payment_page_client_id": "FILTERED",
        "merchant_payload": "{\"customerPhone\":\"999999999\",\"customerEmail\":\"1111111\"}",
        "payment_page_sdk_payload": "FILTERED",
        "payment_links": {
          "web": "https://api.juspay.in/orders/ordeh_3bdee390002446519a8ba483d41e0e7e/payment-page",
          "iframe": "https://api.juspay.in/orders/ordeh_3bdee390002446519a8ba483d41e0e7e/payment-page",
          "mobile": "https://api.juspay.in/orders/ordeh_3bdee390002446519a8ba483d41e0e7e/payment-page"
        }
      },
      "udf5": "",
      "status_id": 27,
      "amount_refunded": 0,
      "udf9": "",
      "gateway_reference_id": null,
      "status": "AUTHORIZATION_FAILED",
      "bank_error_message": "Not sufficient funds",
      "id": "ordeh_3bdee390002446519a8ba483d41e0e7e",
      "auth_type": "THREE_DS",
      "udf3": "",
      "udf6": "",
      "udf10": "",
      "effective_amount": 8,
      "product_id": "",
      "bank_pg": null,
      "order_id": "sample_ord_502",
      "return_url": "https://shop.merchant.com",
      "payment_gateway_response": {
        "txn_id": null,
        "gateway_response": {
          "authCode": "",
          "resMessage": "FILTERED",
          "mandateToken": "",
          "resCode": "03"
        },
        "created": "2023-08-10T07:19:10Z",
        "resp_message": null,
        "resp_code": null,
        "auth_id_code": "",
        "epg_txn_id": null,
        "rrn": null
      },
      "udf1": "",
      "currency": "SGD",
      "udf4": "",
      "customer_id": "FILTERED",
      "date_created": "1111111T07:18:57Z",
      "gateway_id": 100,
      "payment_links": {
        "web": "https://api.juspay.in/merchant/pay/ordeh_3bdee390002446519a8ba483d41e0e7e",
        "iframe": "https://api.juspay.in/merchant/ipay/ordeh_3bdee390002446519a8ba483d41e0e7e",
        "mobile": "https://api.juspay.in/merchant/pay/ordeh_3bdee390002446519a8ba483d41e0e7e?mobile=true"
      },
      "txn_detail": {
        "express_checkout": true,
        "txn_id": "ms-sample_ord_502-1",
        "txn_amount": 8,
        "error_message": "Not sufficient funds",
        "txn_uuid": "mozjMqS7hbYyLR6fdw1",
        "created": "2023-08-10T07:19:07Z",
        "metadata": { "payment_channel": "WEB", "microapp": "hyperpay" },
        "gateway": "DUMMY",
        "status": "AUTHORIZATION_FAILED",
        "net_amount": 8,
        "order_id": "sample_ord_502",
        "currency": "SGD",
        "error_code": "03",
        "gateway_id": 100,
        "surcharge_amount": null,
        "txn_flow_type": "FILTERED",
        "tax_amount": null,
        "redirect": true
      },
      "bank_error_code": "03",
      "udf8": "",
      "payment_method_type": "CARD",
      "rewards_breakup": null,
      "customer_phone": "FILTERED",
      "merchant_id": "ms",
      "customer_email": "FILTERED",
      "udf2": "",
      "amount": 8,
      "refunded": false,
      "card": "FILTERED"
    }
  }
}

```

#### ORDER_REFUNDED Code Snippet:

```order_refunded
{
  "id": "evt_V2_132b474fe46b4518a561ad1aa18b4e42",
  "event_name": "ORDER_REFUNDED",
  "date_created": "2023-08-10T07:49:01Z",
  "content": {
    "order": {
      "offers": [],
      "txn_id": "ms-sample_ord_403-1",
      "udf7": "FILTERED",
      "payment_method": "VISA",
      "txn_uuid": "moz3AaBzkvLbgPY99xi",
      "metadata": {
        "payment_page_client_id": "FILTERED",
        "merchant_payload": "{\"customerPhone\":\"999999999\",\"customerEmail\":\"1111111\"}",
        "payment_page_sdk_payload": "FILTERED",
        "payment_links": {
          "web": "https://api.juspay.in/orders/ordeh_11772e318c124b96ab9791ec3f6b13f8/payment-page",
          "iframe": "https://api.juspay.in/orders/ordeh_11772e318c124b96ab9791ec3f6b13f8/payment-page",
          "mobile": "https://api.juspay.in/orders/ordeh_11772e318c124b96ab9791ec3f6b13f8/payment-page"
        }
      },
      "udf5": "FILTERED",
      "status_id": 21,
      "amount_refunded": 5,
      "udf9": "FILTERED",
      "gateway_reference_id": null,
      "status": "CHARGED",
      "bank_error_message": "",
      "id": "ordeh_11772e318c124b96ab9791ec3f6b13f8",
      "auth_type": "THREE_DS",
      "udf3": "",
      "udf6": "FILTERED",
      "udf10": "FILTERED",
      "effective_amount": 8,
      "product_id": "",
      "bank_pg": null,
      "order_id": "sample_ord_403",
      "return_url": "https://shop.merchant.com",
      "payment_gateway_response": {
        "txn_id": null,
        "gateway_response": {
          "authCode": "ef9cyl",
          "resMessage": "FILTERED",
          "mandateToken": "FILTERED",
          "resCode": "00"
        },
        "created": "2023-08-10T07:21:11Z",
        "resp_message": null,
        "resp_code": null,
        "auth_id_code": "ef9cyl",
        "epg_txn_id": null,
        "rrn": null
      },
      "udf1": "",
      "currency": "SGD",
      "udf4": "",
      "customer_id": "FILTERED",
      "date_created": "1111111T07:21:01Z",
      "gateway_id": 100,
      "payment_links": {
        "web": "https://api.juspay.in/merchant/pay/ordeh_11772e318c124b96ab9791ec3f6b13f8",
        "iframe": "https://api.juspay.in/merchant/ipay/ordeh_11772e318c124b96ab9791ec3f6b13f8",
        "mobile": "https://api.juspay.in/merchant/pay/ordeh_11772e318c124b96ab9791ec3f6b13f8?mobile=true"
      },
      "maximum_eligible_refund_amount": "FILTERED",
      "txn_detail": {
        "express_checkout": true,
        "txn_id": "ms-sample_ord_403-1",
        "txn_amount": 8,
        "error_message": "",
        "txn_uuid": "moz3AaBzkvLbgPY99xi",
        "created": "2023-08-10T07:21:08Z",
        "metadata": { "payment_channel": "WEB", "microapp": "hyperpay" },
        "gateway": "DUMMY",
        "status": "CHARGED",
        "net_amount": 8,
        "order_id": "sample_ord_403",
        "currency": "SGD",
        "error_code": "",
        "gateway_id": 100,
        "surcharge_amount": "FILTERED",
        "txn_flow_type": "FILTERED",
        "tax_amount": "FILTERED",
        "redirect": true
      },
      "bank_error_code": "",
      "udf8": "FILTERED",
      "payment_method_type": "CARD",
      "rewards_breakup": "FILTERED",
      "customer_phone": "FILTERED",
      "merchant_id": "ms",
      "customer_email": "FILTERED",
      "udf2": "",
      "amount": 8,
      "refunded": false,
      "refunds": [
        {
          "error_message": "Refund Success",
          "unique_request_id": "erf_b0c764a743c4221b",
          "created": "2023-08-10T07:22:01Z",
          "status": "SUCCESS",
          "id": null,
          "refund_type": "STANDARD",
          "pg_processed_at": "FILTERED",
          "sent_to_gateway": true,
          "refund_source": "DUMMY",
          "ref": "55430487",
          "error_code": "00",
          "amount": 5,
          "initiated_by": "ms"
        }
      ],
      "card": "FILTERED"
    }
  }
}

```

#### TXN_CREATED Code Snippet:

```txn_created
{
  "id": "evt_V2_324dc6e110914184a1c764923e14ccde",
  "event_name": "TXN_CREATED",
  "date_created": "2023-08-10T07:00:46Z",
  "content": {
    "order": {
      "offers": [],
      "txn_id": "ms-sample_ord_200-1",
      "udf7": "",
      "payment_method": "VISA",
      "txn_uuid": "moziqFZtYKQkTsRFGXX",
      "metadata": {
        "payment_page_client_id": "FILTERED",
        "merchant_payload": "{\"customerPhone\":\"999999999\",\"customerEmail\":\"1111111\"}",
        "payment_page_sdk_payload": "FILTERED",
        "payment_links": {
          "web": "https://api.juspay.in/orders/ordeh_a9eb2884e4fe4738b70c3d51e6397d34/payment-page",
          "iframe": "https://api.juspay.in/orders/ordeh_a9eb2884e4fe4738b70c3d51e6397d34/payment-page",
          "mobile": "https://api.juspay.in/orders/ordeh_a9eb2884e4fe4738b70c3d51e6397d34/payment-page"
        }
      },
      "udf5": "",
      "status_id": 23,
      "amount_refunded": 0,
      "udf9": "",
      "gateway_reference_id": null,
      "status": "PENDING_VBV",
      "bank_error_message": "",
      "id": "ordeh_a9eb2884e4fe4738b70c3d51e6397d34",
      "auth_type": "THREE_DS",
      "udf3": "",
      "udf6": "",
      "udf10": "",
      "effective_amount": 1,
      "product_id": "",
      "bank_pg": null,
      "order_id": "sample_ord_200",
      "return_url": "https://shop.merchant.com",
      "udf1": "",
      "currency": "SGD",
      "udf4": "",
      "customer_id": "FILTERED",
      "date_created": "1111111T07:00:40Z",
      "gateway_id": 100,
      "payment_links": {
        "web": "https://api.juspay.in/merchant/pay/ordeh_a9eb2884e4fe4738b70c3d51e6397d34",
        "iframe": "https://api.juspay.in/merchant/ipay/ordeh_a9eb2884e4fe4738b70c3d51e6397d34",
        "mobile": "https://api.juspay.in/merchant/pay/ordeh_a9eb2884e4fe4738b70c3d51e6397d34?mobile=true"
      },
      "txn_detail": {
        "express_checkout": true,
        "txn_id": "ms-sample_ord_200-1",
        "txn_amount": 1,
        "error_message": "",
        "txn_uuid": "moziqFZtYKQkTsRFGXX",
        "created": "2023-08-10T07:00:46Z",
        "metadata": { "payment_channel": "WEB", "microapp": "hyperpay" },
        "gateway": "DUMMY",
        "status": "PENDING_VBV",
        "net_amount": 1,
        "order_id": "sample_ord_200",
        "currency": "SGD",
        "error_code": null,
        "gateway_id": 100,
        "surcharge_amount": null,
        "txn_flow_type": "FILTERED",
        "tax_amount": null,
        "redirect": true
      },
      "bank_error_code": "",
      "udf8": "",
      "payment_method_type": "CARD",
      "rewards_breakup": null,
      "customer_phone": "FILTERED",
      "merchant_id": "ms",
      "customer_email": "FILTERED",
      "udf2": "",
      "amount": 1,
      "refunded": false,
      "card": "FILTERED"
    }
  }
}

```

#### NOTIFICATION_SUCCEEDED Code Snippet:

```notification_succeeded
{
  "id": "evt_V2_9380da4b07e74b6792f3fe23ed84a75f",
  "event_name": "NOTIFICATION_SUCCEEDED",
  "date_created": "2023-08-10T10:48:09Z",
  "content": {
    "notification": {
      "object": "notification",
      "last_updated": "1691664489",
      "provider_name": "FILTERED",
      "status": "SUCCESS",
      "id": "24307339",
      "mandate": { "mandate_id": "ii76ncZXa2tceXdeyCFqaM" },
      "source_object": "MANDATE",
      "date_created": "1691662587",
      "notification_type": "FILTERED",
      "source_info": { "txn_date": "1691818137", "amount": "1.0" },
      "provider_response": "FILTERED",
      "object_reference_id": "sCh7ihFFGLJKayCW"
    }
  }
}

```

#### AUTO_REFUND_FAILED Code Snippet:

```auto_refund_failed
{
  "id": "evt_V2_9380da4b07e74b6792f3fe23ed84a75f",
  "event_name": "AUTO_REFUND_FAILED",
  "date_created": "2023-08-08T15:02:10Z",
  "content": {
    "order": {
      "offers": [],
      "txn_id": "ms-sampleorder507-1",
      "udf7": "FILTERED",
      "payment_method": "VISA",
      "txn_uuid": "mozttEAm8Kgi93oKc9H",
      "metadata": {
        "payment_page_client_id": "FILTERED",
        "merchant_payload": "{\"customerPhone\":\"999999999\",\"customerEmail\":\"1111111\"}",
        "payment_page_sdk_payload": "FILTERED",
        "payment_links": {
          "web": "https://api.juspay.in/orders/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0/payment-page",
          "iframe": "https://api.juspay.in/orders/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0/payment-page",
          "mobile": "https://api.juspay.in/orders/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0/payment-page"
        }
      },
      "udf5": "FILTERED",
      "resp_message": null,
      "status_id": 36,
      "resp_code": null,
      "amount_refunded": 0,
      "udf9": "FILTERED",
      "gateway_reference_id": null,
      "status": "AUTO_REFUNDED",
      "bank_error_message": "",
      "id": "ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0",
      "auth_type": "THREE_DS",
      "udf3": "",
      "udf6": "FILTERED",
      "udf10": "FILTERED",
      "effective_amount": 1000,
      "product_id": "",
      "order_id": "sampleorder507",
      "return_url": "https://shop.merchant.com",
      "payment_gateway_response": {
        "txn_id": "ms-sampleorder507-1",
        "discount_amount": 0,
        "created": "2023-08-04T14:42:48Z",
        "resp_message": "No Error",
        "resp_code": "success",
        "auth_id_code": "056904",
        "epg_txn_id": "18775434620",
        "rrn": "202238567896952"
      },
      "udf1": "",
      "currency": "SGD",
      "udf4": "",
      "customer_id": "FILTERED",
      "date_created": "RIPPIFILTEREDT14:32:05Z",
      "gateway_id": 12,
      "payment_links": {
        "web": "https://api.juspay.in/orders/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0/payment-page",
        "iframe": "https://api.juspay.in/orders/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0/payment-page",
        "mobile": "https://api.juspay.in/orders/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0/payment-page"
      },
      "txn_detail": {
        "express_checkout": true,
        "txn_id": "ms-sampleorder507-1",
        "txn_amount": 1000,
        "error_message": "",
        "txn_uuid": "mozttEAm8Kgi93oKc9H",
        "created": "2023-08-04T14:32:08Z",
        "metadata": { "payment_channel": "ANDROID", "microapp": "hyperpay" },
        "gateway": "ADYEN",
        "status": "AUTO_REFUNDED",
        "offer_deduction_amount": "FILTERED",
        "net_amount": 1000,
        "order_id": "sampleorder507",
        "currency": "SGD",
        "error_code": null,
        "gateway_id": 12,
        "surcharge_amount": "FILTERED",
        "txn_flow_type": "FILTERED",
        "tax_amount": "FILTERED",
        "redirect": true
      },
      "bank_error_code": "",
      "udf8": "FILTERED",
      "payment_method_type": "CARD",
      "customer_phone": "FILTERED",
      "merchant_id": "ms",
      "customer_email": "FILTERED",
      "udf2": "",
      "amount": 1000,
      "refunded": false,
      "refunds": [
        {
          "error_message": "Refund FAILURE - Invalid amount",
          "unique_request_id": "ARghg65FGvyv",
          "created": "2023-08-04T14:42:48Z",
          "status": "FAILURE",
          "previous_attempts": "FILTERED",
          "id": "ARghg65FGvyv_4",
          "refund_type": "STANDARD",
          "sent_to_gateway": true,
          "refund_source": "ADYEN",
          "ref": null,
          "error_code": "105",
          "pg_declined_at": "FILTERED",
          "amount": 1000,
          "initiated_by": "AUTO_REFUNDED"
        }
      ],
      "card": "FILTERED"
    }
  }
}

```

#### AUTO_REFUND_SUCCEEDED Code Snippet:

```auto_refund_succeeded
{
  "id": "evt_V2_c911db219e6845ce9c6b551b9e88cbc4",
  "event_name": "AUTO_REFUND_SUCCEEDED",
  "date_created": "2023-08-10T07:31:14Z",
  "content": {
    "order": {
      "offers": [],
      "txn_id": "ms-sample_ord_408-1",
      "udf7": "",
      "payment_method": "VISA",
      "txn_uuid": "mozttEAm8Kgi93oKc9H",
      "metadata": {
        "payment_page_client_id": "FILTERED",
        "merchant_payload": "{\"customerPhone\":\"999999999\",\"customerEmail\":\"1111111\"}",
        "payment_page_sdk_payload": "FILTERED",
        "payment_links": {
          "web": "https://api.juspay.in/orders/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0/payment-page",
          "iframe": "https://api.juspay.in/orders/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0/payment-page",
          "mobile": "https://api.juspay.in/orders/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0/payment-page"
        }
      },
      "udf5": "",
      "status_id": 36,
      "amount_refunded": 8,
      "udf9": "",
      "gateway_reference_id": null,
      "status": "AUTO_REFUNDED",
      "bank_error_message": "",
      "id": "ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0",
      "auth_type": "THREE_DS",
      "udf3": "",
      "udf6": "",
      "udf10": "",
      "effective_amount": 8,
      "product_id": "",
      "bank_pg": null,
      "order_id": "sample_ord_408",
      "return_url": "https://shop.merchant.com",
      "payment_gateway_response": {
        "txn_id": "ms-sample_ord_408-1",
        "gateway_response": {
          "entity": "payment",
          "tax": "0",
          "method": "card",
          "email": "FILTERED",
          "contact": "FILTERED",
          "acquirer_data": "",
          "card_id": "FILTERED",
          "amount_refunded": "0",
          "international": "false",
          "status": "captured",
          "description": "Complete your payment",
          "fee": "16",
          "id": "pay_MOHZEUxFDkXEZt",
          "created_at": "1691652335",
          "order_id": "order_MOHZDyrc5ryXX6",
          "currency": "SGD",
          "notes": "",
          "auth_code": "FILTERED",
          "amount": "800",
          "captured": "true"
        },
        "debit_amount": "8.0",
        "created": "2023-08-10T07:27:11Z",
        "resp_message": "",
        "resp_code": "captured",
        "auth_id_code": "106027",
        "epg_txn_id": "pay_MOHZEUxFDkXEZt",
        "rrn": "106027"
      },
      "udf1": "",
      "currency": "SGD",
      "udf4": "",
      "customer_id": "FILTERED",
      "date_created": "1111111T07:24:53Z",
      "gateway_id": 23,
      "payment_links": {
        "web": "https://api.juspay.in/merchant/pay/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0",
        "iframe": "https://api.juspay.in/merchant/ipay/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0",
        "mobile": "https://api.juspay.in/merchant/pay/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0?mobile=true"
      },
      "txn_detail": {
        "express_checkout": true,
        "txn_id": "ipec-sample_ord_408-1",
        "txn_amount": 8,
        "error_message": "",
        "txn_uuid": "mozttEAm8Kgi93oKc9H",
        "created": "2023-08-10T07:25:34Z",
        "metadata": { "payment_channel": "WEB", "microapp": "hyperpay" },
        "gateway": "STRIPE",
        "status": "AUTO_REFUNDED",
        "net_amount": 8,
        "order_id": "sample_ord_408",
        "currency": "SGD",
        "error_code": "",
        "gateway_id": 23,
        "surcharge_amount": null,
        "txn_flow_type": "FILTERED",
        "tax_amount": null,
        "redirect": true
      },
      "bank_error_code": "",
      "udf8": "",
      "payment_method_type": "CARD",
      "rewards_breakup": null,
      "customer_phone": "FILTERED",
      "merchant_id": "ms",
      "customer_email": "FILTERED",
      "udf2": "",
      "amount": 8,
      "refunded": true,
      "refunds": [
        {
          "error_message": "processed",
          "unique_request_id": "ARumRQpjqqLcXTm6",
          "created": "2023-08-10T07:27:11Z",
          "metadata": {
            "speed_requested": "normal",
            "speed_processed": "normal"
          },
          "status": "SUCCESS",
          "id": "ARumRQpjqqLcXTm6",
          "refund_type": "STANDARD",
          "pg_processed_at": "FILTERED",
          "sent_to_gateway": true,
          "refund_source": "STRIPE",
          "ref": "rfnd_MOHfB6QJrn3i4K",
          "error_code": "processed",
          "amount": 8,
          "initiated_by": "AUTO_REFUNDED"
        }
      ],
      "card": "FILTERED"
    }
  }
}

```

#### ORDER_REFUND_FAILED Code Snippet:

```order_refund_failed
{
  "id": "evt_V2_9380da4b07e74b6792f3fe23ed84a75f",
  "event_name": "ORDER_REFUND_FAILED",
  "date_created": "2023-08-10T10:48:01Z",
  "content": {
    "order": {
      "offers": [],
      "txn_id": "ms-sampleorder608-1",
      "udf7": "",
      "payment_method": "UPI",
      "txn_uuid": "mozttEAm8Kgi93oKc9H",
      "metadata": {
        "payment_page_client_id": "FILTERED",
        "payment_links": {
          "web": "https://api.juspay.in/orders/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0/payment-page",
          "iframe": "https://api.juspay.in/orders/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0/payment-page",
          "mobile": "https://api.juspay.in/orders/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0/payment-page"
        }
      },
      "udf5": "",
      "status_id": 21,
      "amount_refunded": 0,
      "udf9": "",
      "gateway_reference_id": null,
      "status": "CHARGED",
      "bank_error_message": "",
      "id": "ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0",
      "auth_type": "",
      "udf3": "",
      "udf6": "",
      "udf10": "",
      "effective_amount": 86,
      "product_id": "",
      "bank_pg": null,
      "order_id": "sampleorder608",
      "return_url": "https://shop.merchant.com",
      "payment_gateway_response": {
        "txn_id": "ms-sampleorder507-1",
        "created": "2023-07-24T03:33:59Z",
        "resp_message": "Your payment is successful.",
        "resp_code": "PAYMENT_SUCCESS",
        "auth_id_code": "NA",
        "epg_txn_id": "18775434620",
        "rrn": "202238567896952"
      },
      "udf1": "",
      "currency": "SGD",
      "udf4": "",
      "customer_id": "FILTERED",
      "date_created": "1111111T03:33:43Z",
      "gateway_id": 39,
      "upi": "FILTERED",
      "payment_links": {
        "web": "https://api.juspay.in/merchant/pay/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0",
        "iframe": "https://api.juspay.in/merchant/ipay/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0",
        "mobile": "https://api.juspay.in/merchant/pay/ordeh_c5ce7ae7e09f4576a9f3d59e9dc51db0?mobile=true"
      },
      "maximum_eligible_refund_amount": "FILTERED",
      "txn_detail": {
        "express_checkout": false,
        "txn_id": "ms-sampleorder608-1",
        "txn_amount": 86,
        "error_message": "",
        "txn_uuid": "mozttEAm8Kgi93oKc9H",
        "created": "2023-07-24T03:33:44Z",
        "gateway": "PHONEPE",
        "status": "CHARGED",
        "net_amount": 86,
        "order_id": "sampleorder608",
        "currency": "SGD",
        "error_code": "",
        "gateway_id": 39,
        "surcharge_amount": null,
        "txn_flow_type": "FILTERED",
        "tax_amount": null,
        "redirect": true
      },
      "bank_error_code": "",
      "udf8": "",
      "payment_method_type": "UPI",
      "customer_phone": "FILTERED",
      "merchant_id": "ms",
      "customer_email": "FILTERED",
      "udf2": "",
      "amount": 86,
      "payer_app_name": "FILTERED",
      "refunded": false,
      "refunds": [
        {
          "error_message": "",
          "unique_request_id": "ARghg65FGvyv",
          "created": "2023-07-28T06:45:22Z",
          "status": "FAILURE",
          "id": "ARghg65FGvyv",
          "refund_type": "STANDARD",
          "sent_to_gateway": true,
          "refund_source": "PHONEPE",
          "ref": null,
          "amount": 86,
          "initiated_by": "API"
        }
      ]
    }
  }
}

```

#### REFUND_MANUAL_REVIEW_NEEDED Code Snippet:

```refund_manual_review_needed
{
    "id": "evt_V2_1750c1958ed71230991e6740c18af364",
    "event_name": "REFUND_MANUAL_REVIEW_NEEDED",
    "date_created": "2022-04-19T13:48:53Z",
    "content": {
      "order": {
        "upi": "FILTERED",
        "udf9": "",
        "udf8": "",
        "udf7": "",
        "udf6": "",
        "udf5": "",
        "udf4": "",
        "udf3": "",
        "udf2": "",
        "udf10": "",
        "udf1": "",
        "txn_uuid": "eulviSepTWDcTYtbZsE",
        "txn_id": "confirm-ctkt174582939-1",
        "txn_detail": {
          "txn_uuid": "eulviSepTWDcTYtbZsE",
          "txn_id": "confirm-ctkt174582939-1",
          "txn_amount": "1551",
          "tax_amount": null,
          "surcharge_amount": null,
          "status": "CHARGED",
          "redirect": false,
          "order_id": "ctkt174582939",
          "net_amount": "1551",
          "gateway_id": "19",
          "gateway": "OVO",
          "express_checkout": false,
          "error_message": "",
          "error_code": "",
          "currency": "SGD",
          "created": "2022-03-16T03:33:05Z"
        },
        "status_id": "21",
        "status": "CHARGED",
        "return_url": "https://securedapi.confirm.com/api/platform/booking/jusparedirectgetpayment",
        "refunds": [
          {
            "unique_request_id": "recan17458293944531",
            "status": "MANUAL_REVIEW",
            "sent_to_gateway": "true",
            "ref": "2.0220408111212802e+34",
            "initiated_by": "API",
            "id": null,
            "error_message": "Refund request was raised for this transaction. But it is pending state.",
            "created": "2022-04-08T13:38:16Z",
            "amount": "1476"
          },
          {
            "unique_request_id": "w8ctkt174582939",
            "status": "SUCCESS",
            "sent_to_gateway": "true",
            "ref": "2.02203221112128e+34",
            "initiated_by": "API",
            "id": null,
            "error_message": "Refund Successfull",
            "created": "2022-03-22T14:38:19Z",
            "arn": "208175367883",
            "amount": "75"
          }
        ],
        "refunded": "true",
        "product_id": "",
        "payment_method_type": "UPI",
        "payment_method": "UPI",
        "payment_links": {
          "web": "https://api.juspay.in/merchant/pay/ordeh_61006772743a45b78725fe8a77fdecb5",
          "mobile": "FILTERED",
          "iframe": "https://api.juspay.in/merchant/ipay/ordeh_61006772743a45b78725fe8a77fdecb5"
        },
        "payment_gateway_response": {
          "txn_id": "confirm-ctkt174582939-1",
          "rrn": "207506348187",
          "resp_message": "Txn Success",
          "resp_code": "01",
          "epg_txn_id": "2.02203161112128e+34",
          "created": "2022-03-16T03:33:20Z",
          "auth_id_code": ""
        },
        "payer_app_name": "FILTERED",
        "order_id": "ctkt174582939",
        "offers": [],
        "merchant_id": "confirm",
        "id": "ordeh_61006772743a45b78725fe8a77fdecb5",
        "gateway_reference_id": null,
        "gateway_id": "19",
        "effective_amount": "1551",
        "date_created": "2022-03-16T03:33:01Z",
        "customer_phone": "FILTERED",
        "customer_id": "FILTERED",
        "customer_email": "FILTERED",
        "currency": "SGD",
        "bank_pg": null,
        "bank_error_message": "",
        "bank_error_code": "",
        "auth_type": "",
        "amount_refunded": "1551",
        "amount": "1551"
      }
    }
  }
  
```

#### MANDATE_CREATED Code Snippet:

```mandate_created
{
  "id": "evt_V2_14596cec6cd34c6380212cc3115030cb",
  "event_name": "MANDATE_CREATED",
  "date_created": "2023-08-16T09:02:30Z",
  "content": {
    "mandate": {
      "amount_rule": "VARIABLE",
      "last_updated": "2023-08-16T09:01:59Z",
      "frequency": "ASPRESENTED",
      "status": "CREATED",
      "revokable_by_customer": true,
      "order_id": "ord_1692176519ms",
      "end_date": "1789934557",
      "start_date": "1692169687",
      "currency": "SGD",
      "customer_id": "FILTERED",
      "payment_info": "FILTERED",
      "block_fund": false,
      "max_amount": 100,
      "mandate_type": "MANDATE",
      "mandate_id": "c1ZJDKT3YXUhxubgKhkom8",
      "mandate_token": "FILTERED"
    }
  }
}

```

#### ORDER_SUCCEEDED (MANDATE) Code Snippet:

```order_succeeded (mandate)
{
  "event_name": "ORDER_SUCCEEDED",
  "content": {
    "order": {
      "card": "FILTERED",
      "amount_debited": "FILTERED",
      "order_id": "lnbkvv3s8A5K1I55ITPE",
      "udf3": "",
      "status": "CHARGED",
      "amount": 21769.17,
      "auth_type": "THREE_DS",
      "refunded": false,
      "udf8": "",
      "udf5": "",
      "payment_method": "VISA",
      "gateway_id": 12,
      "udf2": "",
      "payment_method_type": "CARD",
      "txn_uuid": "mozwZCrzTP4WgteKRzU",
      "udf4": "",
      "customer_id": "FILTERED",
      "udf10": "",
      "mandate": {
        "frequency": "ASPRESENTED",
        "end_date": "1885802446",
        "amount_rule": "VARIABLE",
        "mandate_status": "ACTIVE",
        "start_date": "1696413646",
        "mandate_id": "vLUjfH7KRSQDD4eF86e",
        "block_fund": false,
        "max_amount": 43538.34,
        "mandate_token": "FILTERED",
        "revokable_by_customer": true,
        "mandate_type": "MANDATE"
      },
      "bank_pg": "CC-PG",
      "payment_links": {
        "web": "https://api.juspay.in/merchant/pay/ordeu_9a0929803da644df8036133cf14d0206"
      },
      "effective_amount": 21769.17,
      "udf1": "",
      "payment_gateway_response": {
        "auth_id_code": "581413",
        "created": "2023-10-04T10:02:07Z",
        "rrn": "6964137267756367306957",
        "gateway_response": {
          "udf3": "",
          "status": "success",
          "txnid": "lnbkvv3s8A5K1I55ITPE-1",
          "additional_charges": "FILTERED",
          "transaction_amount": "21769.17",
          "udf5": "",
          "error_code": "E000",
          "udf2": "",
          "amt": "21769.17",
          "payment_source": "sist",
          "request_id": "",
          "card_type": "VISA",
          "mode": "CC",
          "udf4": "",
          "udf1": "",
          "mihpayid": "18264260772",
          "bank_ref_num": "6964137267756367306957",
          "addedon": "2023-10-04 15:31:49",
          "Settled_At": "0000-00-00 00:00:00",
          "error_Message": "NO ERROR",
          "unmappedstatus": "captured",
          "card_no": "FILTERED",
          "disc": "0.00",
          "firstname": "FILTERED",
          "productinfo": "",
          "net_amount_debit": 21769.17,
          "PG_TYPE": "CC-PG",
          "field2": "FILTERED",
          "bankcode": "CC",
          "field9": "Transaction is Successful"
        },
        "epg_txn_id": "18264260772",
        "txn_id": "lnbkvv3s8A5K1I55ITPE-1",
        "resp_message": "Transaction is Successful",
        "resp_code": "success"
      },
      "product_id": "",
      "txn_detail": {
        "order_id": "lnbkvv3s8A5K1I55ITPE",
        "status": "CHARGED",
        "net_amount": 21769.17,
        "source_object": "MANDATE",
        "error_code": "",
        "gateway_id": 12,
        "surcharge_amount": null,
        "txn_uuid": "mozwZCrzTP4WgteKRzU",
        "gateway": "STRIPE",
        "created": "2023-10-04T10:01:48Z",
        "tax_amount": null,
        "txn_amount": 21769.17,
        "error_message": "",
        "txn_object_type": "FILTERED",
        "currency": "SGD",
        "redirect": true,
        "metadata": {
          "payment_channel": "ANDROID"
        },
        "source_object_id": "FILTERED",
        "express_checkout": false,
        "txn_id": "lnbkvv3s8A5K1I55ITPE-1",
        "txn_flow_type": "CARD_TRANSACTION"
      },
      "amount_refunded": 0,
      "customer_email": "FILTERED",
      "currency": "SGD",
      "customer_phone": "FILTERED",
      "bank_error_message": "",
      "id": "ordeu_9a2b2895e7434ba4b79476f8cfa1e3f9",
      "txn_id": "lnbkvv3s8A5K1I55ITPE-1",
      "merchant_id": "merchant",
      "maximum_eligible_refund_amount": "FILTERED",
      "udf7": "",
      "date_created": "2023-10-04T10:01:48Z",
      "bank_error_code": "",
      "offers": [],
      "udf9": "",
      "gateway_reference_id": "TRAIN",
      "return_url": "https://api.juspay.in",
      "status_id": 21,
      "udf6": ""
    }
  },
  "id": "evt_V2_afe82ee8a4224208ae23288610764db1",
  "date_created": "2023-10-04T10:02:10Z"
}

```

