---
page_source: https://docs.juspay.io/paytm-gateway-configuration/docs/express-checkout/eligibility-api
page_title: Eligibility API
---

## API Version: default


# Eligibility API



The API is used to check if the customer is eligible for the pay later options. The API would return the list of all the pay later options that is configured in your account. It is a sync API, ie when merchants call the eligibility API Juspay checks the eligibility with the respective wallets and return the response. Hence the latency of the API can be comparatively higher. 

> **Note**
> 1. Either amount or the order_id should be present in the request so as to get the eligibility.
> 2. gateway_data is gateway specific information, it can be mandatory for somegateways



Format Supported:

1. application/JSON
2. application/x-www-form-urlencoded

Status and description:


| Status | Description |
|---|---|
| SUCCESS | Successful |
| USER_NOT_FOUND | User not found for that gateway |
| BAD_REQUEST | Bad Request |
| INVALID_DATA | Invalid header or input data or any of the values are expired |
| NOT_ACCESSIBLE | When the user does not have access because of the insufficient credit limit or blocked to that wallet |
| PENDING_DUES	 | Pending dues are present in the wallet which user needs to clear |
| UNAUTHORIZED | Unauthorized |
| ERROR | Any other error mapping |


Error Code And Description


| Error Code | Description |
|---|---|
| linking_required | Link the Simpl account |
| pending_bill | Clear the previous dues to proceed |
| insufficient_credit	 | Clear the previous dues to proceed |
| unable_to_process	 | Transaction Amount exceeds spending limit |
| user_unauthorized | User is not eligible to use Simpl |


## Endpoints:
- Production: https://api.juspay.in/customers/{customer_id}/eligibility

## Request Type: 
POST

## Authorization:

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

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

Example:- Basic MUQ2QUxxxxxxxxxxxxU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: Base64 Encoded Username:Password, Mandatory
## Headers:

#### Content-Type:
Should be application/x-www-form-urlencoded
- Tags: String, Mandatory
## Sample Code Snippets:
### Sample Request:

#### Request - With Amount Code Snippet:

```request - with amount
curl -X POST \
  https://api.juspay.in/customers/testcustomer/eligibility \
  -H 'Authorization: Basic NkY4Q****MzNzQ1Og==' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'amount=1'
```

#### Request - With Order ID Code Snippet:

```request - with order id
curl --location --request POST 'https://api.juspay.in/customers/testwallet145/eligibility' \
--header 'Authorization: Basic NTlEQzNG****QzE1Og==' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'order_id=test1234'

```

#### Request - With gateway_data Code Snippet:

```request - with gateway_data
curl --location --request POST 'https://api.juspay.in/customers/testcustomer/eligibility' \
--header 'Authorization: Basic NTlEQzNG****QzE1Og==' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'amount=1' \
--data-urlencode 'gateway_data={"SIMPL" : {"payload":"rtyuyhgrfde34r5ty6u7i765gty"}'

```

#### Request - With Gateway Reference ID Code Snippet:

```request - with gateway reference id
curl --location --request POST 'https://api.juspay.in/customers/testcustomer/eligibility' \
--header 'Authorization: Basic NTlEQzNG****QzE1Og==' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'amount=1' \
--data-urlencode 'gateway_data={"SIMPL" : {"payload":"rtyuyhgrfde34r5ty6u7i765gty"}'\
--data-urlencode 'gateway_reference_id=test' 
```

### Sample Response:

#### Success Response:
```json
{
  "payment_methods_eligibility": [
    {
      "status": "SUCCESS",
      "payment_method_type": "WALLET",
      "payment_method": "LAZYPAY",
      "is_eligible": true,
      "eligibility_strategy": "TRANSACTION",
      "due_date": "03 December 2019",
      "description": "Lazy Pay Wallet"
    },
    {
      "status": "SUCCESS",
      "payment_method_type": "WALLET",
      "payment_method": "OLAPOSTPAID",
      "is_eligible": true,
      "gateway_error_message": "Ola Postpaid available",
      "gateway_error_code": "OC_000",
      "eligibility_strategy": "TRANSACTION",
      "description": "Ola Postpaid Wallet"
    },
    {
      "status": "SUCCESS",
      "payment_method_type": "WALLET",
      "payment_method": "SIMPL",
      "is_eligible": true,
      "gateway_error_message": "linking_required",
      "gateway_error_code": "linking_required",
      "eligibility_strategy": "USER",
      "description": "Simpl Wallet",
      "balance": 0
    }
  ]
}
```

#### Error Response:
```json
{
  "payment_methods_eligibility": [
    {
      "status": "USER_NOT_FOUND",
      "payment_method_type": "WALLET",
      "payment_method": "OLAPOSTPAID",
      "is_eligible": false,
      "gateway_error_code": "OC_011",
      "gateway_error_message": "user not found",
      "description": "Olapostpaid Wallet"
    }
  ]
}
```

## Body Parameters:
### Parameters:

#### amount:
- Description: Amount to check eligibility. Conditional (either order_id or amount are required)
- Tags: string

#### order_id:
- Description: Order id to check eligibility. Conditional (either order_id or amount are required)
- Tags: string

#### gateway_data:
- Description: Details required for the gateway call.
- Tags: string

#### gateway_reference_id:
- Description: Reference Id configured in case of multi MID setup.
- Tags: string

#### mobile_number:
- Description: Mobile number to check eligibility. (Conditional, required if customer id is not created with Juspay)
- Tags: string
## API Responses:
### 200:

#### Success Response:
- Value:
  - **Payment_methods_eligibility	**:
    - Description: Lists all the payment methods which has eligibility criteria
    - Value:
      - **Status**:
        - Description: The Juspay mapped error status for the corresponding gateway error code.
        - Tags: String
      - **Payment_method_type**:
        - Description: Type of the payment method like WALLET
        - Tags: String
      - **Payment_method**:
        - Description: Name of the Payment Method which has eligibility criteria
        - Tags: String
      - **Is_eligible**:
        - Description: Flag which specifies if the customer is eligible for the payment method
        - Tags: Boolean
      - **Eligibility_strategy**:
        - Description: Different strategy of eligibility like Transaction eligibility, User eligibility
        - Tags: String
      - **Due_date**:
        - Description: Due date of the pay later option bill payment.
        - Tags: String
      - **Description**:
        - Description: Description about the payment method
        - Tags: String
    - Tags: Array of Objects
- Tags: JSON

#### Error Response:
- Value:
  - **Payment_methods_eligibility**:
    - Description: Lists all the payment methodswhich has eligibility criteria
    - Value:
      - **Status**:
        - Description: The Juspay mapped error status for the corresponding gateway error code.
        - Tags: String
      - **Payment_method_type**:
        - Description: Type of the payment method like WALLET
        - Tags: String
      - **Payment_method**:
        - Description: Name of the Payment Method which has eligibility criteria
        - Tags: String
      - **Is_eligible**:
        - Description: Flag which specifies if the customer is eligible for the payment method
        - Tags: Boolean
      - **Gateway_error_code**:
        - Description: Error code
        - Tags: String
      - **Gateway_error_message**:
        - Description: Error message given by gateway
        - Tags: String
      - **Description**:
        - Description: Description about the payment method
        - Tags: String
    - Tags: String
- Tags: JSON
### 400:

#### status:
- Description: Invalid Request
- Tags: string

#### error_message:
- Description: Request should contain either amount or order id
- Tags: string

#### error_code:
- Description: Request should contain either amount or order id
- Tags: string
