---
page_title: Check Eligibility API
product: API Reference
page_source: https://juspay.io/in/docs/api-reference/docs/cred-pay/check-eligibility-api
openapi: https://juspay.io/in/docs/api/swagger?document=https%3A%2F%2Fjuspay.io%2Fin%2Fdocs%2Fapi-reference%2Fdocs%2Fcred-pay%2Fcheck-eligibility-api
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/api-reference/llms.txt
---

## API Version: default


# Check Eligibility API



Call eligibility API using the customer mobile number to check if the user is eligible for the transaction. This method can be invoked before the merchant opens their payment page and the UI can be handled upon the response of the eligibility of API call. Please note that it is a server-to-server authenticated call.## Endpoints:
- Sandbox: https://sandbox.juspay.in/v3/eligibility

- Production: https://api.juspay.in/v3/eligibility

## Request Type: 
POST

## Content-Type: 
application/json

## Authorization:

#### Basic Auth:
Consists of two parts.

* Username: API Key obtained from Juspay dashboard
* Password: Empty string

Example:-MUQ2QUZEQzhFQTY0OUU5QTIxQzNFNTQwNkFDMEZCOg==


- Value: MUQ2QUZEQzhFQTY0OUU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: Base64 Encoded Username-Password, Mandatory
## Headers:

#### Content-Type:
application/x-www-form-urlencoded
- Tags: String, Mandatory

#### x-routing-id:
We recommend passing the customer_id as the x-routing-id. If the customer is checking out as a guest, you can pass an alternative ID that helps track the payment session lifecycle. For example, this could be an Order ID or Cart ID.

> **Warning**
> This ID is associated with the customer. It plays a key role in ensuring consistency and maintaining connections across different systems. If you fail to pass the same x-routing-id for the same customer in all related API calls, it could lead to issues with API functionality. Therefore, it’s crucial that you use the same x-routing-id for all requests tied to the same customer.


- Value: customer_1122
- Tags: String, Required
## Sample Code Snippets:
### Sample Request:

#### Request Code Snippet:

```request
curl --location --request POST 'https://api.juspay.in/v3/eligibility' \
--header 'Authorization: Basic <API_KEY>' \
--header 'Content-Type: application/json' \
--header 'x-routing-id: customer_1122'\
--data-raw '{
"merchant_id": "merchant_id", //mandatory field
"order_id": "order_id", //non-mandatory field
"amount": 1.0, //non-mandatory field
"customer_id": "customer_id", //non-mandatory field
"payment_instrument": [
        {
            "gateway_reference_id": "<gateway_reference_id>",
            "payment_method": "CRED",
            "payment_method_type": "WALLET",
            "command": "verify_user",
            "gateway": "CRED",
            "command_input": {
                "platform": "APP",
                "os": "IOS",
                "device": "MOBILE",
                "countryCode": "+91",
                "phoneNumber": "enc-<encrypted phone number>",
                "credAppPresent": false/true ,
                "isWebSupported": "true",
                "metadata": {
                    "abc": "123",
                    "def": "efe"
                }
            }
        }
    ]
}

```

### Sample Response:

#### Response-ELIGIBLE:
```json
{
      "payment_instrument": [
          {
                    "command": "verify_user",
                    "payment_method": "CRED",
                    "payment_method_type": "WALLET",
                    "gateway": "CRED",
                    "status": "ELIGIBLE",
                    "command_output": {
                          "status": "OK",
                          "error_code": null,
                          "response": {
                              "checkout_mode": "collect",
                              "state": "ELIGIBLE",
                              "layout": {
                              "icon":
                              "https://d1sofudel0ufia.cloudfront.net/assets/cred_brand_logo_bg_black.png"
                              ,
                              "banner_text": "CRED offers you the most rewarding experience, pay seamlessly using your CRED coins. #killthebill",
                              "sub_text": "pay seamlessly using your CRED coins. #killthebill",
                              "cta_text": "Pay with CRED",
                              "title": "Pay with CRED"
                            },
                            "tracking_id": "CREDc2946e99a1ae4fe680c4f6e7ce67b358",
                           "intent_url": null,
                           "reference_id": "f93f2a09-cf67-4195-9f8c-adbc04d0d02e"
                          },
                          "error_description": null,
                          "error_message": null
                        },
                        "gateway_reference_id": null
                      }
                    ]
                  }
```

#### Response-INELIGIBLE:
```json
{
      "payment_instrument": [
          {
                    "command": "verify_user",
                    "payment_method": "CRED",
                    "payment_method_type": "WALLET",
                    "gateway": "CRED",
                    "status": "INELIGIBLE",
                    "command_output": {
                          "status": "OK",
                          "error_code": "HD_1102",
                          "response": {
                              "checkout_mode": null,
                              "state": "INELIGIBLE",
                              "layout": {
                              "icon":
                              "https://d1sofudel0ufia.cloudfront.net/assets/cred_brand_logo_bg_black.png"
                              ,
                              "banner_text": "CRED offers you the most rewarding experience, pay seamlessly using your CRED coins. #killthebill",
                              "sub_text": "pay seamlessly using your CRED coins. #killthebill",
                              "cta_text": "Pay with CRED",
                              "title": "Install CRED to continue"
                            },
                            "tracking_id": "CRED1e20b5f0e79040c199a55362ca3aae2c",
                           "intent_url": null,
                           "reference_id": "1394658f-1cfb-4611-b622-e245f2be8ff1"
                          },
                          "error_description": "User in pending state and has completed sign up in CRED app",
                          "error_message": "CRED is a members only platform for users with a credit score above 750. We encourage you to download the CRED app  and refresh your credit score to become a CRED member today to use this payment method."
                    },
                   "gateway_reference_id": null
                  }
      ]
    }
```

## Body Parameters:
### Basic Parameters:

#### merchant_id:
- Description: Merchant_id yes Merchant should pass the merchant_id
- Value: value
- Tags: String, Mandatory

#### order_id:
- Description: when eligibility is being called post order creation, order_id can be passed
- Tags: String

#### amount:
- Description: when eligibility is being called post order creation, amount can be passed
- Tags: String

#### customer_id:
- Description: Merchant can pass customer_id if available
- Tags: String

#### gateway_reference_id:
- Description: To be passed when merchant has configured multiple CRED gateway basis on their LOB
- Tags: String

#### platform:
- Description: Possible values: android, web, ios
- Tags: String, Mandatory

#### os:
- Description: Possible values: android, iOS, windows, linux, macOS, unknown Please contact juspay team if you are facing any concern around it
- Tags: String, Mandatory

#### device:
- Description: Possible values: mobile, iPAD, desktop, tablet, unknown 

Please contact juspay team if you are facing any concern around it
- Tags: String, Mandatory

#### phoneNumber:
- Description: Must be encrypted using [juspay public key](https://docs.juspay.in/api-reference/docs/cred-pay/cred-pay-setup#Public-Key-for-phone-number-encryption) with RSA PKCS1 Encryption Required to identify if the user is already a CRED registered user, Flow will be COLLECT in this case, otherwise the REDIRECT Flow.
- Tags: RSA PKCS1 Encrypted, Mandatory

#### credAppPresent:
- Description: Please refer to the [set up page](https://docs.juspay.in/api-reference/docs/cred-pay/cred-pay-setup#Check-for-Cred-App) for more details.
- Tags: Boolean, Mandatory
## API Responses:
### 200:

#### status:
- Description: Merchant should show CRED on their payment page basis this key
- Value: Value: ELIGIBLE/INELIGIBLE
- Tags: String

#### command_output.response .checkout_mode:
- Description: This key will return the flow that will be triggered for the merchant. intent: collect: User will get a collect request on their CRED App 

Web: Also known as redirect flow, user will be redirected to CRED page where he will be asked to sign up using a number and complete the transaction
- Tags: String

#### layout.subtext:
- Description: Offer text is present inside layout.subtext. Other fields are optional to be shown on UI.
- Tags: String
### 400:

#### Response- when encryption is incorrect:
- Value:
  - **Status**:
    - Description: BAD_REQUEST
    - Tags: String
  - **Error_code**:
    - Description: HD_0009
    - Tags: String
  - **Error_description**:
    - Description: User phone number is missing in request body
    - Tags: String
  - **Error_message**:
    - Description: User phone number is missing in request body"
    - Tags: String
- Tags: Object


---

## See Also

- [Cred Pay Setup](https://juspay.io/in/docs/api-reference/docs/cred-pay/cred-pay-setup)
- [Create Order](https://juspay.io/in/docs/api-reference/docs/cred-pay/create-order)
