---
page_source: https://juspay.io/in/docs/payment-method-integrations/express-checkout-api/consumer-finance/bharatx-pay-in-3
page_title: BHARATX PAY IN 3
---


# 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)Production URL : [https://portal.juspay.in](https://portal.juspay.in)




### Step 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-4xQ8o.png)
*BHARATX GATEWAY*




### Step 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-wLRkq.png)
*Select Environment*



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



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




### Step 3 Saving the gateway credentials and proceeding to add payment method Select BHARATX Pay in 3 payment method


Select BHARATX Pay in 3 payment method



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




## Sample Requests and Responses




### Eligibility



**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"
}'

```



### 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_ >




### Order Create



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"
}'

```



#### **Transaction** 



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"
}'

```



### **Order Status** 



**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"
}'

```


> **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"
}'

```
