---
page_source: https://juspay.io/in/docs/hyper-credit/web/base-sdk-integration/session-api
page_title: Session API
---

## API Version: default


# Session API



This is a Server-to-Server API which accepts order parameters as an input to create order in the Juspay system, and returns payment links.The parameters you need to pass might vary depending on the lender requirements. Therefore, it is always recommended to consult the Juspay team for the required parameters before generating a session.

‘Metadata’ is used to send custom params to the payment aggregators, irrespective of default parameters.## Endpoints:
- Sandbox: https://sandbox.juspay.in/session

- Production: https://api.juspay.in/session

## Request Type: 
POST

## Content-Type: 
application/json

## Authorization:

#### Basic Auth:
Basic Authorization should be sued for the API testing.
- Value: MUQ2QUZEQzhFQTY0OUU5QTIxQzNFNTQwNkFDMEZCOg==
- Tags: required
## Headers:

#### x-merchantid:
Once you have completed JusPay onboarding, JusPay will provide you with your Merchant ID.
- Tags: String, Mandatory

#### Content-Type:
- Value:  application/json
- Tags: String, Mandatory
## Sample Code Snippets:
### Sample Request:

#### General Request Code Snippet:

```general request
 {
    "order_id": "ORDER4567TGHk875",
    "amount": "30500",
    "description": "Complete your paymen",
    "currency": "INR",
    "customer_id": "CUST57SDFG",
    "customer_email": "testeml.123@gmail.com",
    "customer_phone": "8667056789",
    "customer_dob": "06-12-1997",
    "customer_first_name": "John",
    "customer_middle_name": "",
    "customer_last_name": "Doe",
    "customer_gender": "Male",
    "customer_marital_status": "Married",
    "customer_highest_education": "Graduate",
    "customer_address_line1": "address line 1",
    "customer_address_line2": "address line 1",
    "customer_state": "Karnataka",
    "customer_pincode": "560095",
    "customer_city": "Bengaluru",
    "customer_employment_type": "salaried",
    "customer_product_name": "abc product",
    "customer_product_tenure": "2",
    "metadata.source": "Online",
    "options.get_client_auth_token": "true",
    "payment_page_client_id": "merchant_client_id",
    "action": "paymentPage",
    "metadata.sdk_payload": "true",
    "metadata.webhook_url": "https://merchant.webhookurl.com/env/webhook_url_response",
    "return_url": "https://merchant.returnurl.com/#thankyoupage"
}



```

#### Insurance Request Code Snippet:

```insurance request
{
   "order_id": "ORDER4567TGHk875",
   "amount": "30500",
   "description": "Family Floater Policy",
   "currency": "INR",
   "customer_id": "CUST57SDFG",
   "customer_email": "testeml.123@gmail.com",
   "customer_phone": "8990000000",
   "customer_dob": "06-12-1997",
   "customer_first_name": "John",
   "customer_middle_name": "",
   "customer_last_name": "Doe",
   "customer_gender": "Male",
   "customer_marital_status": "Married",
   "customer_highest_education": "Graduate",
   "customer_address_line1": "address line 1",
   "customer_address_line2": "address line 1",
   "customer_state": "Karnataka",
   "customer_pincode": "560095",
   "customer_city": "Bengaluru",
   "customer_employment_type": "salaried",
   "customer_policy_ref_no": "POLREF54735HFHFD",
   "customer_product_name": "Family Floater",
   "customer_product_tenure": "2",
   "metadata.customer_policy_no": "D0082477897865",
   "metadata.source": "Online",
   "metadata.policy_renewal_year": "2",
   "metadata.customer_policy_type": "NEW"
   "customer_nominee_name": "nominee name",
   "customer_nominee_phone": "9079638543",
   "is_primary_holder": true,
   "options.get_client_auth_token": "true",
   "payment_page_client_id": "adityabirlahealth",
   "action": "paymentPage",
   "metadata.JUSPAY:gateway_reference_id": "Customer_Portal",
   "metadata.sdk_payload": "true",
   "metadata.webhook_url": "https://selleruat.adityabirlahealth.com/UAT/JustPayController/webhook_url_response",

   "return_url": "https://selleruat.adityabirlahealth.com/prodreplica/#thankyoupage"
}
```

#### Education Request Code Snippet:

```education request
{
    "order_id": "testing-order-22",
    "amount": "35000.0",
    "customer_id": "cust_123",
    "customer_first_name": "John",
    "customer_middle_name": "Alex",
    "customer_last_name": "Doe",
    "customer_email": "test@mail.com",
    "customer_phone": "1234567890",
    "customer_gender": "male",
    "customer_marital_status": "Unmarried",
    "customer_highest_education": "Graduate",
    "customer_employment_type": "Salaried",
    "payment_page_client_id": "juspay",
    "action": "paymentPage",
    "return_url": "https://shop.merchant.com",
    "description": "Complete your payment",
    "metadata.customer_product_name": "MBA",
    "metadata.customer_product_payment_type":"6",
    "metadata.student_name":"John Doe",
    "metadata.student_admission_type":"NEW"
}


```

#### Travel Request Code Snippet:

```travel request
{
  "order_id": "test_1",
  "amount": "5000.0",
  "customer_id": "testing-customer-9999999999",
  "customer_email": "juspay@gmail.in",
  "customer_phone": "9999999999",
  "payment_page_client_id": "client_id",
  "action": "paymentPage",
  "return_url": "https://www.google.com/",
  "description": "Complete your payment",
  "customer_first_name": "Jhon",
  "customer_middle_name": "Alex"
  "customer_last_name": "Doe",
  "metadata.origin": "Bangalore",
  "metadata.destination": "Mangalore",
  "metadata.travel_start_date": "29-Dec-2024",
  "metadata.travel_end_date": "31-Dec-2024",
  "metadata.travel_type": "Visa",
  "metadata.agent_email_id": "xyz@gmail.com",
  "metadata.agent_mobile": "9888888888",
  "metadata.agent_name": "Juspay B2C",
  "metadata.brand_name": "Juspay B2C"
}


```

### Sample Response:

#### General Response:
```json
{
    "status": "NEW",
    "id": "ordeh_5b57ecf3da7841198dd3c0c50a5ac3cb",
    "order_id": "ORDER4567TGHk875",
    "payment_links": {
        "web": "https://sandbox.assets.juspay.in/payment-page/order/ordeh_5b57ecf3da7841198dd3c0c50a5ac3cb",
        "expiry": "2024-12-26T10:12:55Z"
    },
    "sdk_payload": {
        "requestId": "0fa4d42c05e94873b3aee5def9d49002",
        "service": "in.juspay.hyperpay",
        "payload": {
            "udf4": "testeml.123@gmail.com",
            "customerPincode": "560095",
            "customerState": "Karnataka",
            "metadata.JUSPAY:gatewayReferenceId": "Customer_Portal",
            "customerPolicyRefNo": "POLREF54735HFHFD",
            "udf3": "POLREF54735HFHFD",
            "customerGender": "Male",
            "customerHighestEducation": "Graduate",
            "customerAddressLine2": "address line 1",
            "metadata.source": "Online",
            "clientId": "adityabirlahealth",
            "customerMaritalStatus": "Married",
            "customerId": "CUST57SDFG",
            "customerDob": "06-12-1997",
            "customerProductName": "Family Floater",
            "orderId": "ORDER4567TGHk875",
            "returnUrl": "https://selleruat.adityabirlahealth.com/prodreplica/#thankyoupage",
            "currency": "INR",
            "customerEmail": "testeml.123@gmail.com",
            "customerPhone": "8667056789",
            "service": "in.juspay.hyperpay",
            "udf2": "LEAD-123456",
            "metadata.webhookUrl": "https://selleruat.adityabirlahealth.com/UAT/JustPayController/webhook_url_response",
            "udf5": "8667056789",
            "description": "Family Floater Policy",
            "environment": "sandbox",
            "merchantId": "adityabirla_health",
            "amount": "30500",
            "clientAuthTokenExpiry": "2024-12-23T10:38:28Z",
            "customerFirstName": "Arijit",
            "metadata.customerPolicyType": "NEW",
            "customerCity": "Bengaluru",
            "isPrimaryHolder": true,
            "customerMiddleName": "",
            "metadata.sdkPayload": "true",
            "customerLastName": "Mitra",
            "customerAddressLine1": "address line 1",
            "clientAuthToken": "tkn_efd30d3f8c98449db8f2b64557ba43de",
            "action": "paymentPage",
            "metadata.customerPolicyNo": "D0082477897865",
            "customerProductTenure": "2",
            "udf1": "SellerPortal",
            "customerEmploymentType": "salaried",
            "collectAvsInfo": false
        },
        "expiry": "2024-12-26T10:12:55Z"
    },
    "order_expiry": "2024-12-26T10:12:55Z"
}

```

#### Insurance Response:
```plaintext
{
    "status": "NEW",
    "id": "ordeh_5b57ecf3da7841198dd3c0c50a5ac3cb",
    "order_id": "ORDER4567TGHk875",
    "payment_links": {
        "web": "https://sandbox.assets.juspay.in/payment-page/order/ordeh_5b57ecf3da7841198dd3c0c50a5ac3cb",
        "expiry": "2024-12-26T10:12:55Z"
    },
    "sdk_payload": {
        "requestId": "0fa4d42c05e94873b3aee5def9d49002",
        "service": "in.juspay.hyperpay",
        "payload": {
            "udf4": "testeml.123@gmail.com",
            "customerPincode": "560095",
            "customerState": "Karnataka",
            "metadata.JUSPAY:gatewayReferenceId": "Customer_Portal",
            "customerPolicyRefNo": "POLREF54735HFHFD",
            "udf3": "POLREF54735HFHFD",
            "customerGender": "Male",
            "customerHighestEducation": "Graduate",
            "customerAddressLine2": "address line 1",
            "metadata.source": "Online",
            "clientId": "adityabirlahealth",
            "customerMaritalStatus": "Married",
            "customerId": "CUST57SDFG",
            "customerDob": "06-12-1997",
            "customerProductName": "Family Floater",
            "orderId": "ORDER4567TGHk875",
            "returnUrl": "https://selleruat.adityabirlahealth.com/prodreplica/#thankyoupage",
            "currency": "INR",
            "customerEmail": "testeml.123@gmail.com",
            "customerPhone": "8667056789",
            "service": "in.juspay.hyperpay",
            "udf2": "LEAD-123456",
            "metadata.webhookUrl": "https://selleruat.adityabirlahealth.com/UAT/JustPayController/webhook_url_response",
            "udf5": "8667056789",
            "description": "Family Floater Policy",
            "environment": "sandbox",
            "merchantId": "adityabirla_health",
            "amount": "30500",
            "clientAuthTokenExpiry": "2024-12-23T10:38:28Z",
            "customerFirstName": "Arijit",
            "metadata.customerPolicyType": "NEW",
            "customerCity": "Bengaluru",
            "isPrimaryHolder": true,
            "customerMiddleName": "",
            "metadata.sdkPayload": "true",
            "customerLastName": "Mitra",
            "customerAddressLine1": "address line 1",
            "clientAuthToken": "tkn_efd30d3f8c98449db8f2b64557ba43de",
            "action": "paymentPage",
            "metadata.customerPolicyNo": "D0082477897865",
            "customerProductTenure": "2",
            "udf1": "SellerPortal",
            "customerEmploymentType": "salaried",
            "collectAvsInfo": false
        },
        "expiry": "2024-12-26T10:12:55Z"
    },
    "order_expiry": "2024-12-26T10:12:55Z"
}

```

#### Education Response:
```plaintext
{
    "status": "NEW",
    "id": "ordeh_f3c26b7c17fd4aebbd4e0ee2d3c7d5d9",
    "order_id": "testing-order667",
    "payment_links": {
        "web": "https://sandbox.juspay.in/orders/ordeh_f3c26b7c17fd4aebbd4e0ee2d3c7d5d9/payment-page",
        "expiry": "2025-02-01T07:33:43Z"
    },
    "sdk_payload": {
        "requestId": "74e55d336c0348e2ad86c0e2e93e6ad6",
        "service": "in.juspay.hyperpay",
        "payload": {
            "customerPincode": "560095",
            "metadata.customerProductName": "MBA",
            "customerState": "Karnataka",
            "metadata.studentName": "John Doe",
            "customerGender": "male",
            "customerHighestEducation": "Graduate",
            "customerAddressLine2": "address line 2",
            "clientId": "juspay",
            "metadata.studentAdmissionType": "NEW",
            "customerMaritalStatus": "Unmarried",
            "customerId": "cust_123",
            "orderId": "testing-order667",
            "returnUrl": "https://shop.merchant.com",
            "currency": "INR",
            "customerEmail": "test@mail.com",
            "customerPhone": "1234567890",
            "service": "in.juspay.hyperpay",
            "description": "Complete your payment",
            "metadata.customerProductPaymentType": "6",
            "environment": "sandbox",
            "merchantId": "amity",
            "amount": "35000.0",
            "clientAuthTokenExpiry": "2025-01-29T07:48:43Z",
            "customerFirstName": "Jhon",
            "customerAnnualIncome": "300000",
            "customerCity": "Bengaluru",
            "customerMiddleName": "Alex",
            "customerLastName": "Doe",
            "customerAddressLine1": "address line 1",
            "clientAuthToken": "tkn_471295d6c8b74b55b3db538b1a94c5ab",
            "action": "paymentPage",
            "customerEmploymentType": "Salaried",
            "collectAvsInfo": false
        },
        "expiry": "2025-02-01T07:33:43Z"
    },
    "order_expiry": "2025-02-01T07:33:43Z"
}
```

#### Travel Response:
```plaintext
{
    "udf4": "",
    "resp_category": null,
    "emi_details": {
        "bank": null,
        "monthly_payment": null,
        "interest": null,
        "conversion_details": null,
        "principal_amount": null,
        "additional_processing_fee_info": null,
        "tenure": null,
        "subvention_info": [],
        "emi_type": null,
        "processed_by": null
    },
    "udf8": "",
    "udf3": "",
    "udf6": "",
    "offers": [],
    "bank_error_code": "0",
    "status": "CAPTURE_INITIATED",
    "order_expiry": "2025-01-27T11:55:06Z",
    "bank_error_message": "success",
    "id": "ordeh_daaf60c8bb424d3a94a7da558f5a1113",
    "return_url": "https://www.google.com/",
    "last_updated": "2025-01-27T11:34:31Z",
    "txn_uuid": "mozvLkpzi2HMNpavH1t",
    "gateway_id": 265,
    "currency": "INR",
    "date_created": "2025-01-27T11:25:06Z",
    "resp_message": null,
    "udf2": "",
    "payment_links": {
        "mobile": "https://sandbox.assets.juspay.in/payment-page/order/ordeh_daaf60c8bb424d3a94a7da558f5a1113",
        "web": "https://sandbox.assets.juspay.in/payment-page/order/ordeh_daaf60c8bb424d3a94a7da558f5a1113",
        "iframe": "https://sandbox.assets.juspay.in/payment-page/order/ordeh_daaf60c8bb424d3a94a7da558f5a1113"
    },
    "customer_email": "abc.xyz@juspay.in",
    "customer_phone": "9990022000",
    "udf5": "",
    "status_id": 33,
    "merchant_id": "testcredit",
    "resp_code": null,
    "udf9": "",
    "amount": 5000,
    "refunded": false,
    "auth_type": "",
    "order_id": "test_order_1737977106",
    "payment_method": "MIHURU_LSP",
    "udf7": "",
    "udf10": "",
    "payment_gateway_response": {
        "epg_txn_id": null,
        "network_error_code": null,
        "auth_ref_num": null,
        "arn": null,
        "eci": null,
        "resp_message": "success",
        "created": "2025-01-27T11:28:52Z",
        "rrn": null,
        "umrn": null,
        "resp_code": "0",
        "network_error_message": null,
        "gateway_merchant_id": null,
        "auth_id_code": null,
        "txn_id": "testcredit-test_order_1737977106-1"
    },
    "effective_amount": 5000,
    "txn_id": "testcredit-test_order_1737977106-1",
    "product_id": "",
    "customer_id": "testing_customer_1737977106",
    "payment_method_type": "CONSUMER_FINANCE",
    "amount_refunded": 0,
    "udf1": ""
}
```

## Body Parameters:
### Basic Parameter:

#### order_id:
- Description: A unique Order ID generated by merchant.This Order ID will have transactions mapped to it.
- Value: value
- Tags: String, Mandatory

#### amount:
- Description: This is the order amount for which the purchase is being made.
- Tags: String, Mandatory

#### description:
- Description: A short text explaining the purpose or details of the transaction.
- Tags: String, can be collected

#### currency:
- Description: The currency in which the transaction is made (e.g., INR, USD).
- Tags: String, Can be collected

#### customer_id:
- Description: Unique identifier of the customer in merchant’s system.
- Tags: String, Mandatory

#### customer_email:
- Description: E-mail id of the customer.
- Tags: String, Mandatory, can be collected on UI

#### customer_phone:
- Description: Phone number of the customer.
- Tags: String, Mandatory, can be collected on UI

#### customer_dob:
- Description: Customer’s date of birth in the dd-mm-yyyy format.
- Tags: String, can be collected on UI

#### customer_first_name:
- Description: Customer’s first name.
- Tags: String, can be collected on UI

#### customer_middle_name:
- Description: Customer’s middle name.
- Tags: String, can be collected on UI

#### customer_last_name:
- Description: Customer’s last name.
- Tags: String, can be collected on UI

#### customer_gender:
- Description: Following values are accepted: Male | Female | Others
- Tags: String, can be collected on UI

#### customer_marital_status:
- Description: Customer’s marital status: Following values are accepted: Single | Married
- Tags: String, can be collected on UI

#### customer_highest_education:
- Description: Customer’s Highest Educational Qualification. Following Values are accepted: Undergraduate | Professional Degree | Graduate | Post Graduate | Ph.D | Others
- Tags: String, can be collected on UI

#### customer_address_line1:
- Description: Address of the customer
- Tags: String, can be collected on UI

#### customer_address_line2:
- Description: Address of teh customer
- Tags: String, can be collected on UI

#### customer_state:
- Description: State of Residenec of the customer
- Tags: String, can be collected on UI

#### customer_pincode:
- Description: Customer’s Pincdoe
- Tags: String, can be collected on UI

#### customer_city:
- Description: Customer’s City
- Tags: String, can be collected on UI

#### customer_annual_income:
- Description: Anual Income oof the Customer
- Tags: String, can be collected on UI

#### customer_employment_type:
- Description: Customer’s employment type. Following values are accepted: SALARIED | SELF_EMPLOYED
- Tags: String, can be collected on UI

#### customer_product_name:
- Description: Product Name of the Merchant. Should be passed by Merchant 
- Tags: String, Mandatory, Depends on Lender

#### customer_product_tenure:
- Description: Tenure of the loan that is being requested
- Tags: String, Mandatory, Depends on Lender

#### metadata.source:
- Description: Channel Source (Example : Online)
- Tags: String, Mandatory

#### metadata.sdk_payload:
- Tags: Boolean, Mandatory

#### payment_page_client_id:
- Description: Client ID which controls the UI Parameters of the payment page. This is generated by Juspay  
- Tags: String, Mandatory

#### action:
- Description: Payment Page
- Value:  paymentPage
- Tags: String, Mandatory

#### return_url:
- Description: This URL specifies where the control should redirect after the completion of the payment process.
- Value:  juspay.in
- Tags: String, Mandatory
### Insurance Specific Parameter:

#### customer_policy_ref_no:
- Description: Policy Reference Number of the customer. This policy reference number will be passed to lenders, and same will be used for saving loan application at Juspay’s end.
- Value: value
- Tags: String, Mandatory

#### metadata.customer_policy_type:
- Description: This indicates whether the policy is new or being renewed.The accepted types are NEW or RENEWAL.
- Tags: String, Mandatory

#### metadata.policy_renewal_year:
- Description: Frequency or duration of the policy gets renewed.
- Tags: String, Mandatory

#### metadata.customer_policy_no:
- Description: Customer’s Policy Reference Number
- Tags: String, Mandatory

#### insured_member_details:
- Description: Details of the insured member. This is an array and details of all insured member shall be provided.
- Tags: String, Mandatory
### Education Specific Parameters:

#### metadata.customer_product_name:
- Description: Name of the product/course (MBA).
- Value: value
- Tags: String, Mandatory

#### metadata.customer_product_payment_type:
- Description: Tenure of Loan
- Tags: String, Mandatory

#### metadata.student_name:
- Description: Student’s full name (John Doe).
- Tags: String, Mandatory

#### metadata.student_admission_type:
- Description: Admission type (NEW, could also be RENEWAL/TRANSFER in other cases).
- Tags: String, Mandatory
### Travel Specific Parameters:

#### metadata.origin:
- Description: Travel origin location (Bangalore).
- Value: value
- Tags: String, Mandatory

#### metadata.destination:
- Description: Travel destination (Mangalore).
- Tags: String, Mandatory

#### metadata.travel_start_date:
- Description: Start date of travel (29-Dec-2024).
- Tags: String, Mandatory

#### metadata.travel_end_date:
- Description: End date of travel (31-Dec-2024).
- Tags: String, Mandatory

#### metadata.travel_type:
- Description: Type of travel (e.g., Visa, could also be One-way, Return, etc. depending on use-case).
- Tags: String, Mandatory

#### metadata.agent_email_id:
- Description: Travel agent’s email ([xyz@gmail.com](mailto:xyz@gmail.com)).
- Tags: String, Mandatory

#### metadata.agent_mobile:
- Description: Travel agent’s phone number (9888888888).
- Tags: String, Mandatory

#### metadata.agent_name:
- Description: Travel agent/agency name (Juspay B2C).
- Tags: String, Mandatory

#### metadata.brand_name:
- Description: Associated brand name (Juspay B2C).
- Tags: String, Mandatory
### User Defined Parameters (UDF):

#### udf1 , udf2 , udf3 , udf4, udf5:
- Description: User Defined Parameter (UDF)

This field can be used to send any user defined parameters

The UDF parameters for orders can be seen in the JUSPAY dashboard under each order
- Value:  Example:- user5349
- Tags: string (Upto 255 characters), No special characters supported

#### udf6 , udf7 , udf8 , udf9 , udf10:
- Description: User Defined Parameter (UDF)

This field can be used to send any user defined parameters

The UDF parameters for orders can be seen in the JUSPAY dashboard under each order
- Value:  Example:- user_5349
- Tags: string (Upto 255 characters), Special characters supported
## API Responses:
### 200:

#### sdk_payload:
- Description: Process SDK Call Payload. This is supposed to be passed to your frontend application to open the Hypercheckout screen.
- Tags: JSON

#### payment_links:
- Description: Https link using which user can open the Hypercheckout screen and perform transaction against the order created
- Tags: string

#### order_id:
- Description: Order Id passed during order creation
- Tags: string, Max Length : 21 

#### status:
- Description: Status of order
- Value: <p>Example:- <br> NEW </p>
- Tags: string, Max Length : 255 
### 400:

#### status:
- Description: Bad Request
- Tags: string, Max Length : 255

#### error_code:
- Description: Details of keys missing
- Value: <p>Example:- <br> Mandatory fields are missing </p>
- Tags: string, Max Length : 255

#### error_message:
- Description: Further Details of keys missing
- Tags: string, Max Length : 255
### 401:

#### status:
- Description: error
- Tags: string, Max Length : 255

#### error_code:
- Description: access_denied
- Tags: string, Max Length : 255
### 404:

#### status:
- Description: error
- Tags: string, Max Length : 255

#### error_code:
- Description: Internal server Error
- Tags: string, Max Length : 255
### 500:

#### status:
- Description: error
- Tags: string, Max Length : 255

#### error_code:
- Description: Internal server Error
- Tags: string, Max Length : 255
