---
page_title: CRED Reward 
product: Payment Method Integrations
platform: Express Checkout SDK
page_source: https://juspay.io/br/docs/payment-method-integrations/express-checkout-sdk/upiinapp-integration/cred-reward
llms_txt: https://juspay.io/br/docs/llms.txt
product_llms_txt: https://juspay.io/br/docs/payment-method-integrations/llms.txt
---


## CRED Reward Layer Integration



This document speaks about the CRED Reward layer integration only for HyperUPI/ UPI-In-App Merchant integration.

> **Note**
> This flow is applicable only for Merchants using HyperUPI flow of Juspay.   




### Step 1 Pre-Requsites


* Inform Juspay about the integration. Juspay will have make the necessary changes in your asset file and release the changes. This would take 1-2 days.   
  
  > **Note**
  > Kindly do a clean build post this and then start testing.




### **Step 2: PG Control Centre Changes** 



In this step, Merchants would need to add “**Business Partner Id** “ obtained from CRED Team. Attaching same SS.

![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/Screenshot%202024-04-22%20at%2011.46.04%E2%80%AFPM.png)
*PG Configuration*




### **Step 3: SDK Request and Responses** 



1. Eligibility
   
   
   ### Step 3.1 Eligibility 
   
   
   This call is needed to get the offer eligible for that CRED user. This should be called before / during rendering of Payment Page. 
   
   Request: 
   
   
   #### Eligilibiltiy Request  Code Snippet:
   
   ```eligilibiltiy request 
   {
     "service": "in.juspay.ec",
     "requestId": "e17ee878-d1d1-44fc-924a-73926e0268d1",
     "payload": {
       "merchant_key_id": "8321",
       "environment": "sandbox",
       "data": {
         "apps": [
           {
             "mobile": "7224996066",
             "gatewayReferenceId": null,
             "checkType": [
               "credInappOffer"
             ]
           }
         ]
       },
       "clientAuthToken": "tkn_a8ebe4d5a8c54c648e4ac4f7869e7c1f",
       "amount": "1.00",
       "action": "eligibility"
     },
     "merchant_id": "test_merchant",
     "customer_id": "7224996066ffairha",
     "client_id": "test_merchant"
   }
   
   ```
   
   
   Response: 
   
   
   #### Eligibility Response Code Snippet:
   
   ```eligibility response
   {
     "action": "eligibility",
     "apps": [
       {
         "paymentMethodsEligibility": [
           {
             "paymentMethodType": "UPI",
             "paymentMethod": "UPI",
             "layout": {
               "preActionNudge": "Get Upto ₹100 cashback on CRED app",
               "postActionNudge": "Save Upto ₹100 on next order using CRED Pay"
             },
             "isEligible": true,
             "flowType": "InApp",
             "description": "Cred Inapp Offer"
           }
         ]
       }
     ]
   }
   
   ```
   
   
   
   
   Next, Merchants would need to couple of things as mentioned below. 
   
   > **Note**
   > Merchants would need to make sight modification in the below requests that needs to be passed as **offerData.** 
   > 
   > * Need to add the paymentMethodType to **upiinapp** .
   > * Extract data from eligibility call and send under credO**fferData** in the below mentioned format.
   
   
   
   * **Onboard & Pay**  (Step 3.2)
   * **Pay**  (Step 3.3)
   
   Both the flows request and response are given below. 
   
   
   ### Step 3.2 Onboard & Pay Flow
   
   
   * User would be on-boarded on the Hyper-UPI and then Pay would happen. 
     
     
     #### Onboard & Pay Request Code Snippet:
     
     ```onboard & pay request
     {
       "service": "in.juspay.ec",
       "requestId": "f7700655-4afb-4809-9255-a20aabf27cbc",
       "payload": {
         "orderId": "hyperorder1698417375765",
         "mobileNumber": "7224996066",
         "merchantKeyId": "8321",
         "credOfferData": [
           {
             "paymentMethodType": "upiinapp",
             "offerData": [
               {
                 "preActionNudge": "Get Upto ₹100 cashback on CRED app",
                 "postActionNudge": "Save Upto ₹100 on next order using CRED Pay",
                 "paymentMethodType": "UPI",
                 "paymentMethod": "UPI",
                 "isEligible": true
               }
             ]
           }
         ],
         "clientAuthToken": "tkn_8595258ef79d4f34b70939c0158bc579",
         "action": "onboardingAndPay",
         "accountRefId": null
       }
     }
     
     ```
     
     
     Response:
     
     
     #### Onboard & Pay Response Code Snippet:
     
     ```onboard & pay response
     {
       "service": "in.juspay.ec",
       "requestId": "f7700655-4afb-4809-9255-a20aabf27cbc",
       "payload": {
         "txnUuid": "moz3x7M5MLsEkM5ZjJC",
         "status": "SUCCESS",
         "selectedAccount": {
           "vpa": "XXXX80@axisbiz",
           "account": {
             "type": "XOD",
             "referenceId": "Afa9eb4b5157455883f8244104c0a1",
             "name": "XBC",
             "mpinSet": "true",
             "maskedAccountNumber": "XXXXXXXXXX325878",
             "isPrimary": "true",
             "ifsc": "AABD0000011",
             "branchName": "",
             "bankName": "Mybank",
             "bankCode": "500007",
             "accountNumber": ""
           }
         },
         "orderId": "hyperorder1698417375765",
         "mutualFundDetails": null,
         "mandate": null,
         "gatewayResponseMessage": "Your transaction is successful",
         "gatewayResponseCode": "00",
         "action": "onboardingAndPay",
         "accountRefId": "Afa9eb4b5157455883f8244104c0a1"
       },
       "errorMessage": "",
       "errorCode": "",
       "error": false
     }
     
     ```
   
   
   
   
   ### Step 3.3 Pay Flow
   
   
   This is the flow in which user would already have been on-boarded on HyperUPI only Pay call would be made. 
   
   Request
   
   
   #### Pay Request Code Snippet:
   
   ```pay request
   {
     "service": "in.juspay.ec",
     "requestId": "1cdae6a6-b622-4daf-865f-98a78f24396b",
     "payload": {
       "vpa": "abcaa51452@axisbiz",
       "shouldCreateMandate": null,
       "orderId": "hyperorder1698414304631",
       "merchantKeyId": "8321",
       "credOfferData": [
         {
           "paymentMethodType": "upiinapp",
           "offerData": [
             {
               "preActionNudge": "Get Upto ₹100 cashback on CRED app",
               "postActionNudge": "Save Upto ₹100 on next order using CRED Pay",
               "paymentMethodType": "UPI",
               "paymentMethod": "UPI",
               "isEligible": true
             }
           ]
         }
       ],
       "clientAuthToken": "tkn_a8ebe4d5a8c54c648e4ac4f7869e7c1f",
       "action": "upiTxn",
       "accountRefId": "Afa9eb4b5157455883f8244104c0a1"
     }
   }
   
   ```
   
   
   
   Response: 
   
   
   #### Pay Response Code Snippet:
   
   ```pay response
   {
     "service": "in.juspay.ec",
     "requestId": "1cdae6a6-b622-4daf-865f-98a78f24396b",
     "payload": {
       "txnUuid": "mozixDA8i5WV1unmzMT",
       "status": "SUCCESS",
       "selectedAccount": {
         "vpa": "abcaa51452@axisbiz",
         "account": {
           "type": "SOD",
           "referenceId": "Afa9eb4b5157455883f8244104c0a1",
           "otpLength": "6",
           "name": "ABC",
           "mpinSet": "true",
           "mpinLength": "6",
           "maskedAccountNumber": "XXXXXXXXXX325878",
           "isPrimary": "true",
           "ifsc": "AABD0000011",
           "branchName": "",
           "bankName": "Mybank",
           "bankCode": "500007",
           "bankAccountUniqueId": "7cfeac090d01a0eca9d644946ac82cb3731203691a2d30ca45a5dfb986c3f2a8",
           "atmPinLength": "4"
         }
       },
       "otherInfo": "{}",
       "orderId": "hyperorder1698414304631",
       "gatewayResponseMessage": "Your transaction is successful",
       "gatewayResponseCode": "00",
       "action": "upiTxn",
       "accountRefId": "Afa9eb4b5157455883f8244104c0a1"
     },
     "errorMessage": "",
     "errorCode": "",
     "error": false
   }
   
   ```
   
   
   
   
   > **Note**
   > The cashback application will happen post receiving success status from the concerned payment gateway for the transaction. Juspay would raise offer allotment request to CRED for this. 
   
   
   
   **Sample Flow Diagram:** 
   
   ![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/cred.png)
   *Sample Cred Reward Layer Diagram*

---

## See Also

- [Changes for Payment Page Merchant](https://juspay.io/br/docs/payment-method-integrations/express-checkout-sdk/upiinapp-integration/changes-for-payment-page-merchant)
- [Amazon PayLater](https://juspay.io/br/docs/payment-method-integrations/express-checkout-sdk/consumer-finance/amazon-paylater)
