---
page_title: Cred Offers
product: OFFER ENGINE
page_source: https://juspay.io/in/docs/offer-engine/docs/issuer-offers/cred-offers
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/offer-engine/llms.txt
---


# Cred Offers 




## Introduction



Juspay's Offer Engine is integrated with payment partners (CRED) that empowers merchants to promote bank offers along with CRED sponsored offers. Offer engine seamlessly performs eligibility checks with CRED for a customer and displays customized offers on the checkout page without disrupting existing offers for merchants. This integration will allow Cred to sponsor offers, verify customer eligibility, and allot cashback directly without requiring any changes from merchants already using Juspay’s Offers Module. 


## Architecture Diagram



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/offer-engine/Screenshot%202024-10-03%20at%206.35.40%E2%80%AFPM.png)




## Advantages:



* **Seamless Integration** : No need for merchants to change their existing setup.
* **Enhanced Offer Management** : Cred can sponsor offers and ensure eligibility directly.
* **Efficient Processing** : Juspay handles all eligibility checks internally, simplifying the workflow for merchants and Cred.
* **Improved User Experience** : Lower dropouts leading to a better experience for customers and merchants.


## Pre-Requisites



* Merchant must be using **Juspay Offer Engine**
* Procure **Cred offer details**  from Cred for offer configuration on the Juspay Offers dashboard.


## Sample UIs with Cred Offer:



Cred Offer can be displayed on payment page as a banner or text. 

* **Display of Cred Offers on the Payment page as a banner**

![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/offer-engine/Screenshot%202024-10-03%20at%206.53.41%E2%80%AFPM.png)



* **Cred Offer on Quickpay Screen**

![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/offer-engine/Issuer%20Offer.png)




## Cred Offer Configuration



* Configure Cred offers under **Offer Configuration**  section on the Juspay Offers dashboard.
  
  [Login to Offers Dashboard](https://portal.juspay.in/offers)→ Offers Configuration
* Ensure that **CRED**  is selected as Partner under the **Issuer Details**  tab during offer configuration

---

## Integration type : Juspay HyperCheckout (Payment Page)


### Step 1.1. Configuration of Cred offer without any current offers


[Video](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/offer-engine/Screen%20Recording%202024-10-23%20at%203.11.27%E2%80%AFPM.mov)






### Step 1.1. Cred offer as Add-on Offer


[Video](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/offer-engine/Screen%20Recording%202024-10-23%20at%203.29.35%E2%80%AFPM.mov)






## Integration Changes and Workflow




###                                                                  Substep


**Integration Changes:** 

No changes required wrt Integration. 

**Work Flow:** 

* Juspay internally enables the Cred related configurations internally and notify via email.
* Configure Cred offer on Juspay dashboard.
* Juspay internally calls the Cred eligibility API to determine if the user's mobile number provided in the Juspay session API/ Transaction payload, is eligible for the Cred offer. If eligible, the Cred offer will be displayed on the payment page.
* Once the user performs the Cred offer transaction and is successfull, Juspay will send the offer status in order status response.
* CRED will process the cashback to the user.

> **Note**
> * For Sandbox/UAT testing, the mobile number used for Cred eligibility must be whitelisted on Cred's end.
> * During UAT testing, test the Cred Offer on CUG using your app/website pointed to Juspay Sandbox.
>   
>   * CUG testing guide: [Link](https://juspay.io/in/docs/offer-engine/docs/issuer-offers/cug-testing)



**Sample Webhooks and Order Status:** 


#### Webhook - ORDER_SUCCEEDED Code Snippet:

```webhook - order_succeeded
{
  "event_name": "ORDER_SUCCEEDED",
  "content": {
    "order": {
      "payer_app_name": "com.dreamplug.androidapp",
      "payment_method": "UPI",
      "customer_phone": "FILTERED",
      "payment_gateway_response": {
        "auth_ref_num": null,
        "network_error_message": null,
        "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
        "rrn": "427790400212",
        "auth_id_code": "NA",
        "resp_message": "Your payment is successful.",
        "epg_txn_id": "T2410030244552630",
        "gateway_merchant_id": null,
        "resp_code": "SUCCESS",
        "created": "2024-10-03T05:31:53Z",
        "eci": null,
        "network_error_code": null,
        "arn": null
      },
      "udf8": "",
      "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
      "order_id": "M37CYBLQO2DXAQ",
      "gateway_reference_id": null,
      "maximum_eligible_refund_amount": 87,
      "udf9": "",
      "txn_detail": {
        "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
        "order_id": "M37CYBLQO2DXAQ",
        "error_code": null,
        "txn_flow_type": "INTENT",
        "status": "CHARGED",
        "express_checkout": false,
        "gateway_id": 39,
        "error_message": "",
        "offer_deduction_amount": 0,
        "tax_amount": null,
        "currency": "INR",
        "txn_amount_breakup": [
          {
            "amount": 287,
            "method": "ADD",
            "sno": "FILTERED",
            "name": "BASE"
          },
          {
            "amount": 0,
            "method": "SUBTRACT",
            "sno": "FILTERED",
            "name": "OFFER"
          }
        ],
        "txn_amount": 287,
        "created": "2024-10-03T05:31:37Z",
        "gateway": "PHONEPE",
        "surcharge_amount": null,
        "last_updated": "2024-10-03T05:31:53Z",
        "txn_uuid": "mozaTMcYHqxrY",
        "net_amount": 287,
        "redirect": true,
        "metadata": {
          "payment_channel": "ANDROID"
        }
      },
      "customer_id": "133680452",
      "amount": 287,
      "udf4": "",
      "status": "CHARGED",
      "udf5": "",
      "udf6": "",
      "status_id": 21,
      "offers": [
        {
          "offer_code": "CREDUPI2024",
          "offer_id": "743855cf-3eeea0aa632e",
          "status": "AVAILED",
          "benefits": [
            {
              "amount": 0,
              "type": "CASHBACK",
              "calculation_info": {
                "calculation_rule": "ABSOLUTE",
                "value": 0
              }
            }
          ],
          "metadata": "{\"minimum_order_amount\":\"200.00\"}"
        }
      ],
      "udf7": "",
      "resp_message": null,
      "product_id": "",
      "refunded": false,
      "udf10": "",
      "gateway_id": 39,
      "udf1": "enable",
      "udf2": "headlessAndroid",
      "udf3": "",
      "date_created": "2024-10-03T05:31:36Z",
      "id": "ordeh_c21d084368755d24388152d",
      "merchant_id": "Merchant",
      "return_url": "https://www.Merchant.com/mcheckout/orderStatus",
      "effective_amount": 287,
      "currency": "INR",
      "auth_type": "",
      "customer_email": "1111111",
      "resp_code": null,
      "upi": {
        "txn_flow_type": "INTENT",
        "payer_app": "com.dreamplug.androidapp"
      },
      "payment_method_type": "UPI",
      "last_updated": "2024-10-03T05:31:53Z",
      "txn_uuid": "mozaTMcYHqxrY",
      "resp_category": null,
      "payment_links": {
        "mobile": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
        "web": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
        "iframe": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d"
      },
      "amount_refunded": 0,
      "bank_error_code": "",
      "metadata": {
        "payment_page_client_id": "Merchant",
        "payment_links": {
          "mobile": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
          "web": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
          "iframe": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d"
        }
      },
      "emi_details": "FILTERED",
      "bank_error_message": ""
    }
  },
  "date_created": "2024-10-03T05:31:53Z",
  "id": "evt_V2_666deff109e947a29175db79de694e09"
}

```

#### Webhook - ORDER_FAILED Code Snippet:

```webhook - order_failed
{
  "event_name": "ORDER_FAILED",
  "content": {
    "order": {
      "payer_app_name": "com.dreamplug.androidapp",
      "payment_method": "UPI",
      "customer_phone": "FILTERED",
      "payment_gateway_response": {
        "auth_ref_num": null,
        "network_error_message": null,
        "txn_id": "Merchant-M37ETTFRFROMQ-1",
        "rrn": "NA",
        "auth_id_code": "NA",
        "resp_message": "Payment Failed",
        "epg_txn_id": "",
        "gateway_merchant_id": null,
        "resp_code": "TXN_AUTO_FAILED",
        "created": "2024-10-03T07:40:17Z",
        "eci": null,
        "network_error_code": null,
        "arn": null
      },
      "udf8": "",
      "txn_id": "Merchant-M37ETTFRFROMQ-1",
      "order_id": "M37ETTFRFROMQ",
      "gateway_reference_id": null,
      "udf9": "",
      "txn_detail": {
        "response_message": "Transaction failed as it could not be completed in time. Please retry",
        "txn_id": "Merchant-M37ETTFRFROMQ-1",
        "order_id": "M37ETTFRFROMQ",
        "error_code": "TXN_AUTO_FAILED",
        "txn_flow_type": "INTENT",
        "status": "AUTHENTICATION_FAILED",
        "express_checkout": false,
        "gateway_id": 39,
        "error_message": "Payment Failed",
        "offer_deduction_amount": 0,
        "tax_amount": null,
        "currency": "INR",
        "txn_amount_breakup": [
          {
            "amount": 346,
            "method": "ADD",
            "sno": "FILTERED",
            "name": "BASE"
          },
          {
            "amount": 0,
            "method": "SUBTRACT",
            "sno": "FILTERED",
            "name": "OFFER"
          }
        ],
        "txn_amount": 346,
        "created": "2024-10-03T07:38:37Z",
        "gateway": "PHONEPE",
        "surcharge_amount": null,
        "last_updated": "2024-10-03T07:48:39Z",
        "txn_uuid": "mozuFY35Viymfjsj",
        "net_amount": 346,
        "redirect": true,
        "metadata": {
          "payment_channel": "ANDROID"
        },
        "response_code": "TXN_EXPIRED"
      },
      "customer_id": "62968368",
      "amount": 346,
      "udf4": "",
      "status": "AUTHENTICATION_FAILED",
      "udf5": "",
      "udf6": "",
      "status_id": 26,
      "offers": [
        {
          "offer_code": "CREDUPI2024",
          "offer_id": "743855cf-3eeea0aa632e",
          "error_code": "JP706",
          "status": "FAILED",
          "error_message": "Offer Application failed due to transaction failure",
          "benefits": [
            {
              "amount": 0,
              "type": "CASHBACK",
              "calculation_info": {
                "calculation_rule": "ABSOLUTE",
                "value": 0
              }
            }
          ],
          "metadata": "{\"minimum_order_amount\":\"200.00\"}"
        }
      ],
      "udf7": "",
      "resp_message": "Transaction failed as it could not be completed in time. Please retry",
      "product_id": "",
      "refunded": false,
      "udf10": "",
      "gateway_id": 39,
      "udf1": "enable",
      "udf2": "headlessAndroid",
      "udf3": "",
      "date_created": "2024-10-03T07:38:37Z",
      "id": "ordeh_556ce73fe0a9ee27b6fb1",
      "merchant_id": "Merchant",
      "return_url": "https://www.Merchant.com/mcheckout/orderStatus",
      "effective_amount": 346,
      "currency": "INR",
      "auth_type": "",
      "customer_email": "1111111",
      "resp_code": "TXN_EXPIRED",
      "upi": {
        "txn_flow_type": "INTENT",
        "payer_app": "com.dreamplug.androidapp"
      },
      "payment_method_type": "UPI",
      "last_updated": "2024-10-03T07:48:39Z",
      "txn_uuid": "mozuFY35Viymfjsj",
      "resp_category": "USER_DROPPED",
      "payment_links": {
        "mobile": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
        "web": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
        "iframe": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1"
      },
      "amount_refunded": 0,
      "bank_error_code": "TXN_AUTO_FAILED",
      "metadata": {
        "payment_page_client_id": "Merchant",
        "payment_links": {
          "mobile": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
          "web": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
          "iframe": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1"
        }
      },
      "emi_details": "FILTERED",
      "bank_error_message": "Payment Failed"
    }
  },
  "date_created": "2024-10-03T07:48:39Z",
  "id": "evt_V2_1ad4fb0dd02343bcb33302b49f92453c"
}

```

#### Order Status - Success Code Snippet:

```order status - success
{
  "payer_app_name": "com.dreamplug.androidapp",
  "payment_method": "UPI",
  "customer_phone": "FILTERED",
  "payment_gateway_response": {
    "auth_ref_num": null,
    "network_error_message": null,
    "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
    "rrn": "427790400212",
    "auth_id_code": "NA",
    "resp_message": "Your payment is successful.",
    "epg_txn_id": "T2410030244552630",
    "gateway_merchant_id": null,
    "resp_code": "SUCCESS",
    "created": "2024-10-03T05:31:53Z",
    "eci": null,
    "network_error_code": null,
    "arn": null
  },
  "udf8": "",
  "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
  "order_id": "M37CYBLQO2DXAQ",
  "gateway_reference_id": null,
  "maximum_eligible_refund_amount": 87,
  "udf9": "",
  "txn_detail": {
    "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
    "order_id": "M37CYBLQO2DXAQ",
    "error_code": null,
    "txn_flow_type": "INTENT",
    "status": "CHARGED",
    "express_checkout": false,
    "gateway_id": 39,
    "error_message": "",
    "offer_deduction_amount": 0,
    "tax_amount": null,
    "currency": "INR",
    "txn_amount_breakup": [
      {
        "amount": 287,
        "method": "ADD",
        "sno": "FILTERED",
        "name": "BASE"
      },
      {
        "amount": 0,
        "method": "SUBTRACT",
        "sno": "FILTERED",
        "name": "OFFER"
      }
    ],
    "txn_amount": 287,
    "created": "2024-10-03T05:31:37Z",
    "gateway": "PHONEPE",
    "surcharge_amount": null,
    "last_updated": "2024-10-03T05:31:53Z",
    "txn_uuid": "mozaTMcYHqxrY",
    "net_amount": 287,
    "redirect": true,
    "metadata": {
      "payment_channel": "ANDROID"
    }
  },
  "customer_id": "133680452",
  "amount": 287,
  "udf4": "",
  "status": "CHARGED",
  "udf5": "",
  "udf6": "",
  "status_id": 21,
  "offers": [
    {
      "offer_code": "FILTERED",
      "offer_id": "743855cf-3eeea0aa632e",
      "status": "AVAILED",
      "benefits": [
        {
          "amount": 0,
          "type": "CASHBACK",
          "calculation_info": {
            "calculation_rule": "FILTERED",
            "value": 0
          }
        }
      ],
      "metadata": "{\"minimum_order_amount\":\"200.00\"}"
    }
  ],
  "udf7": "",
  "resp_message": null,
  "product_id": "",
  "refunded": false,
  "udf10": "",
  "gateway_id": 39,
  "udf1": "enable",
  "udf2": "headlessAndroid",
  "udf3": "",
  "date_created": "2024-10-03T05:31:36Z",
  "id": "ordeh_c21d084368755d24388152d",
  "merchant_id": "Merchant",
  "return_url": "https://www.Merchant.com/mcheckout/orderStatus",
  "effective_amount": 287,
  "currency": "INR",
  "auth_type": "",
  "customer_email": "1111111",
  "resp_code": null,
  "upi": {
    "txn_flow_type": "INTENT",
    "payer_app": "com.dreamplug.androidapp"
  },
  "payment_method_type": "UPI",
  "txn_uuid": "mozaTMcYHqxrY",
  "resp_category": null,
  "payment_links": {
    "mobile": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
    "web": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
    "iframe": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d"
  },
  "amount_refunded": 0,
  "bank_error_code": "",
  "emi_details": "FILTERED",
  "bank_error_message": ""
}

```

#### Order Status - Failed Code Snippet:

```order status - failed
{
  "payer_app_name": "com.dreamplug.androidapp",
  "payment_method": "UPI",
  "customer_phone": "FILTERED",
  "payment_gateway_response": {
    "auth_ref_num": null,
    "network_error_message": null,
    "txn_id": "Merchant-M37ETTFRFROMQ-1",
    "rrn": "NA",
    "auth_id_code": "NA",
    "resp_message": "Payment Failed",
    "epg_txn_id": "",
    "gateway_merchant_id": null,
    "resp_code": "TXN_AUTO_FAILED",
    "created": "2024-10-03T07:40:17Z",
    "eci": null,
    "network_error_code": null,
    "arn": null
  },
  "udf8": "",
  "txn_id": "Merchant-M37ETTFRFROMQ-1",
  "order_id": "M37ETTFRFROMQ",
  "gateway_reference_id": null,
  "udf9": "",
  "txn_detail": {
    "response_message": "Transaction failed as it could not be completed in time. Please retry",
    "txn_id": "Merchant-M37ETTFRFROMQ-1",
    "order_id": "M37ETTFRFROMQ",
    "error_code": "TXN_AUTO_FAILED",
    "txn_flow_type": "INTENT",
    "status": "AUTHENTICATION_FAILED",
    "express_checkout": false,
    "gateway_id": 39,
    "error_message": "Payment Failed",
    "offer_deduction_amount": 0,
    "tax_amount": null,
    "currency": "INR",
    "txn_amount_breakup": [
      {
        "amount": 346,
        "method": "ADD",
        "sno": "FILTERED",
        "name": "BASE"
      },
      {
        "amount": 0,
        "method": "SUBTRACT",
        "sno": "FILTERED",
        "name": "OFFER"
      }
    ],
    "txn_amount": 346,
    "created": "2024-10-03T07:38:37Z",
    "gateway": "PHONEPE",
    "surcharge_amount": null,
    "last_updated": "2024-10-03T07:48:39Z",
    "txn_uuid": "mozuFY35Viymfjsj",
    "net_amount": 346,
    "redirect": true,
    "metadata": {
      "payment_channel": "ANDROID"
    },
    "response_code": "TXN_EXPIRED"
  },
  "customer_id": "62968368",
  "amount": 346,
  "udf4": "",
  "status": "AUTHENTICATION_FAILED",
  "udf5": "",
  "udf6": "",
  "status_id": 26,
  "offers": [
    {
      "offer_code": "FILTERED",
      "offer_id": "743855cf-3eeea0aa632e",
      "error_code": "JP706",
      "status": "FAILED",
      "error_message": "Offer Application failed due to transaction failure",
      "benefits": [
        {
          "amount": 0,
          "type": "CASHBACK",
          "calculation_info": {
            "calculation_rule": "FILTERED",
            "value": 0
          }
        }
      ],
      "metadata": "{\"minimum_order_amount\":\"200.00\"}"
    }
  ],
  "udf7": "",
  "resp_message": "Transaction failed as it could not be completed in time. Please retry",
  "product_id": "",
  "refunded": false,
  "udf10": "",
  "gateway_id": 39,
  "udf1": "enable",
  "udf2": "headlessAndroid",
  "udf3": "",
  "date_created": "2024-10-03T07:38:37Z",
  "id": "ordeh_556ce73fe0a9ee27b6fb1",
  "merchant_id": "Merchant",
  "return_url": "https://www.Merchant.com/mcheckout/orderStatus",
  "effective_amount": 346,
  "currency": "INR",
  "auth_type": "",
  "customer_email": "1111111",
  "resp_code": "TXN_EXPIRED",
  "upi": {
    "txn_flow_type": "INTENT",
    "payer_app": "com.dreamplug.androidapp"
  },
  "payment_method_type": "UPI",
  "last_updated": "2024-10-03T07:48:39Z",
  "txn_uuid": "mozuFY35Viymfjsj",
  "resp_category": "USER_DROPPED",
  "payment_links": {
    "mobile": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
    "web": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
    "iframe": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1"
  },
  "amount_refunded": 0,
  "bank_error_code": "TXN_AUTO_FAILED",
  "metadata": {
    "payment_page_client_id": "Merchant",
    "payment_links": {
      "mobile": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
      "web": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
      "iframe": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1"
    }
  },
  "emi_details": "FILTERED",
  "bank_error_message": "Payment Failed"
}

```




---

## Integration type : Juspay Express Checkout SDK


### Step 1.1. Configuration of Cred offer without any current offers


[Video](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/offer-engine/Screen%20Recording%202024-10-18%20at%203.09.09%E2%80%AFPM.mov)






## Integration Changes and Workflow




### Step 1.1. Substep


**Integration Changes:** 

Merchant must retrieve Cred offer details(`Partner_offer_info)`from the List Offer API and display them on the payment page as a banner or text.

**Work Flow:** 

* Configure CRED offer on Juspay dashboard
* Call Juspay’s [List offers API](https://juspay.io/in/docs/offer-engine/docs/api-integration/list-offer) with the user’s mobile number. Juspay will internally call the Cred eligibility API to verify if the provided mobile number is eligible for the Cred offer.
* If the offer is eligible, show the offer text response (Parameter name: `Partner_offer_info`) in the list offer response on the payment page UI.
* Send the offer ID received from List offers API in existing transaction or /txns API.
* Juspay will validate the offer & inform Cred in case of successful transaction.
* CRED will process the cashback to the user.
* Juspay to send the offer status in order status response.

> **Note**
> For Sandbox/UAT testing, the mobile number used for Cred eligibility must be whitelisted on Cred's end.



**Sample Request and Responses:** 


#### List Offer API Request Code Snippet:

```list offer api request
curl --location 'https://sandbox.juspay.in/offers/list' \
--header ‘Content-Type: application/json' \
--header ‘Authorization: Basic NThBQMwRDYxMzIxxEvICQJHFMTKLRUESODU40g==' \
--data '{
"customer": {
"id": "test_filter_customer_1462",
"phone": "9741000605"
},
"order": {
"amount": "1000",
"currency": "INR",
"merchant_id": "merchant_id",
"order_id": "1234"
},
"payment_method_info": []
}'

```

#### List Offer API Response Code Snippet:

```list offer api response
{
  "offer_rules": {
    "amount": {
      "currency": "INR",
      "min_order_amount": "1.00"
    },
    "payment_instrument": [],
    "filters": {
      "whitelist": [],
      "blacklist": []
    },
    "txn_type": [
      "ORDER"
    ]
  },
  "order_breakup": {
    "final_order_amount": "800.00",
    "offer_amount": "200.00",
    "order_amount": "1000.00",
    "applicable_order_amount": "1000.00",
    "discount_amount": "200.00",
    "merchant_discount_amount": "0.00",
    "cashback_amount": "0.00",
    "benefits": [
      {
        "type": "DISCOUNT",
        "calculation_rule": "PERCENTAGE",
        "value": 20
      }
    ]
  },
  "start_time_utc": "2023-02-18T18:30:40.999Z",
  "end_time_utc": "2025-02-20T18:29:40.999Z",
  "partner_offer_info": [
    {
      "partner": "CRED",
      "offer_message": "get flat ₹150 cashback on CRED. Valid only once per user"
    }
  ],
  "offer_id": "71098841-4180-a82c-db6d4e147b35",
  "status": "ELIGIBLE",
  "reason": [],
  "offer_code": "CRED-INTEGRATION_OFF_1724233660",
  "offer_description": {
    "title": "OFFER ON CRED",
    "description": "",
    "tnc": ""
  },
  "ui_configs": {
    "auto_apply": "true",
    "should_validate": "false",
    "is_hidden": "false"
  },
  "application_mode": "ORDER",
  "eligible_saved_payment_methods": [],
  "actions": []
}

```

#### Webhook - ORDER_SUCCEEDED Code Snippet:

```webhook - order_succeeded
{
  "event_name": "ORDER_SUCCEEDED",
  "content": {
    "order": {
      "payer_app_name": "com.dreamplug.androidapp",
      "payment_method": "UPI",
      "customer_phone": "FILTERED",
      "payment_gateway_response": {
        "auth_ref_num": null,
        "network_error_message": null,
        "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
        "rrn": "427790400212",
        "auth_id_code": "NA",
        "resp_message": "Your payment is successful.",
        "epg_txn_id": "T2410030244552630",
        "gateway_merchant_id": null,
        "resp_code": "SUCCESS",
        "created": "2024-10-03T05:31:53Z",
        "eci": null,
        "network_error_code": null,
        "arn": null
      },
      "udf8": "",
      "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
      "order_id": "M37CYBLQO2DXAQ",
      "gateway_reference_id": null,
      "maximum_eligible_refund_amount": 87,
      "udf9": "",
      "txn_detail": {
        "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
        "order_id": "M37CYBLQO2DXAQ",
        "error_code": null,
        "txn_flow_type": "INTENT",
        "status": "CHARGED",
        "express_checkout": false,
        "gateway_id": 39,
        "error_message": "",
        "offer_deduction_amount": 0,
        "tax_amount": null,
        "currency": "INR",
        "txn_amount_breakup": [
          {
            "amount": 287,
            "method": "ADD",
            "sno": "FILTERED",
            "name": "BASE"
          },
          {
            "amount": 0,
            "method": "SUBTRACT",
            "sno": "FILTERED",
            "name": "OFFER"
          }
        ],
        "txn_amount": 287,
        "created": "2024-10-03T05:31:37Z",
        "gateway": "PHONEPE",
        "surcharge_amount": null,
        "last_updated": "2024-10-03T05:31:53Z",
        "txn_uuid": "mozaTMcYHqxrY",
        "net_amount": 287,
        "redirect": true,
        "metadata": {
          "payment_channel": "ANDROID"
        }
      },
      "customer_id": "133680452",
      "amount": 287,
      "udf4": "",
      "status": "CHARGED",
      "udf5": "",
      "udf6": "",
      "status_id": 21,
      "offers": [
        {
          "offer_code": "CREDUPI2024",
          "offer_id": "743855cf-3eeea0aa632e",
          "status": "AVAILED",
          "benefits": [
            {
              "amount": 0,
              "type": "CASHBACK",
              "calculation_info": {
                "calculation_rule": "ABSOLUTE",
                "value": 0
              }
            }
          ],
          "metadata": "{\"minimum_order_amount\":\"200.00\"}"
        }
      ],
      "udf7": "",
      "resp_message": null,
      "product_id": "",
      "refunded": false,
      "udf10": "",
      "gateway_id": 39,
      "udf1": "enable",
      "udf2": "headlessAndroid",
      "udf3": "",
      "date_created": "2024-10-03T05:31:36Z",
      "id": "ordeh_c21d084368755d24388152d",
      "merchant_id": "Merchant",
      "return_url": "https://www.Merchant.com/mcheckout/orderStatus",
      "effective_amount": 287,
      "currency": "INR",
      "auth_type": "",
      "customer_email": "1111111",
      "resp_code": null,
      "upi": {
        "txn_flow_type": "INTENT",
        "payer_app": "com.dreamplug.androidapp"
      },
      "payment_method_type": "UPI",
      "last_updated": "2024-10-03T05:31:53Z",
      "txn_uuid": "mozaTMcYHqxrY",
      "resp_category": null,
      "payment_links": {
        "mobile": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
        "web": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
        "iframe": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d"
      },
      "amount_refunded": 0,
      "bank_error_code": "",
      "metadata": {
        "payment_page_client_id": "Merchant",
        "payment_links": {
          "mobile": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
          "web": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
          "iframe": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d"
        }
      },
      "emi_details": "FILTERED",
      "bank_error_message": ""
    }
  },
  "date_created": "2024-10-03T05:31:53Z",
  "id": "evt_V2_666deff109e947a29175db79de694e09"
}

```

#### Webhook - ORDER_FAILED Code Snippet:

```webhook - order_failed
{
  "event_name": "ORDER_FAILED",
  "content": {
    "order": {
      "payer_app_name": "com.dreamplug.androidapp",
      "payment_method": "UPI",
      "customer_phone": "FILTERED",
      "payment_gateway_response": {
        "auth_ref_num": null,
        "network_error_message": null,
        "txn_id": "Merchant-M37ETTFRFROMQ-1",
        "rrn": "NA",
        "auth_id_code": "NA",
        "resp_message": "Payment Failed",
        "epg_txn_id": "",
        "gateway_merchant_id": null,
        "resp_code": "TXN_AUTO_FAILED",
        "created": "2024-10-03T07:40:17Z",
        "eci": null,
        "network_error_code": null,
        "arn": null
      },
      "udf8": "",
      "txn_id": "Merchant-M37ETTFRFROMQ-1",
      "order_id": "M37ETTFRFROMQ",
      "gateway_reference_id": null,
      "udf9": "",
      "txn_detail": {
        "response_message": "Transaction failed as it could not be completed in time. Please retry",
        "txn_id": "Merchant-M37ETTFRFROMQ-1",
        "order_id": "M37ETTFRFROMQ",
        "error_code": "TXN_AUTO_FAILED",
        "txn_flow_type": "INTENT",
        "status": "AUTHENTICATION_FAILED",
        "express_checkout": false,
        "gateway_id": 39,
        "error_message": "Payment Failed",
        "offer_deduction_amount": 0,
        "tax_amount": null,
        "currency": "INR",
        "txn_amount_breakup": [
          {
            "amount": 346,
            "method": "ADD",
            "sno": "FILTERED",
            "name": "BASE"
          },
          {
            "amount": 0,
            "method": "SUBTRACT",
            "sno": "FILTERED",
            "name": "OFFER"
          }
        ],
        "txn_amount": 346,
        "created": "2024-10-03T07:38:37Z",
        "gateway": "PHONEPE",
        "surcharge_amount": null,
        "last_updated": "2024-10-03T07:48:39Z",
        "txn_uuid": "mozuFY35Viymfjsj",
        "net_amount": 346,
        "redirect": true,
        "metadata": {
          "payment_channel": "ANDROID"
        },
        "response_code": "TXN_EXPIRED"
      },
      "customer_id": "62968368",
      "amount": 346,
      "udf4": "",
      "status": "AUTHENTICATION_FAILED",
      "udf5": "",
      "udf6": "",
      "status_id": 26,
      "offers": [
        {
          "offer_code": "CREDUPI2024",
          "offer_id": "743855cf-3eeea0aa632e",
          "error_code": "JP706",
          "status": "FAILED",
          "error_message": "Offer Application failed due to transaction failure",
          "benefits": [
            {
              "amount": 0,
              "type": "CASHBACK",
              "calculation_info": {
                "calculation_rule": "ABSOLUTE",
                "value": 0
              }
            }
          ],
          "metadata": "{\"minimum_order_amount\":\"200.00\"}"
        }
      ],
      "udf7": "",
      "resp_message": "Transaction failed as it could not be completed in time. Please retry",
      "product_id": "",
      "refunded": false,
      "udf10": "",
      "gateway_id": 39,
      "udf1": "enable",
      "udf2": "headlessAndroid",
      "udf3": "",
      "date_created": "2024-10-03T07:38:37Z",
      "id": "ordeh_556ce73fe0a9ee27b6fb1",
      "merchant_id": "Merchant",
      "return_url": "https://www.Merchant.com/mcheckout/orderStatus",
      "effective_amount": 346,
      "currency": "INR",
      "auth_type": "",
      "customer_email": "1111111",
      "resp_code": "TXN_EXPIRED",
      "upi": {
        "txn_flow_type": "INTENT",
        "payer_app": "com.dreamplug.androidapp"
      },
      "payment_method_type": "UPI",
      "last_updated": "2024-10-03T07:48:39Z",
      "txn_uuid": "mozuFY35Viymfjsj",
      "resp_category": "USER_DROPPED",
      "payment_links": {
        "mobile": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
        "web": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
        "iframe": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1"
      },
      "amount_refunded": 0,
      "bank_error_code": "TXN_AUTO_FAILED",
      "metadata": {
        "payment_page_client_id": "Merchant",
        "payment_links": {
          "mobile": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
          "web": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
          "iframe": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1"
        }
      },
      "emi_details": "FILTERED",
      "bank_error_message": "Payment Failed"
    }
  },
  "date_created": "2024-10-03T07:48:39Z",
  "id": "evt_V2_1ad4fb0dd02343bcb33302b49f92453c"
}

```

#### Order Status - Success Code Snippet:

```order status - success
{
  "payer_app_name": "com.dreamplug.androidapp",
  "payment_method": "UPI",
  "customer_phone": "FILTERED",
  "payment_gateway_response": {
    "auth_ref_num": null,
    "network_error_message": null,
    "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
    "rrn": "427790400212",
    "auth_id_code": "NA",
    "resp_message": "Your payment is successful.",
    "epg_txn_id": "T2410030244552630",
    "gateway_merchant_id": null,
    "resp_code": "SUCCESS",
    "created": "2024-10-03T05:31:53Z",
    "eci": null,
    "network_error_code": null,
    "arn": null
  },
  "udf8": "",
  "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
  "order_id": "M37CYBLQO2DXAQ",
  "gateway_reference_id": null,
  "maximum_eligible_refund_amount": 87,
  "udf9": "",
  "txn_detail": {
    "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
    "order_id": "M37CYBLQO2DXAQ",
    "error_code": null,
    "txn_flow_type": "INTENT",
    "status": "CHARGED",
    "express_checkout": false,
    "gateway_id": 39,
    "error_message": "",
    "offer_deduction_amount": 0,
    "tax_amount": null,
    "currency": "INR",
    "txn_amount_breakup": [
      {
        "amount": 287,
        "method": "ADD",
        "sno": "FILTERED",
        "name": "BASE"
      },
      {
        "amount": 0,
        "method": "SUBTRACT",
        "sno": "FILTERED",
        "name": "OFFER"
      }
    ],
    "txn_amount": 287,
    "created": "2024-10-03T05:31:37Z",
    "gateway": "PHONEPE",
    "surcharge_amount": null,
    "last_updated": "2024-10-03T05:31:53Z",
    "txn_uuid": "mozaTMcYHqxrY",
    "net_amount": 287,
    "redirect": true,
    "metadata": {
      "payment_channel": "ANDROID"
    }
  },
  "customer_id": "133680452",
  "amount": 287,
  "udf4": "",
  "status": "CHARGED",
  "udf5": "",
  "udf6": "",
  "status_id": 21,
  "offers": [
    {
      "offer_code": "FILTERED",
      "offer_id": "743855cf-3eeea0aa632e",
      "status": "AVAILED",
      "benefits": [
        {
          "amount": 0,
          "type": "CASHBACK",
          "calculation_info": {
            "calculation_rule": "FILTERED",
            "value": 0
          }
        }
      ],
      "metadata": "{\"minimum_order_amount\":\"200.00\"}"
    }
  ],
  "udf7": "",
  "resp_message": null,
  "product_id": "",
  "refunded": false,
  "udf10": "",
  "gateway_id": 39,
  "udf1": "enable",
  "udf2": "headlessAndroid",
  "udf3": "",
  "date_created": "2024-10-03T05:31:36Z",
  "id": "ordeh_c21d084368755d24388152d",
  "merchant_id": "Merchant",
  "return_url": "https://www.Merchant.com/mcheckout/orderStatus",
  "effective_amount": 287,
  "currency": "INR",
  "auth_type": "",
  "customer_email": "1111111",
  "resp_code": null,
  "upi": {
    "txn_flow_type": "INTENT",
    "payer_app": "com.dreamplug.androidapp"
  },
  "payment_method_type": "UPI",
  "txn_uuid": "mozaTMcYHqxrY",
  "resp_category": null,
  "payment_links": {
    "mobile": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
    "web": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
    "iframe": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d"
  },
  "amount_refunded": 0,
  "bank_error_code": "",
  "emi_details": "FILTERED",
  "bank_error_message": ""
}

```

#### Order Status - Failed Code Snippet:

```order status - failed
{
  "payer_app_name": "com.dreamplug.androidapp",
  "payment_method": "UPI",
  "customer_phone": "FILTERED",
  "payment_gateway_response": {
    "auth_ref_num": null,
    "network_error_message": null,
    "txn_id": "Merchant-M37ETTFRFROMQ-1",
    "rrn": "NA",
    "auth_id_code": "NA",
    "resp_message": "Payment Failed",
    "epg_txn_id": "",
    "gateway_merchant_id": null,
    "resp_code": "TXN_AUTO_FAILED",
    "created": "2024-10-03T07:40:17Z",
    "eci": null,
    "network_error_code": null,
    "arn": null
  },
  "udf8": "",
  "txn_id": "Merchant-M37ETTFRFROMQ-1",
  "order_id": "M37ETTFRFROMQ",
  "gateway_reference_id": null,
  "udf9": "",
  "txn_detail": {
    "response_message": "Transaction failed as it could not be completed in time. Please retry",
    "txn_id": "Merchant-M37ETTFRFROMQ-1",
    "order_id": "M37ETTFRFROMQ",
    "error_code": "TXN_AUTO_FAILED",
    "txn_flow_type": "INTENT",
    "status": "AUTHENTICATION_FAILED",
    "express_checkout": false,
    "gateway_id": 39,
    "error_message": "Payment Failed",
    "offer_deduction_amount": 0,
    "tax_amount": null,
    "currency": "INR",
    "txn_amount_breakup": [
      {
        "amount": 346,
        "method": "ADD",
        "sno": "FILTERED",
        "name": "BASE"
      },
      {
        "amount": 0,
        "method": "SUBTRACT",
        "sno": "FILTERED",
        "name": "OFFER"
      }
    ],
    "txn_amount": 346,
    "created": "2024-10-03T07:38:37Z",
    "gateway": "PHONEPE",
    "surcharge_amount": null,
    "last_updated": "2024-10-03T07:48:39Z",
    "txn_uuid": "mozuFY35Viymfjsj",
    "net_amount": 346,
    "redirect": true,
    "metadata": {
      "payment_channel": "ANDROID"
    },
    "response_code": "TXN_EXPIRED"
  },
  "customer_id": "62968368",
  "amount": 346,
  "udf4": "",
  "status": "AUTHENTICATION_FAILED",
  "udf5": "",
  "udf6": "",
  "status_id": 26,
  "offers": [
    {
      "offer_code": "FILTERED",
      "offer_id": "743855cf-3eeea0aa632e",
      "error_code": "JP706",
      "status": "FAILED",
      "error_message": "Offer Application failed due to transaction failure",
      "benefits": [
        {
          "amount": 0,
          "type": "CASHBACK",
          "calculation_info": {
            "calculation_rule": "FILTERED",
            "value": 0
          }
        }
      ],
      "metadata": "{\"minimum_order_amount\":\"200.00\"}"
    }
  ],
  "udf7": "",
  "resp_message": "Transaction failed as it could not be completed in time. Please retry",
  "product_id": "",
  "refunded": false,
  "udf10": "",
  "gateway_id": 39,
  "udf1": "enable",
  "udf2": "headlessAndroid",
  "udf3": "",
  "date_created": "2024-10-03T07:38:37Z",
  "id": "ordeh_556ce73fe0a9ee27b6fb1",
  "merchant_id": "Merchant",
  "return_url": "https://www.Merchant.com/mcheckout/orderStatus",
  "effective_amount": 346,
  "currency": "INR",
  "auth_type": "",
  "customer_email": "1111111",
  "resp_code": "TXN_EXPIRED",
  "upi": {
    "txn_flow_type": "INTENT",
    "payer_app": "com.dreamplug.androidapp"
  },
  "payment_method_type": "UPI",
  "last_updated": "2024-10-03T07:48:39Z",
  "txn_uuid": "mozuFY35Viymfjsj",
  "resp_category": "USER_DROPPED",
  "payment_links": {
    "mobile": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
    "web": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
    "iframe": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1"
  },
  "amount_refunded": 0,
  "bank_error_code": "TXN_AUTO_FAILED",
  "metadata": {
    "payment_page_client_id": "Merchant",
    "payment_links": {
      "mobile": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
      "web": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
      "iframe": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1"
    }
  },
  "emi_details": "FILTERED",
  "bank_error_message": "Payment Failed"
}

```




---

## Integration type : Juspay Express Checkout API


### Step 1.1. Configuration of Cred offer without any current offers


[Video](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/offer-engine/Screen%20Recording%202024-10-18%20at%203.09.09%E2%80%AFPM.mov)






## Integration Changes and Workflow




### Step 1.1. Substep


**Integration Changes:** 

Merchant must retrieve Cred offer details(`Partner_offer_info)`from the List Offer API and display them on the payment page as a banner or text.

**Work Flow:** 

* Configure CRED offer on Juspay dashboard
* Call Juspay’s [List offers API](https://juspay.io/in/docs/offer-engine/docs/api-integration/list-offer) with the user’s mobile number. Juspay will internally call the Cred eligibility API to verify if the provided mobile number is eligible for the Cred offer.
* If the offer is eligible, show the offer text response (Parameter name: `Partner_offer_info`) in the list offer response on the payment page UI.
* Send the offer ID received from List offers API in existing transaction or /txns API.
* Juspay will validate the offer & inform Cred in case of successful transaction.
* CRED will process the cashback to the user.
* Juspay to send the offer status in order status response.

> **Note**
> For Sandbox/UAT testing, the mobile number used for Cred eligibility must be whitelisted on Cred's end.



**Sample Request and Responses:** 


#### List Offer API Request Code Snippet:

```list offer api request
curl --location 'https://sandbox.juspay.in/offers/list' \
--header ‘Content-Type: application/json' \
--header ‘Authorization: Basic NThBQMwRDYxMzIxxEvICQJHFMTKLRUESODU40g==' \
--data '{
"customer": {
"id": "test_filter_customer_1462",
"phone": "9741000605"
},
"order": {
"amount": "1000",
"currency": "INR",
"merchant_id": "merchant_id",
"order_id": "1234"
},
"payment_method_info": []
}'

```

#### List Offer API Response Code Snippet:

```list offer api response
{
  "offer_rules": {
    "amount": {
      "currency": "INR",
      "min_order_amount": "1.00"
    },
    "payment_instrument": [],
    "filters": {
      "whitelist": [],
      "blacklist": []
    },
    "txn_type": [
      "ORDER"
    ]
  },
  "order_breakup": {
    "final_order_amount": "800.00",
    "offer_amount": "200.00",
    "order_amount": "1000.00",
    "applicable_order_amount": "1000.00",
    "discount_amount": "200.00",
    "merchant_discount_amount": "0.00",
    "cashback_amount": "0.00",
    "benefits": [
      {
        "type": "DISCOUNT",
        "calculation_rule": "PERCENTAGE",
        "value": 20
      }
    ]
  },
  "start_time_utc": "2023-02-18T18:30:40.999Z",
  "end_time_utc": "2025-02-20T18:29:40.999Z",
  "partner_offer_info": [
    {
      "partner": "CRED",
      "offer_message": "get flat ₹150 cashback on CRED. Valid only once per user"
    }
  ],
  "offer_id": "71098841-4180-a82c-db6d4e147b35",
  "status": "ELIGIBLE",
  "reason": [],
  "offer_code": "CRED-INTEGRATION_OFF_1724233660",
  "offer_description": {
    "title": "OFFER ON CRED",
    "description": "",
    "tnc": ""
  },
  "ui_configs": {
    "auto_apply": "true",
    "should_validate": "false",
    "is_hidden": "false"
  },
  "application_mode": "ORDER",
  "eligible_saved_payment_methods": [],
  "actions": []
}

```

#### Webhook - ORDER_SUCCEEDED Code Snippet:

```webhook - order_succeeded
{
  "event_name": "ORDER_SUCCEEDED",
  "content": {
    "order": {
      "payer_app_name": "com.dreamplug.androidapp",
      "payment_method": "UPI",
      "customer_phone": "FILTERED",
      "payment_gateway_response": {
        "auth_ref_num": null,
        "network_error_message": null,
        "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
        "rrn": "427790400212",
        "auth_id_code": "NA",
        "resp_message": "Your payment is successful.",
        "epg_txn_id": "T2410030244552630",
        "gateway_merchant_id": null,
        "resp_code": "SUCCESS",
        "created": "2024-10-03T05:31:53Z",
        "eci": null,
        "network_error_code": null,
        "arn": null
      },
      "udf8": "",
      "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
      "order_id": "M37CYBLQO2DXAQ",
      "gateway_reference_id": null,
      "maximum_eligible_refund_amount": 87,
      "udf9": "",
      "txn_detail": {
        "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
        "order_id": "M37CYBLQO2DXAQ",
        "error_code": null,
        "txn_flow_type": "INTENT",
        "status": "CHARGED",
        "express_checkout": false,
        "gateway_id": 39,
        "error_message": "",
        "offer_deduction_amount": 0,
        "tax_amount": null,
        "currency": "INR",
        "txn_amount_breakup": [
          {
            "amount": 287,
            "method": "ADD",
            "sno": "FILTERED",
            "name": "BASE"
          },
          {
            "amount": 0,
            "method": "SUBTRACT",
            "sno": "FILTERED",
            "name": "OFFER"
          }
        ],
        "txn_amount": 287,
        "created": "2024-10-03T05:31:37Z",
        "gateway": "PHONEPE",
        "surcharge_amount": null,
        "last_updated": "2024-10-03T05:31:53Z",
        "txn_uuid": "mozaTMcYHqxrY",
        "net_amount": 287,
        "redirect": true,
        "metadata": {
          "payment_channel": "ANDROID"
        }
      },
      "customer_id": "133680452",
      "amount": 287,
      "udf4": "",
      "status": "CHARGED",
      "udf5": "",
      "udf6": "",
      "status_id": 21,
      "offers": [
        {
          "offer_code": "CREDUPI2024",
          "offer_id": "743855cf-3eeea0aa632e",
          "status": "AVAILED",
          "benefits": [
            {
              "amount": 0,
              "type": "CASHBACK",
              "calculation_info": {
                "calculation_rule": "ABSOLUTE",
                "value": 0
              }
            }
          ],
          "metadata": "{\"minimum_order_amount\":\"200.00\"}"
        }
      ],
      "udf7": "",
      "resp_message": null,
      "product_id": "",
      "refunded": false,
      "udf10": "",
      "gateway_id": 39,
      "udf1": "enable",
      "udf2": "headlessAndroid",
      "udf3": "",
      "date_created": "2024-10-03T05:31:36Z",
      "id": "ordeh_c21d084368755d24388152d",
      "merchant_id": "Merchant",
      "return_url": "https://www.Merchant.com/mcheckout/orderStatus",
      "effective_amount": 287,
      "currency": "INR",
      "auth_type": "",
      "customer_email": "1111111",
      "resp_code": null,
      "upi": {
        "txn_flow_type": "INTENT",
        "payer_app": "com.dreamplug.androidapp"
      },
      "payment_method_type": "UPI",
      "last_updated": "2024-10-03T05:31:53Z",
      "txn_uuid": "mozaTMcYHqxrY",
      "resp_category": null,
      "payment_links": {
        "mobile": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
        "web": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
        "iframe": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d"
      },
      "amount_refunded": 0,
      "bank_error_code": "",
      "metadata": {
        "payment_page_client_id": "Merchant",
        "payment_links": {
          "mobile": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
          "web": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
          "iframe": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d"
        }
      },
      "emi_details": "FILTERED",
      "bank_error_message": ""
    }
  },
  "date_created": "2024-10-03T05:31:53Z",
  "id": "evt_V2_666deff109e947a29175db79de694e09"
}

```

#### Webhook - ORDER_FAILED Code Snippet:

```webhook - order_failed
{
  "event_name": "ORDER_FAILED",
  "content": {
    "order": {
      "payer_app_name": "com.dreamplug.androidapp",
      "payment_method": "UPI",
      "customer_phone": "FILTERED",
      "payment_gateway_response": {
        "auth_ref_num": null,
        "network_error_message": null,
        "txn_id": "Merchant-M37ETTFRFROMQ-1",
        "rrn": "NA",
        "auth_id_code": "NA",
        "resp_message": "Payment Failed",
        "epg_txn_id": "",
        "gateway_merchant_id": null,
        "resp_code": "TXN_AUTO_FAILED",
        "created": "2024-10-03T07:40:17Z",
        "eci": null,
        "network_error_code": null,
        "arn": null
      },
      "udf8": "",
      "txn_id": "Merchant-M37ETTFRFROMQ-1",
      "order_id": "M37ETTFRFROMQ",
      "gateway_reference_id": null,
      "udf9": "",
      "txn_detail": {
        "response_message": "Transaction failed as it could not be completed in time. Please retry",
        "txn_id": "Merchant-M37ETTFRFROMQ-1",
        "order_id": "M37ETTFRFROMQ",
        "error_code": "TXN_AUTO_FAILED",
        "txn_flow_type": "INTENT",
        "status": "AUTHENTICATION_FAILED",
        "express_checkout": false,
        "gateway_id": 39,
        "error_message": "Payment Failed",
        "offer_deduction_amount": 0,
        "tax_amount": null,
        "currency": "INR",
        "txn_amount_breakup": [
          {
            "amount": 346,
            "method": "ADD",
            "sno": "FILTERED",
            "name": "BASE"
          },
          {
            "amount": 0,
            "method": "SUBTRACT",
            "sno": "FILTERED",
            "name": "OFFER"
          }
        ],
        "txn_amount": 346,
        "created": "2024-10-03T07:38:37Z",
        "gateway": "PHONEPE",
        "surcharge_amount": null,
        "last_updated": "2024-10-03T07:48:39Z",
        "txn_uuid": "mozuFY35Viymfjsj",
        "net_amount": 346,
        "redirect": true,
        "metadata": {
          "payment_channel": "ANDROID"
        },
        "response_code": "TXN_EXPIRED"
      },
      "customer_id": "62968368",
      "amount": 346,
      "udf4": "",
      "status": "AUTHENTICATION_FAILED",
      "udf5": "",
      "udf6": "",
      "status_id": 26,
      "offers": [
        {
          "offer_code": "CREDUPI2024",
          "offer_id": "743855cf-3eeea0aa632e",
          "error_code": "JP706",
          "status": "FAILED",
          "error_message": "Offer Application failed due to transaction failure",
          "benefits": [
            {
              "amount": 0,
              "type": "CASHBACK",
              "calculation_info": {
                "calculation_rule": "ABSOLUTE",
                "value": 0
              }
            }
          ],
          "metadata": "{\"minimum_order_amount\":\"200.00\"}"
        }
      ],
      "udf7": "",
      "resp_message": "Transaction failed as it could not be completed in time. Please retry",
      "product_id": "",
      "refunded": false,
      "udf10": "",
      "gateway_id": 39,
      "udf1": "enable",
      "udf2": "headlessAndroid",
      "udf3": "",
      "date_created": "2024-10-03T07:38:37Z",
      "id": "ordeh_556ce73fe0a9ee27b6fb1",
      "merchant_id": "Merchant",
      "return_url": "https://www.Merchant.com/mcheckout/orderStatus",
      "effective_amount": 346,
      "currency": "INR",
      "auth_type": "",
      "customer_email": "1111111",
      "resp_code": "TXN_EXPIRED",
      "upi": {
        "txn_flow_type": "INTENT",
        "payer_app": "com.dreamplug.androidapp"
      },
      "payment_method_type": "UPI",
      "last_updated": "2024-10-03T07:48:39Z",
      "txn_uuid": "mozuFY35Viymfjsj",
      "resp_category": "USER_DROPPED",
      "payment_links": {
        "mobile": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
        "web": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
        "iframe": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1"
      },
      "amount_refunded": 0,
      "bank_error_code": "TXN_AUTO_FAILED",
      "metadata": {
        "payment_page_client_id": "Merchant",
        "payment_links": {
          "mobile": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
          "web": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
          "iframe": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1"
        }
      },
      "emi_details": "FILTERED",
      "bank_error_message": "Payment Failed"
    }
  },
  "date_created": "2024-10-03T07:48:39Z",
  "id": "evt_V2_1ad4fb0dd02343bcb33302b49f92453c"
}

```

#### Order Status - Success Code Snippet:

```order status - success
{
  "payer_app_name": "com.dreamplug.androidapp",
  "payment_method": "UPI",
  "customer_phone": "FILTERED",
  "payment_gateway_response": {
    "auth_ref_num": null,
    "network_error_message": null,
    "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
    "rrn": "427790400212",
    "auth_id_code": "NA",
    "resp_message": "Your payment is successful.",
    "epg_txn_id": "T2410030244552630",
    "gateway_merchant_id": null,
    "resp_code": "SUCCESS",
    "created": "2024-10-03T05:31:53Z",
    "eci": null,
    "network_error_code": null,
    "arn": null
  },
  "udf8": "",
  "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
  "order_id": "M37CYBLQO2DXAQ",
  "gateway_reference_id": null,
  "maximum_eligible_refund_amount": 87,
  "udf9": "",
  "txn_detail": {
    "txn_id": "Merchant-M37CYBLQO2DXAQ-1",
    "order_id": "M37CYBLQO2DXAQ",
    "error_code": null,
    "txn_flow_type": "INTENT",
    "status": "CHARGED",
    "express_checkout": false,
    "gateway_id": 39,
    "error_message": "",
    "offer_deduction_amount": 0,
    "tax_amount": null,
    "currency": "INR",
    "txn_amount_breakup": [
      {
        "amount": 287,
        "method": "ADD",
        "sno": "FILTERED",
        "name": "BASE"
      },
      {
        "amount": 0,
        "method": "SUBTRACT",
        "sno": "FILTERED",
        "name": "OFFER"
      }
    ],
    "txn_amount": 287,
    "created": "2024-10-03T05:31:37Z",
    "gateway": "PHONEPE",
    "surcharge_amount": null,
    "last_updated": "2024-10-03T05:31:53Z",
    "txn_uuid": "mozaTMcYHqxrY",
    "net_amount": 287,
    "redirect": true,
    "metadata": {
      "payment_channel": "ANDROID"
    }
  },
  "customer_id": "133680452",
  "amount": 287,
  "udf4": "",
  "status": "CHARGED",
  "udf5": "",
  "udf6": "",
  "status_id": 21,
  "offers": [
    {
      "offer_code": "FILTERED",
      "offer_id": "743855cf-3eeea0aa632e",
      "status": "AVAILED",
      "benefits": [
        {
          "amount": 0,
          "type": "CASHBACK",
          "calculation_info": {
            "calculation_rule": "FILTERED",
            "value": 0
          }
        }
      ],
      "metadata": "{\"minimum_order_amount\":\"200.00\"}"
    }
  ],
  "udf7": "",
  "resp_message": null,
  "product_id": "",
  "refunded": false,
  "udf10": "",
  "gateway_id": 39,
  "udf1": "enable",
  "udf2": "headlessAndroid",
  "udf3": "",
  "date_created": "2024-10-03T05:31:36Z",
  "id": "ordeh_c21d084368755d24388152d",
  "merchant_id": "Merchant",
  "return_url": "https://www.Merchant.com/mcheckout/orderStatus",
  "effective_amount": 287,
  "currency": "INR",
  "auth_type": "",
  "customer_email": "1111111",
  "resp_code": null,
  "upi": {
    "txn_flow_type": "INTENT",
    "payer_app": "com.dreamplug.androidapp"
  },
  "payment_method_type": "UPI",
  "txn_uuid": "mozaTMcYHqxrY",
  "resp_category": null,
  "payment_links": {
    "mobile": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
    "web": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d",
    "iframe": "https://payments.juspay.in/payment-page/order/ordeh_c21d084368755d24388152d"
  },
  "amount_refunded": 0,
  "bank_error_code": "",
  "emi_details": "FILTERED",
  "bank_error_message": ""
}

```

#### Order Status - Failed Code Snippet:

```order status - failed
{
  "payer_app_name": "com.dreamplug.androidapp",
  "payment_method": "UPI",
  "customer_phone": "FILTERED",
  "payment_gateway_response": {
    "auth_ref_num": null,
    "network_error_message": null,
    "txn_id": "Merchant-M37ETTFRFROMQ-1",
    "rrn": "NA",
    "auth_id_code": "NA",
    "resp_message": "Payment Failed",
    "epg_txn_id": "",
    "gateway_merchant_id": null,
    "resp_code": "TXN_AUTO_FAILED",
    "created": "2024-10-03T07:40:17Z",
    "eci": null,
    "network_error_code": null,
    "arn": null
  },
  "udf8": "",
  "txn_id": "Merchant-M37ETTFRFROMQ-1",
  "order_id": "M37ETTFRFROMQ",
  "gateway_reference_id": null,
  "udf9": "",
  "txn_detail": {
    "response_message": "Transaction failed as it could not be completed in time. Please retry",
    "txn_id": "Merchant-M37ETTFRFROMQ-1",
    "order_id": "M37ETTFRFROMQ",
    "error_code": "TXN_AUTO_FAILED",
    "txn_flow_type": "INTENT",
    "status": "AUTHENTICATION_FAILED",
    "express_checkout": false,
    "gateway_id": 39,
    "error_message": "Payment Failed",
    "offer_deduction_amount": 0,
    "tax_amount": null,
    "currency": "INR",
    "txn_amount_breakup": [
      {
        "amount": 346,
        "method": "ADD",
        "sno": "FILTERED",
        "name": "BASE"
      },
      {
        "amount": 0,
        "method": "SUBTRACT",
        "sno": "FILTERED",
        "name": "OFFER"
      }
    ],
    "txn_amount": 346,
    "created": "2024-10-03T07:38:37Z",
    "gateway": "PHONEPE",
    "surcharge_amount": null,
    "last_updated": "2024-10-03T07:48:39Z",
    "txn_uuid": "mozuFY35Viymfjsj",
    "net_amount": 346,
    "redirect": true,
    "metadata": {
      "payment_channel": "ANDROID"
    },
    "response_code": "TXN_EXPIRED"
  },
  "customer_id": "62968368",
  "amount": 346,
  "udf4": "",
  "status": "AUTHENTICATION_FAILED",
  "udf5": "",
  "udf6": "",
  "status_id": 26,
  "offers": [
    {
      "offer_code": "FILTERED",
      "offer_id": "743855cf-3eeea0aa632e",
      "error_code": "JP706",
      "status": "FAILED",
      "error_message": "Offer Application failed due to transaction failure",
      "benefits": [
        {
          "amount": 0,
          "type": "CASHBACK",
          "calculation_info": {
            "calculation_rule": "FILTERED",
            "value": 0
          }
        }
      ],
      "metadata": "{\"minimum_order_amount\":\"200.00\"}"
    }
  ],
  "udf7": "",
  "resp_message": "Transaction failed as it could not be completed in time. Please retry",
  "product_id": "",
  "refunded": false,
  "udf10": "",
  "gateway_id": 39,
  "udf1": "enable",
  "udf2": "headlessAndroid",
  "udf3": "",
  "date_created": "2024-10-03T07:38:37Z",
  "id": "ordeh_556ce73fe0a9ee27b6fb1",
  "merchant_id": "Merchant",
  "return_url": "https://www.Merchant.com/mcheckout/orderStatus",
  "effective_amount": 346,
  "currency": "INR",
  "auth_type": "",
  "customer_email": "1111111",
  "resp_code": "TXN_EXPIRED",
  "upi": {
    "txn_flow_type": "INTENT",
    "payer_app": "com.dreamplug.androidapp"
  },
  "payment_method_type": "UPI",
  "last_updated": "2024-10-03T07:48:39Z",
  "txn_uuid": "mozuFY35Viymfjsj",
  "resp_category": "USER_DROPPED",
  "payment_links": {
    "mobile": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
    "web": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
    "iframe": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1"
  },
  "amount_refunded": 0,
  "bank_error_code": "TXN_AUTO_FAILED",
  "metadata": {
    "payment_page_client_id": "Merchant",
    "payment_links": {
      "mobile": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
      "web": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1",
      "iframe": "https://payments.juspay.in/payment-page/order/ordeh_556ce73fe0a9ee27b6fb1"
    }
  },
  "emi_details": "FILTERED",
  "bank_error_message": "Payment Failed"
}

```




---

## See Also

- [Offer Events](https://juspay.io/in/docs/offer-engine/docs/feature-guide/offer-events)
