---
page_title: Loyalty Rewardz
product: Payment Method Integrations
platform: Express Checkout SDK
page_source: https://juspay.io/br/docs/payment-method-integrations/express-checkout-sdk/reward-integration/loyalty-rewardz
llms_txt: https://juspay.io/br/docs/llms.txt
product_llms_txt: https://juspay.io/br/docs/payment-method-integrations/llms.txt
---


# Loyalty Rewardz Onboarding and Payload Specifications




# Pre-Requisites




# Sample Requests and Responses




## —> getPaymentMethods 




#### Sample Response




#### json Code Snippet:

```json
{
    "juspayBankCode": "JP_LOYLTY",
    "paymentMethodType": "REWARD",
    "walletDirectDebitSupport": false,
    "paymentMethod": "LOYLTYREWARDZ",
    "nickName": "Loylty Rewards",
    "supportedReferenceIds": [
        "testmode"
    ],
    "description": "Loylty Rewards",
    "supportedByDefault": false,
    "paymentMethodSubType": "REWARD"
}

```



## —> listCard (To Check Eligibility for Saved Cards)




#### Sample Payload




#### json Code Snippet:

```json
{
    "payload": {
        "action": "cardList",
        "clientAuthToken": "tkn_ec41f7b05a7247cc9437597efb671d67",
        "checkRewardsSupport": true
    },
    "requestId": "ad8c01d9-770b-4313-81a4-54d6f42e99f8",
    "service": "in.juspay.ec"
}

```



#### Sample Response




#### json Code Snippet:

```json
{
  "error": false,
  "errorCode": "",
  "errorMessage": "",
  "payload": {
    "action": "cardList",
    "cards": [
      {
        "cardBrand": "VISA",
        "cardExpMonth": "RIPPIFILTERED",
        "cardExpYear": "RIPPIFILTERED",
        "cardFingerprint": "4vr1eaobkjwym11p5wds8akeb",
        "cardIsin": "401704",
        "cardIssuer": "ICICI Bank",
        "cardIssuerCountry": "INDIA",
        "cardNumber": "XXXX-XXXXXXXX-6093",
        "cardReference": "cref_abf7860679b94ace894c7d8b2a8602d7",
        "cardSubType": "VISA PLATINUM",
        "cardToken": "tkn_1b2802721c8b414f9620bb9a9eeba6b9",
        "cardType": "DEBIT",
        "expired": false,
        "juspayBankCode": "JP_ICICI",
        "nameOnCard": "name",
        "nickname": "",
        "provider": "VISA",
        "providerCategory": "NETWORK",
        "token": {
          "cardFingerprint": "4vr1eaobkjwym11p5wds8akeb",
          "cardIsin": "442305587",
          "cardReference": "cref_abf7860679b94ace894c7d8b2a8602d7",
          "expiryMonth": "RIPPIFILTERED",
          "expiryYear": "RIPPIFILTERED",
          "lastFourDigits": "8940",
          "par": "V0010013822352369299779767825",
          "tokenizationStatus": "ACTIVE"
        },
        "tokenizeSupport": false,
        "rewardSupportGateways": ["LOYLTYREWARDZ"],
        "rewardSupported": true
      }
    ],
    "customerId": "2f8c9e59383223942eabb81c05d801c3",
    "merchantId": "slice"
  },
  "requestId": "6BA77B76-6011-4706-AA6C-73C8D5B79F5E",
  "service": "in.juspay.ec"
}
```



## —> cardInfo (To Check Eligibility for New Cards)




#### Sample Payload




#### json Code Snippet:

```json
{
    "payload": {
        "action": "cardInfo",
        "cardBin": "512967",
        "checkMandateSupport": true,
        "checkTokenizeSupport": true,
        "checkRewardsSupport": true,
        "clientAuthToken": "tkn_4f6c2530bff84f7cb2ce83893ead48cd",
        "currentActivityId": "3abce9cb-a561-4cef-a899-1da94b087158",
        "merchant_keyboard_mode": 16,
        "merchant_root_view": "16908290",
        "processStartedTime": 1713436350376
    },
    "requestId": "a92c4dcd-664c-4c25-b191-82bc6630f53a",
    "service": "in.juspay.ec"
}

```



#### Sample Response




#### Shell Code Snippet:

```shell
{
    "error": false,
    "errorCode": "",
    "errorMessage": "",
    "payload": {
        "action": "cardInfo",
        "bank": "Axis Bank",
        "brand": "MASTERCARD",
        "cardSubType": "",
        "country": "INDIA",
        "extendedCardType": "CREDIT",
        "id": "533467",
        "juspayBankCode": "JP_AXIS",
        "object": "cardbin",
        "type": "CREDIT",
        "rewardSupportGateways": ["LOYLTYREWARDZ"],
        "rewardSupported": true
        
    },
    "requestId": "E5517C4A-6628-469E-82F0-2B35334C9D1C",
    "service": "in.juspay.ec"
}

```



## —> fetchBalance




#### Sample Payload




#### json Code Snippet:

```json
{
    "service": "in.juspay.ec",
    "requestId": "7b5fcca3-bf4e-4645-9fcd-a40ab2ef8b07",
    "ppFlow": null,
    "payload": {
        "signaturePayload": "<signature_payload>",
        "Signature": "<signature>",
        "mobileNumber": "9620126248",
        "merchantKeyId": "8321",
        "merchantId": "picasso",
        "invoiceAmount": 1000,
        "gatewayReferenceId": "testmode",
        "clientAuthToken": "tkn_6ab49f47792c4c7faa8e9fb54b127ce7",
        "cardType": "LOYLTYREWARDZ",
        "cardLastFour": "1614",
        "cardIsin": "459156",
        "action": "fetchCardPointsBalance"
    },
    "orderId": "HI-1ajtLcEQ8O",
    "merchant_id": "picasso",
    "lifeCycleId": "sdk:4c8aec7b-a605-48af-841e-84205a15552a/os:40de9637-1d96-462f-9f05-d7b28668c547/hyperpay:260d7c3d-d9e2-4c9c-9f77-a241cd191d37",
    "environment": "sandbox",
    "customer_id": "cth_srimitra123",
    "client_id": "picasso",
    "service_based": "true"
}
```



#### Sample Response




#### json Code Snippet:

```json
{
    "service": "in.juspay.ec",
    "requestId": "7b5fcca3-bf4e-4645-9fcd-a40ab2ef8b07",
    "payload": {
        "action": "fetchCardPointsBalance",
        "rewardDetails": {
            "programCode": "YesDc",
            "cardLastFour": "1614"
        },
        "isEligible": true,
        "balance": 1000
    },
    "errorMessage": "",
    "errorCode": "",
    "error": false
}
```



## —> transaction (Full Redemption)



(If balance is equal to invoice amount)


#### Sample Payload




#### json Code Snippet:

```json
{
    "service": "in.juspay.ec",
    "requestId": "27037f53-b3a3-450c-8871-9f91d54eed87",
    "ppFlow": "paymentpage",
    "payload": {
        "txnIntentId": null,
        "Signature": "<signature>",
        "reqId": "29375815-1e37-475e-924c-fce076754201",
        "redirectAfterPayment": true,
        "programCode": "YesDc",
        "paymentMethodType": "REWARD",
        "paymentMethod": "LOYLTYREWARDZ",
        "orderId": "HI-1ajtLcEQ8O",
        "orderDetails": "<orderDetails>",
        "mobileNumber": "9620126248",
        "merchantKeyId": "8321",
        "merchantId": "picasso",
        "isPopupView": true,
        "format": "json",
        "clientId": "picasso",
        "clientAuthToken": "tkn_6ab49f47792c4c7faa8e9fb54b127ce7",
        "cardLastFour": "1614",
        "authType": "OTP",
        "amount": "1000.0",
        "action": "cardPointsTxn"
    },
    "orderId": "HI-1ajtLcEQ8O",
    "merchant_id": "picasso",
    "lifeCycleId": "sdk:4c8aec7b-a605-48af-841e-84205a15552a/os:40de9637-1d96-462f-9f05-d7b28668c547/hyperpay:260d7c3d-d9e2-4c9c-9f77-a241cd191d37",
    "environment": "sandbox",
    "customer_id": "cth_srimitra123",
    "client_id": "picasso",
    "service_based": "true"
}
```



#### Sample Response




#### json Code Snippet:

```json
{
    "service": "in.juspay.ec",
    "requestId": "5ccac13f-4c7d-45c0-8977-c37590cd60a8",
    "payload": {
        "action": "cardPointsTxn",
        "txnList": [],
        "statusId": 21,
        "status": "CHARGED",
        "returnUrl": "<return_url>",
        "otherInfo": {
            "status": "SUCCESS"
        },
        "orderId": "DW-qnur3eewcH",
        "offerDetails": {
            "offers": []
        },
        "merchantId": "picasso",
        "gatewayId": 273,
        "errorInfo": {},
        "bankErrorMessage": "",
        "bankErrorCode": ""
    },
    "errorMessage": "",
    "errorCode": "",
    "error": false
}

```



## —> transaction (Split)



(If balance is less than invoice amount)


#### Sample Payload




#### json Code Snippet:

```json
{
    "service": "in.juspay.ec",
    "requestId": "e609f858-987e-469c-8d1b-f9fd46592b83",
    "ppFlow": "paymentpage",
    "payload": {
        "tokenize": true, 
        "smsPermissionDenyLimit": 3,
        "signature": "<signature>",
        "shouldCreateMandate": null,
        "saveToLocker": true,
        "requestId": "b1203aa5-5584-497b-8176-940cfa1fa5e5",
        "redirectAfterPayment": null,
        "ppFlow": "paymentpage",
        "paymentMethod": "VISA",
        "orderId": "HI-h3pUj77sEv",
        "orderDetails": "<order_details>",
        "offers": "<Offer Ids if any>",
        "offerToken": "",
        "nameOnCard": "",
        "merchantKeyId": "8321",
        "maskedCardNumber": null,
        "linkedMobileNumber": null,
        "isPopupView": true,
        "isNewTabFlow": false,
        "isEmi": null,
        "handleRetry": null,
        "endUrls": [
            ""
        ],
        "emiType": null,
        "emiTenure": null,
        "emiBank": null,
        "displayBusinessAs": null,
        "discountedAmount": "54999.0",
        "clientAuthToken": "tkn_d27c510d708f45d1813971cfd89745c9",
        "card_encoding_version": null,
        "cardType": "DEBIT",
        "cardSupportTokenize": true,
        "cardSupportMandate": true,
        "cardSupportDotp": true,
        "cardSecurityCode": "111",
        "cardNumber": "4591560070841614",
        "cardExpYear": "29",
        "cardExpMonth": "11",
        "cardBank": "JP_SBI",
        "cardAlias": null,
        "authType": "OTP",
        "amount": "100000.0",
        "additionalPaymentDetails": [
            {
                "split_amount": "15001",
                "reward_details": "{\"program_code\":\"YesDc\",\"card_last_four\":\"1614\"}",
                "payment_method_type": "REWARD",
                "payment_method": "LOYLTYREWARDZ",
                "mobile_number": "9620126248"
            }
        ],
        "action": "cardTxn"
    },
    "orderId": "HI-h3pUj77sEv",
    "merchant_id": "picasso",
    "lifeCycleId": "sdk:08e9b8ac-9da1-4bb4-bfe2-b0808aafa431/os:e0e8c1db-6d79-4f19-99c2-5fb4f9b5c7f9/hyperpay:3c6db187-1e53-495f-8e0c-c9aaf99609d0",
    "environment": "sandbox",
    "customer_id": "cth_srimitra123",
    "client_id": "picasso",
    "service_based": "true"
}
```



#### Sample Response




#### json Code Snippet:

```json
{
    "errorMessage": "",
    "requestId": "3049bb61-84e2-47f9-8c6b-9eb8445a34af",
    "service": "in.juspay.ec",
    "payload": {
      "txnList": [
        {
          "txnUuid": "moz9U1rm9fLKRUj1vAr",
          "paymentMethodType": "CARD",
          "paymentMethod": "VISA",
          "txnId": "picasso-hyperorder1713513285306-1-1",
          "txnAmount": 2,
          "txnStatus": "CHARGED"
        },
        {
          "txnUuid": "mozpSCZqcmNaB3oSeg7",
          "paymentMethodType": "REWARD",
          "paymentMethod": "LOYLTYREWARDZ",
          "txnId": "picasso-hyperorder1713513285306-1-2",
          "txnAmount": 498,
          "txnStatus": "CHARGED"
        }
      ],
      "merchantId": "picasso",
      "otherInfo": {
        "url": "https://sandbox.juspay.in/end?order_id=hyperorder1713513285306&status=CHARGED&status_id=21&signature=6gTOSeUDqVMRROLPiyC9yhgtUhYPB4Oku8NRrtbTOoY%3D&signature_algorithm=HMAC-SHA256",
        "realtime": {
          "merchantId": "picasso",
          "os": "ANDROID",
          "disableECLoader": "true",
          "customerId": "cth_srimitra123",
          "environment": "sandbox",
          "clientId": "groww",
          "amazonPay": "true",
          "signaturePayload": "{\"merchant_id\":\"picasso\",\"customer_id\":\"cth_srimitra123\",\"mobile_number\":\"RIPPIFILTERED\",\"email_address\":\"RIPPIFILTERED\",\"first_name\":\"Test\",\"last_name\":\"Customer\",\"timestamp\":\"1713513288218\"}",
          "aPayPrefetchResp": "{\"responseValue\":false,\"responseDetails\":\"Register for UPI on the Amazon app\",\"responseCode\":460}",
          "requestID": "9470682e-4090-4b7e-8fca-b1767923a447",
          "merchantKeyId": "8321",
          "requestId": "3049bb61-84e2-47f9-8c6b-9eb8445a34af",
          "globalHeaders": "{\"headersList\":[{\"headerValue\":null,\"headerKey\":\"x-routing-id\"},{\"headerValue\":\"picasso\",\"headerKey\":\"x-merchantid\"},{\"headerValue\":\"hyperorder1713513285306\",\"headerKey\":\"x-orderid\"}]}",
          "PPAfterRenderEnd": 1713513301289,
          "lastVisitedUrl": "https://api.razorpay.com/v1/payments/pay_O0PEgiywaFvR3f/callback/42906857a7cd34594091c9ffbf524f3458dfae62/rzp_test_oauth_Nk8qkIE651jm5E?status=authorized&token_recurring_status=rejected&language_code=en",
          "shouldCreateCustomer": "false",
          "isWrapper": "false",
          "merchantLoader": "false",
          "signature": "s+RvAES+UBc9s+Dow8jG/7P1X2yxqu1kWyQeZqwW4BFSRdzDx604na7siAT8qMGF1r0wODqTYCG9\nHnYiOZpkxcJ5aZbAyxMq7ZGS6kubLuffdSn1f3XUzJ1uP2bZbl7+d/3PJs3lE2tzc7ICe2Wj2XM7\nyD/ZEgRaO7bUwQoEabpiFLLU1RN1gcgO5UZbxE7ceE5lQed7vxqFIT7V1wqWzt/GtjTm/KxZ8mSF\n3LHG3k0QvXZ+P1uDrVor9RdHs40qnCNn3IXn8pf8P5y/mUXGfQGymuAtKZtow7qzLY46VF9pgypH\nsKLpSHYBaN6/nb5lJ0IoPWvwBmhwE32gAxi/HA==\n",
          "eligibiltyInInitiate": "false",
          "clientAuthToken": ""
        }
      },
      "statusId": 21,
      "status": "CHARGED",
      "orderId": "hyperorder1713513285306",
      "action": "cardTxn",
      "errorInfo": {}
    },
    "errorCode": "",
    "error": false
}
```



## —> Order Status



With the existing implementation on Juspay , the transaction level details are available in the root structure of the orderStatus(`/orders/:order_id`) JSON block.

> **Note**
> * **AUTO_REFUNDED** 
>   
>   * New status `AUTO_REFUNDED`, which indicates than primary card transaction is successful but the `LOYLTYREWARDZ` transaction got failed and JUSPAY has called Auto Refund for primary card transaction.
> * **PARTIAL_CHARGED** 
>   
>   * New status `PARTIAL_CHARGED`, which indicates than primary card transaction is successful but the `LOYLTYREWARDZ` transaction is in PENDING state.
>   * If `LOYLTYREWARDZ` transaction get failed then JUSPAY will auto refund Card transaction.
>   * If `LOYLTYREWARDZ` transaction get successful then JUSPAY will mark status as `CHARGED`.
> * Only incase of split transactions, orderStatus response will return `txn_list` as an array block in with the 2 transactions (CARD + LOYLTYREWARDZ). You need to make sure to consume the params from inside the `txn_list` array block.
> * As orderStatus response is changing incase of split transaction and `AUTO_REFUNDED`**/** `PARTIAL_CHARGED` case, It will also effect webhook payload (If already handled no need for any change).




#### Sample Request




#### Shell Code Snippet:

```shell
curl --location 'https://api.juspay.in/ecr/orders/<orderId> \
--header 'Authorization: Basic Auth'
--header 'Version: 2024-01-01'

```



#### Sample Response (Full Redemption)




#### Json Code Snippet:

```json
{
    "customer_email": "amritin@gmail.com",
    "customer_phone": "7892369201",
    "customer_id": "cth_7BSdG1PTnKZLBJ9c",
    "status_id": 21,
    "status": "CHARGED",
    "id": "ordeh_4ce8c4ae74fe4d75868422d2001ac1dd",
    "merchant_id": "udit_juspay",
    "amount": 10,
    "currency": "INR",
    "order_id": "ord_1712290550",
    "date_created": "2024-04-05T04:15:50Z",
    "return_url": "https://juspay.in",
    "product_id": "",
    "payment_links": {
        "iframe": "http://localhost:8080/merchant/ipay/ordeh_4ce8c4ae74fe4d75868422d2001ac1dd",
        "web": "http://localhost:8080/merchant/pay/ordeh_4ce8c4ae74fe4d75868422d2001ac1dd",
        "mobile": "http://localhost:8080/merchant/pay/ordeh_4ce8c4ae74fe4d75868422d2001ac1dd?mobile=true"
    },
    "udf1": "",
    "udf2": "",
    "udf3": "",
    "udf4": "",
    "udf5": "",
    "udf6": "",
    "udf7": "",
    "udf8": "",
    "udf9": "",
    "udf10": "",
    "txn_id": "udit_juspay-ord_1712290550-1",
    "payment_method_type": "REWARD",
    "auth_type": "",
    "payment_method": "LOYLTYREWARDZ",
    "refunded": false,
    "amount_refunded": 20,
    "effective_amount": 10,
    "refunds": [
        {
            "id": null,
            "amount": 10,
            "unique_request_id": "udit_juspay_ord_1712290550_1",
            "ref": "4598b588-8107-4bac-9ee9-d7530779c8fc",
            "created": "2024-04-05T05:14:49Z",
            "status": "SUCCESS",
            "error_message": "",
            "sent_to_gateway": true,
            "initiated_by": "API",
            "refund_source": "LOYLTYREWARDZ",
            "refund_type": "STANDARD",
            "metadata": {
                "epay_ref_no": "4598b588-8107-4bac-9ee9-d7530779c8fc",
                "points_expired_amt": 0,
                "points_refunded_amt": 10
            },
            "pg_processed_at": "2024-04-05T05:15:01Z",
            "error_code": null
        }
    ],
    "resp_code": null,
    "resp_message": null,
    "bank_error_code": "",
    "bank_error_message": "",
    "txn_uuid": "mozkKMk9CbTSuJv9foG",
    "txn_detail": {
        "txn_id": "udit_juspay-ord_1712290550-1",
        "order_id": "ord_1712290550",
        "status": "CHARGED",
        "error_code": null,
        "net_amount": 10,
        "surcharge_amount": 0,
        "tax_amount": 0,
        "txn_amount": 10,
        "offer_deduction_amount": null,
        "gateway_id": 273,
        "currency": "INR",
        "express_checkout": false,
        "redirect": true,
        "txn_uuid": "mozkKMk9CbTSuJv9foG",
        "gateway": "LOYLTYREWARDZ",
        "error_message": "",
        "created": "2024-04-05T04:15:54Z",
        "txn_flow_type": "REDIRECT_DEBIT"
    },
    "payment_gateway_response": {
        "resp_code": "200",
        "rrn": null,
        "created": "2024-04-05T04:16:08Z",
        "epg_txn_id": "854d236f-c9e7-4291-9e01-d1960e79d65f",
        "resp_message": "",
        "auth_id_code": null,
        "txn_id": "udit_juspay-ord_1712290550-1",
        "gateway_response": {
            "Code": 200,
            "Data": {
                "epay_txn_status": "CONFIRMED",
                "Refund": [],
                "epay_id": "854d236f-c9e7-4291-9e01-d1960e79d65f",
                "epay_txn_id": "37c1c42e-a2ac-48a8-9582-7089c82eed8a",
                "order_no": "udit_juspay-ord_1712290550-1",
                "paid_by_points": 10,
                "invoice_amt": 10
            },
            "FailureReasons": [],
            "Message": "",
            "Success": true
        },
        "network_error_message": null,
        "network_error_code": null
    },
    "gateway_id": 273,
    "metadata": {
        "LOYLTYREWARDZ:gateway_reference_id": "test_ref_2",
        "payment_links": {
            "iframe": "http://localhost:8080/merchant/ipay/ordeh_4ce8c4ae74fe4d75868422d2001ac1dd",
            "web": "http://localhost:8080/merchant/pay/ordeh_4ce8c4ae74fe4d75868422d2001ac1dd",
            "mobile": "http://localhost:8080/merchant/pay/ordeh_4ce8c4ae74fe4d75868422d2001ac1dd?mobile=true"
        }
    },
    "gateway_reference_id": "test_ref_2",
    "offers": [],
    "maximum_eligible_refund_amount": 0,
    "additional_info": {},
    "resp_category": null
}

```



#### Sample Response (Split)




#### Json Code Snippet:

```json
{
    "customer_email": "amritin@gmail.com",
    "customer_phone": "7892369201",
    "customer_id": "cth_7BSdG1PTnKZLBJ9c",
    "status_id": 21,
    "status": "CHARGED",
    "id": "ordeh_3928cebc762a41baba4c03d1b87e095d",
    "merchant_id": "udit_juspay",
    "amount": 10300,
    "currency": "INR",
    "order_id": "ord_1712586805",
    "date_created": "2024-04-08T14:33:25Z",
    "return_url": "https://juspay.in",
    "product_id": "",
    "payment_links": {
        "iframe": "http://localhost:8080/merchant/ipay/ordeh_3928cebc762a41baba4c03d1b87e095d",
        "web": "http://localhost:8080/merchant/pay/ordeh_3928cebc762a41baba4c03d1b87e095d",
        "mobile": "http://localhost:8080/merchant/pay/ordeh_3928cebc762a41baba4c03d1b87e095d?mobile=true"
    },
    "udf1": "",
    "udf2": "",
    "udf3": "",
    "udf4": "",
    "udf5": "",
    "udf6": "",
    "udf7": "",
    "udf8": "",
    "udf9": "",
    "udf10": "",
    "refunded": false,
    "amount_refunded": 0,
    "effective_amount": 20600,
    "txn_list": [
        {
            "txn_id": "udit_juspay-ord_1712586805-1-1",
            "payment_method_type": "CARD",
            "auth_type": "THREE_DS",
            "card": {
                "expiry_year": "2029",
                "card_reference": "",
                "saved_to_locker": false,
                "expiry_month": "02",
                "name_on_card": "Test",
                "card_issuer": "HDFC BANK",
                "last_four_digits": "4343",
                "using_saved_card": false,
                "card_fingerprint": "",
                "card_isin": "435708",
                "card_type": "DEBIT",
                "card_brand": "VISA",
                "using_token": false,
                "tokens": [],
                "token_type": "CARD",
                "card_issuer_country": "INDIA",
                "juspay_bank_code": "",
                "extended_card_type": "DEBIT",
                "payment_account_reference": ""
            },
            "payment_method": "VISA",
            "refunded": false,
            "amount_refunded": 0,
            "effective_amount": 56,
            "refunds": [
                {
                    "id": "udit_juspay_ord_1712586805",
                    "amount": 56,
                    "unique_request_id": "udit_juspay_ord_1712586805",
                    "ref": null,
                    "created": "2024-04-09T12:08:20Z",
                    "status": "PENDING",
                    "error_message": "",
                    "sent_to_gateway": true,
                    "initiated_by": "API",
                    "refund_source": "RAZORPAY",
                    "refund_type": "STANDARD",
                    "error_code": null
                }
            ],
            "resp_code": null,
            "resp_message": null,
            "bank_error_code": "",
            "bank_error_message": "",
            "txn_uuid": "mozotSK5bjgHjs1qgSm",
            "txn_detail": {
                "txn_id": "udit_juspay-ord_1712586805-1-1",
                "order_id": "ord_1712586805",
                "status": "CHARGED",
                "error_code": null,
                "net_amount": 10300,
                "surcharge_amount": 0,
                "tax_amount": 0,
                "txn_amount": 56,
                "offer_deduction_amount": null,
                "gateway_id": 23,
                "currency": "INR",
                "express_checkout": false,
                "redirect": true,
                "txn_uuid": "mozotSK5bjgHjs1qgSm",
                "gateway": "RAZORPAY",
                "error_message": "",
                "created": "2024-04-08T14:35:22Z",
                "txn_flow_type": "CARD_TRANSACTION"
            },
            "payment_gateway_response": {
                "resp_code": "SUCCESS",
                "rrn": "776297",
                "created": "2024-04-08T14:35:55Z",
                "epg_txn_id": "pay_NwAAnDCmz1smDB",
                "resp_message": "SUCCESS",
                "auth_id_code": "776297",
                "txn_id": "udit_juspay-ord_1712586805-1-1",
                "gateway_response": {
                    "acquirer_data": "<auth_code>776297</auth_code>",
                    "amount": "5600",
                    "amount_refunded": "0",
                    "auth_code": "776297",
                    "captured": "true",
                    "card_id": "card_NwAAnJwe6B8Wx9",
                    "contact": "+917892369201",
                    "created_at": "1712586946",
                    "currency": "INR",
                    "description": "",
                    "email": "amritin@gmail.com",
                    "entity": "payment",
                    "fee": "118",
                    "id": "pay_NwAAnDCmz1smDB",
                    "international": "false",
                    "method": "card",
                    "notes": "<txn_uuid>mozotSK5bjgHjs1qgSm</txn_uuid><transaction_id>udit_juspay-ord_1712586805-1-1</transaction_id>",
                    "order_id": "order_NwAAmMjuOX59jn",
                    "status": "captured",
                    "tax": "0"
                },
                "debit_amount": "56.0",
                "network_error_message": null,
                "network_error_code": null
            },
            "gateway_id": 23,
            "gateway_reference_id": "rzp_card",
            "metadata": {
                "LOYLTYREWARDZ:gateway_reference_id": "test_ref_2",
                "payment_links": {
                    "iframe": "http://localhost:8080/merchant/ipay/ordeh_3928cebc762a41baba4c03d1b87e095d",
                    "web": "http://localhost:8080/merchant/pay/ordeh_3928cebc762a41baba4c03d1b87e095d",
                    "mobile": "http://localhost:8080/merchant/pay/ordeh_3928cebc762a41baba4c03d1b87e095d?mobile=true"
                },
                "RAZORPAY:gateway_reference_id": "rzp_card"
            },
            "offers": [],
            "status": "CHARGED",
            "resp_category": null
        },
        {
            "txn_id": "udit_juspay-ord_1712586805-1-2",
            "payment_method_type": "REWARD",
            "auth_type": "",
            "payment_method": "LOYLTYREWARDZ",
            "refunded": false,
            "amount_refunded": 0,
            "effective_amount": 10244,
            "refunds": [
                {
                    "id": null,
                    "amount": 10244,
                    "unique_request_id": "udit_juspay_ord_1712586805-1",
                    "ref": null,
                    "created": "2024-04-09T12:08:20Z",
                    "status": "PENDING",
                    "error_message": "",
                    "sent_to_gateway": true,
                    "initiated_by": "API",
                    "refund_source": "LOYLTYREWARDZ",
                    "refund_type": "STANDARD",
                    "error_code": "ECONNABORTED"
                }
            ],
            "resp_code": null,
            "resp_message": null,
            "bank_error_code": "",
            "bank_error_message": "",
            "txn_uuid": "mozkrFWfD7Fqw1xK3Yr",
            "txn_detail": {
                "txn_id": "udit_juspay-ord_1712586805-1-2",
                "order_id": "ord_1712586805",
                "status": "CHARGED",
                "error_code": null,
                "net_amount": 10300,
                "surcharge_amount": 0,
                "tax_amount": 0,
                "txn_amount": 10244,
                "offer_deduction_amount": null,
                "gateway_id": 273,
                "currency": "INR",
                "express_checkout": false,
                "redirect": false,
                "txn_uuid": "mozkrFWfD7Fqw1xK3Yr",
                "gateway": "LOYLTYREWARDZ",
                "error_message": "",
                "created": "2024-04-08T14:35:21Z",
                "txn_flow_type": "DIRECT_DEBIT"
            },
            "payment_gateway_response": {
                "resp_code": "",
                "rrn": null,
                "created": "2024-04-08T14:36:12Z",
                "epg_txn_id": "c4f8f3b6-d076-449a-bbc4-968c5ff13ea3",
                "resp_message": "",
                "auth_id_code": null,
                "txn_id": "udit_juspay-ord_1712586805-1-2",
                "gateway_response": {
                    "Code": 200,
                    "Data": {
                        "epay_id": "c4f8f3b6-d076-449a-bbc4-968c5ff13ea3",
                        "epay_txn_id": "dc9ca99f-039e-4e54-9820-63bbae9fbecd",
                        "paid_by_points": 10244
                    },
                    "FailureReasons": [],
                    "Message": "",
                    "Success": true
                },
                "network_error_message": null,
                "network_error_code": null
            },
            "gateway_id": 273,
            "gateway_reference_id": "test_ref_2",
            "metadata": {
                "LOYLTYREWARDZ:gateway_reference_id": "test_ref_2",
                "payment_links": {
                    "iframe": "http://localhost:8080/merchant/ipay/ordeh_3928cebc762a41baba4c03d1b87e095d",
                    "web": "http://localhost:8080/merchant/pay/ordeh_3928cebc762a41baba4c03d1b87e095d",
                    "mobile": "http://localhost:8080/merchant/pay/ordeh_3928cebc762a41baba4c03d1b87e095d?mobile=true"
                },
                "RAZORPAY:gateway_reference_id": "rzp_card"
            },
            "offers": [],
            "status": "CHARGED",
            "resp_category": null
        }
    ]
}

```



## —> Refunds




### Refund Cases Substep


Refund requests (full/partial) can be initiated by a Juspay’s merchant at Transaction level or at Order level.

2. Given that LOYLTYREWARDZ transactions can be split between an existing Gateway and LOYLTYREWARDZ, the merchant can choose between one of the two provisions -

3. For Order based refunds, 

1. merchant will have to pass `order_id` & `amount` (refund amount) to Juspay.
2. Order may have 2 transactions (Card and LOYLTYREWARDZ), Juspay will try to prioritise card transaction for refund and if the refund amount is greater than card transaction amount then JUSPAY will initiate refund call to LOYLTYREWARDZ.
3. In case refund amount is lower than card transaction amount than merchant will receive refund response similar to transaction id based refund response
4. Merchant will receive Juspay’s refund response accordingly (post PG processing) and is expected to handle the same (new key “split_refund_details”)

4. For Transaction based refunds

1. merchant would initiate refunds against all transaction Ids, with transaction Id and amount to Juspay
2. Merchant will ensure the amount checks and the refund split for both full and partial refunds.
3. Juspay’s refund response will remain the same as what merchants currently see for transaction based refunds. No additional handling required.




## —> Order Based Refunds




#### Sample Request




#### Shell Code Snippet:

```shell
curl --location 'https://api.juspay.in/orders/{order_id}/refunds' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic \
--data-urlencode 'unique_request_id=URI_1696429607' \
--data-urlencode 'amount=950'

```



#### Sample Response




#### Json Code Snippet:

```json
{
  "order_id": "ord_1712586805",
  "status": "SUCCESS",
  "amount": 10300,
  "sent_to_gateway": true,
  "unique_request_id": "udit_juspay_ord_1712586805",
  "gateway": "RAZORPAY",
  "created": "2024-04-09T12:08:20Z",
  "initiated_by": "API",
  "split_refund_details": [
      {
          "status": "SUCCESS",
          "amount": 56,
          "sent_to_gateway": true,
          "unique_request_id": "udit_juspay_ord_1712586805",
          "gateway": "RAZORPAY",
          "refund_source": "RAZORPAY",
          "txn_id": "udit_juspay-ord_1712586805-1-1",
          "reference_id": "udit_juspay_ord_1712586805",
          "refund_type": "STANDARD"
      },
      {
          "status": "SUCCESS",
          "amount": 10244,
          "sent_to_gateway": true,
          "unique_request_id": "udit_juspay_ord_1712586805-1",
          "gateway": "LOYLTYREWARDZ",
          "refund_source": "LOYLTYREWARDZ",
          "txn_id": "udit_juspay-ord_1712586805-1-2",
          "refund_type": "STANDARD"
      }
  ],
  "refund_source": "RAZORPAY",
  "refund_arn": null,
  "error_message": null,
  "epg_txn_id": "7a282d9c-f4a1-4f12-be2c-82147e54d2e0",
  "txn_id": "udit_juspay-ord_1712586805-1-1",
  "authorization_id": null,
  "reference_id": "udit_juspay_ord_1712586805",
  "response_code": null,
  "refund_type": "STANDARD"
}

```



## —> Transaction Based Refunds




#### Sample Request




#### Shell Code Snippet:

```shell
curl --location 'https://api.juspay.in/orders/txns/<txnId>/refunds' \
--header 'Accept: application/json' \
--header 'version: 2022-03-16' \
--header 'x-merchantid:<merchantId>' \
--header 'Authorization: Basic Auth' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'unique_request_id=req-1695671557' \
--data-urlencode 'amount=998'

```



#### Sample Response




#### Json Code Snippet:

```json
{
  "order_id": "ord_1712313308",
  "status": "SUCCESS",
  "amount": 10500,
  "sent_to_gateway": true,
  "unique_request_id": "refund_1712314361_1",
  "gateway": "LOYLTYREWARDZ",
  "created": "2024-04-05T10:52:41Z",
  "initiated_by": "API",
  "refund_source": "LOYLTYREWARDZ",
  "refund_arn": "",
  "error_message": null,
  "epg_txn_id": "7a282d9c-f4a1-4f12-be2c-82147e54d2e0",
  "txn_id": "udit_juspay-ord_1712313308-1-2",
  "authorization_id": null,
  "reference_id": null,
  "response_code": null,
  "refund_type": "STANDARD"
}

```


---

## See Also

- [TWID V2](https://juspay.io/br/docs/payment-method-integrations/express-checkout-sdk/reward-integration/twid-v2)
- [CRED Credit Card reward](https://juspay.io/br/docs/payment-method-integrations/express-checkout-sdk/reward-integration/cred-credit-card-reward)
