---
page_title: BharatX Pay in 3
product: Payment Method Integrations
platform: Express Checkout SDK
page_source: https://juspay.io/in/docs/payment-method-integrations/express-checkout-sdk/consumer-finance/bharatx-pay-in-3
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/payment-method-integrations/llms.txt
---


# BharatX Pay In 3




## Gateway Configuration:



1. Configure the sandbox gateway credentials on your Sandbox environment / Configure and enable Production Credentials on your Production Environment

> **Note**
> Sandbox URL : [https://sandbox.portal.juspay.in](https://sandbox.portal.juspay.in%EF%BF%BCProduction)Production URL : [https://portal.juspay.in](https://portal.juspay.in)




### Step 1.1 Configuring a new gateway account for BHARATX on the Juspay Dashboard


Merchant needs to get credentials for Bharatx Pay in 3 from BHARATX and configure it in Juspay dashboard under section “PG CONTROL CENTER” in already existing gateway “BHARATX”



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/BharatX_1.png)
*BharatX Gateway*




### Step 1.2 Adding Gateway Credentials


1. For configuring sandbox credentials select test credentials and for production credentials select live credentials
2. Assign a gateway reference id (if you have to configure gateway more than once)
3. Update the credentials received by the gateway (test or live)



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/BharatX_2.png)
*Select Environment*



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/BharatX_3.png)
*Assigning Gateway Ref Id (Skip if there's no requirement for flow based Checks)*



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/BharatX_5.png)
*Update Credentials*




### Step 1.3 Saving the gateway credentials and proceeding to add payment method


Select BHARATX Pay in 3 payment method



![Image](https://dth95m2xtyv8v.cloudfront.net/tesseract/assets/payment-method-integrations/BharatX_4.png)
* Select BHARATX Pay in 3*



2. Push the latest bundle supported for BharatX via Studio to CUG

3. Point your app/website to CUG ([Guide to CUG](https://docs.juspay.in/resources/docs/merchant-testing/cug-testing))

4. Complete a set of internal testing on Sandbox environment to understand the flow

5. Initiate a staggered release with the changes from CUG to be pushed to Production


## Sample Requests and Responses




### Merchant Payment Methods:



**getPaymentMethods Sample Request:** 


#### Shell Code Snippet:

```shell
{
      "payload": {
        "action": "paymentMethod",
        "add_default_reference_id": "true",
        "add_nick_name": "true",
        "add_supported_features": "true",
        "add_surcharge_logic": "false",
        "onlyLoadFile": false,
        "refresh": "true"
      },
      "requestId": "510e7715-d27d-4408-9e68-22dfd0730eef",
      "service": "in.juspay.ec"
 }

```


**getPaymentMethods Sample Response:** 


#### Shell Code Snippet:

```shell
{
            "description": "BharatX Pay In 3",
            "juspayBankCode": "BharatX",
            "nickName": "BharatX Pay In 3",
            "paymentMethod": "BHARATX",
            "paymentMethodSubType": "CF_EMI",
            "paymentMethodType": "CONSUMER_FINANCE",
            "supportedFeatures": [
              {
                "featureName": "eligibility",
                "supportedReferenceIds": ["toothsi"]
              }
            ],
            "supportedGateways": [
              {
                "gateway": "BHARATX",
                "gatewayId": 275,
                "supportedReferenceIds": ["toothsi"]
              }
            ],
            "supportedReferenceIds": ["toothsi"]
    }

```



### Eligibility:



**Sample Request:** 


#### Shell Code Snippet:

```shell
{
    "version": "2024-02-23",
    "signature": <Signature> ,
    "showLoader": false,
    "shipping_address": null,
    "requestId": null,
    "order_details": "<Order Details>",
    "orderId": "<Order Id>",
    "merchant_params": null,
    "merchant_key_id": <Merchant Key ID>,
    "items": null,
    "environment": <environment>,
    "device_params": null,
    "data": {
        "wallets": [
            {
                "mobileNumber": null,
                "mobile": "9742144874",
                "gatewayReferenceId": "<GatewayRefid>",
                "email": "<customer email>",
                "customerId": <customer id> ,
                "checkType": [
                    "simpl",
                    "twid"
                ]
            }
        ],
        "loanMarketplace": null,
        "cards": [],
        "apps": []
    },
    "clientAuthToken": "<Client Auth Token>",
    "amount": "<Order Amount>",
    "action": "eligibility"
}

```


**Sample Response:** 


#### Shell Code Snippet:

```shell
{
    "payment_methods_eligibility": [
        {
            "status": "SUCCESS",
            "payment_method": "BHARATX",
            "payment_method_type": "CONSUMER_FINANCE",
            "is_eligible": true,
            "description": "BharatX Pay In 3"
        },
        {
            "status": "NOT_ACCESSIBLE",
            "payment_method": "BHARATXPAYLATER",
            "payment_method_type": "CONSUMER_FINANCE",
            "is_eligible": true,
            "description": "BHARATX Paylater"
        }
    ]
}


```



### Note If Gateway Ref ID based logic is enabled


* If you have configured the BharatX gateway with a gateway_ref_id based logic, then you need to pass the gateway_ref_id(s) that is/are enabled for this gateway in the order_create request payload.
* E.g., —>
  
  * For one gateway alone —> metadata.<_gateway_ >:gateway_reference_id":"<_gateway_ref_id_ >
  * For all possible gateways —> metadata._JUSPAY_ :gateway_reference_id":"<_gateway_ref_id_ >
* Follow these links to know more about Gateway_Ref_ID based routing
  
  * [Order Create](https://docs.juspay.in/ec-headless/android/base-sdk-integration/create-order-api)
  * [Gateway Ref Id](https://docs.juspay.in/resources/docs/common-resources/gateway-reference-id)




### Transaction Create:



**Sample Curl:** 


#### Shell Code Snippet:

```shell
{
      "payload": {
        "action": "consumerFinanceTxn",
        "additionalPaymentDetails": [],
        "amount": "11000",
        "clientAuthToken": "tkn_2b940a6a8afe41a4ac52104eb0884d54",
        "endUrls": [
          ""
        ],
        "isEmi": false,
        "isNewTabFlow": false,
        "isPopupView": false,
        "orderId": "ord_C17JTSjnBNmUep",
        "paymentMethod": "BHARATX",
        "retry_suggestion_used": false
      },
      "requestId": "75ef520c-b290-4cf7-8a11-25a9b0ba8731",
      "service": "in.juspay.ec"
}


```


**Sample Response:** 


#### Shell Code Snippet:

```shell
{
    "ended": {
      "error": false,
      "errorCode": "",
      "errorMessage": "",
      "payload": {
        "action": "consumerFinanceTxn",
        "orderId": "ord_C17JTSjnBNmUep",
        "status": "redirected",
        "txnUuid": "mozmLSD1UXJm2D1pBd6"
      },
      "requestId": "75ef520c-b290-4cf7-8a11-25a9b0ba8731",
      "service": "in.juspay.ec"
    }
 }

```



### Order Status



**Sample curl:** 


#### Shell Code Snippet:

```shell
curl --location --request POST 'https://api.juspay.in/session' \
--header 'x-merchantid: yourMerchantId' \
--header 'Authorization: Basic base64encodedkey==' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount":"10.00",
"order_id":"yourUniqueOrderId",
"customer_id":"dummyCustId",
"customer_phone":"9876543210",
"customer_email":"dummyemail@gmail.com",
"payment_page_client_id":"<YOUR_CLIENT_ID>",
"action":"paymentPage"
}'

```


Note: options.add_full_gateway_response=true' can be set for receiving the PG response for reference

**Sample Response** 


#### JSON Code Snippet:

```json
"customer_email": "success@eligibility.com",
    "customer_phone": "8123894779",
    "customer_id": "cth_v3983WvKa6qZrQzc",
    "status_id": 21,
    "status": "CHARGED",
    "id": "ordeh_062761c8ee57432083c5d63b6a770f68",
    "merchant_id": "global_sandbox",
    "amount": 5,
    "currency": "INR",
    "order_id": "order_1689161867",
    "date_created": "2023-07-12T11:37:47Z",
    "return_url": "https://juspay.in",
    "product_id": "Shocks",
    "payment_links": {
        "iframe": "https://sandbox.juspay.in/orders/ordeh_062761c8ee57432083c5d63b6a770f68/payment-page",
        "web": "https://sandbox.juspay.in/orders/ordeh_062761c8ee57432083c5d63b6a770f68/payment-page",
        "mobile": "https://sandbox.juspay.in/orders/ordeh_062761c8ee57432083c5d63b6a770f68/payment-page"
    },
    "udf1": "",
    "udf2": "",
    "udf3": "",
    "udf4": "",
    "udf5": "",
    "udf6": "",
    "udf7": "",
    "udf8": "",
    "udf9": "",
    "udf10": "",
    "txn_id": "global_sandbox-order_1689161867-1",
    "payment_method_type": "CONSUMER_FINANCE",
    "auth_type": "",
    "payment_method": "BHARATX",
    "refunded": true,
    "amount_refunded": 5,
    "effective_amount": 5,
    "refunds": [
        {
            "id": "100000003478",
            "amount": 5,
            "unique_request_id": "refund_1689162794",
            "ref": "7867",
            "created": "2023-07-12T11:53:15Z",
            "status": "SUCCESS",
            "error_message": "",
            "sent_to_gateway": true,
            "initiated_by": "API",
            "refund_source": "BHARATX",
            "refund_type": "STANDARD"
        }
    ],
    "resp_code": null,
    "resp_message": null,
    "bank_error_code": "",
    "bank_error_message": "",
    "txn_uuid": "mozoMsSVz4EXeJ2ajTu",
    "txn_detail": {
        "txn_id": "global_sandbox-order_1689161867-1",
        "order_id": "order_1689161867",
        "status": "CHARGED",
        "error_code": null,
        "net_amount": 5,
        "surcharge_amount": null,
        "tax_amount": null,
        "txn_amount": 5,
        "offer_deduction_amount": null,
        "gateway_id": 275,
        "currency": "INR",
        "express_checkout": false,
        "redirect": true,
        "txn_uuid": "mozoMsSVz4EXeJ2ajTu",
        "gateway": "BHARATX",
        "error_message": "",
        "created": "2023-07-12T11:37:58Z",
        "txn_flow_type": "REDIRECT_DEBIT"
    },
    "payment_gateway_response": {
        "resp_code": "SUCCESS",
        "rrn": null,
        "created": "2023-07-12T11:39:03Z",
        "epg_txn_id": "global_sandbox-order_1689161867-1",
        "resp_message": "SUCCESS",
        "auth_id_code": null,
        "txn_id": "global_sandbox-order_1689161867-1",
        "gateway_response": {
            "configuration": null,
            "transaction": {
                "status": "SUCCESS",
                "amount": 500,
                "partnerId": "testPartnerId",
                "url": "https://web-v2.bharatx.tech/redirect/814539",
                "refund": null,
                "createTimestamp": 1689161881,
                "emis": [
                    {
                        "amount": 167,
                        "dueTimestamp": 1689161881,
                        "isPaid": true
                    },
                    {
                        "amount": 167,
                        "dueTimestamp": 1691773681,
                        "isPaid": false
                    },
                    {
                        "amount": 166,
                        "dueTimestamp": 1694365681,
                        "isPaid": false
                    }
                ],
                "id": "global_sandbox-order_1689161867-1",
                "notes": {
                    "description": ""
                }
            },
            "user": null
        }
    },
    "gateway_id": 275,
    "gateway_reference_id": "suyash_bharatx",
    "offers": [],
    "maximum_eligible_refund_amount": 0
}

```



### Order Refund



**Sample Request** 


#### Shell Code Snippet:

```shell
curl --location --request POST 'https://api.juspay.in/session' \
--header 'x-merchantid: yourMerchantId' \
--header 'Authorization: Basic base64encodedkey==' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount":"10.00",
"order_id":"yourUniqueOrderId",
"customer_id":"dummyCustId",
"customer_phone":"9876543210",
"customer_email":"dummyemail@gmail.com",
"payment_page_client_id":"<YOUR_CLIENT_ID>",
"action":"paymentPage"
}'

```


**Sample Response** 


#### Shell Code Snippet:

```shell
curl --location --request POST 'https://api.juspay.in/session' \
--header 'x-merchantid: yourMerchantId' \
--header 'Authorization: Basic base64encodedkey==' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount":"10.00",
"order_id":"yourUniqueOrderId",
"customer_id":"dummyCustId",
"customer_phone":"9876543210",
"customer_email":"dummyemail@gmail.com",
"payment_page_client_id":"<YOUR_CLIENT_ID>",
"action":"paymentPage"
}'

```


---

## See Also

- [Snapmint ](https://juspay.io/in/docs/payment-method-integrations/express-checkout-sdk/consumer-finance/snapmint)
- [Simpl Pay after Delivery](https://juspay.io/in/docs/payment-method-integrations/express-checkout-sdk/consumer-finance/simpl-pay-after-delivery)
