Introduction

eSewa Intent Payment is a secure payment mechanism that allows third-party applications or merchant platforms to initiate a transaction request and seamlessly redirect the user to the eSewa application to complete authentication and payment authorization. Instead of collecting sensitive financial credentials within the merchant environment, the payment is handled directly inside the eSewa app through an intent trigger, ensuring enhanced security and compliance. In this model, the merchant system first creates a payment booking via API and receives a unique booking reference. The user is then redirected to the eSewa app through a deeplink, where they can authenticate and choose their preferred payment method, such as Wallet or Direct Link Account (DLA) via Direct Debit (DD). Once the transaction is completed, the system updates the transaction status and provides confirmation to the merchant through a callback or status verification API. eSewa Intent Payment is designed to provide a secure, user-friendly, and realtime payment experience while minimizing fraud risks and eliminating the need for merchants to handle sensitive financial data. It supports strong authentication mechanisms, transaction validation, idempotent processing, and clear status tracking, making it suitable for mobile-first ecosystems and third-party integrations.

Transaction Flow

  • 1. When user choses eSewa as payment option from partner merchant application, then user is temporarily redirected to eSewa applcation.

  • 2. User will get payment details inside his esewa's payment page inside eSewa app.

  • 3. User will enter MPIN for confirming payment.

  • 4. After each successful transaction, the user is redirected back to partner merchant's success page. If transaction fails due to any reason (which includes user canceling transaction), the user is informed by appropriate failure message and redirected back to partner merchant's failure page.

  • 5. For every successful transaction, the merchant account is credited accordingly and notified via callback url.

  • 6. If a response is not received within five minutes, the status check API can be used to confirm the payment.

  • 7. After receiving a response from the status check API, update the payment status accordingly.

Signature Generation Step

For signature verification, use the HmacSHA256 hashing algorithm with the provided Access Key. The signature must be generated using a message formatted with the required parameters: product_code, amount, and transaction_uuid. Generate the HmacSHA256 hash of this message using the access key, and use the resulting signature to verify the authenticity and integrity of the request.

Input

product_code=INTENT, amount=100, transaction_uuid=txn-20251220-001

Access Key

For development use this key → LB0REg8HUSw3MTYrI1s6JTE8Kyc6JyAqJiA3MQ== For production key will be provided by eSewa

Examples of creating base64 hashes using HMAC SHA256 in different languages:

Initialize/Book Payment

The Initialize/Book Payment is a POST request and the first step in the eSewa Intent Payment flow. This API allows a third-party merchant system to create a payment booking within the eSewa system before redirecting the user to the eSewa application via deeplink. The booking process generates a unique transaction reference (booking_id) that is used throughout the payment lifecycle for tracking, authentication, and status verification. When a merchant calls this API, they provide essential transaction details such as the payment amount, currency, product or service description, merchant reference number, and callback URLs. The eSewa system validates the request, verifies merchant authentication and digital signature, and creates a transaction record with an initial status. Upon successful booking, the API returns a unique booking_id along with relevant metadata required to trigger the intent redirection.

Request URL:

Method:POST

https://rc-checkout.esewa.com.np/api/client/intent/payment/book 
Sample Request Payload:
{
 "product_code": "INTENT",
 "amount": 100,
 "transaction_uuid": "txn-20251220-001",
 "signed_field_names": "product_code,amount,transaction_uuid",
 "signature": "signature",
 "callback_url": "http://client.com.np",
 "redirect_url": "http://yoursite.com/callback",
 "properties": {
           "customer_id": "CUST12345",
           "remarks": "Internet bill payment"
      }
} 

Request Payload Fields Description:

Field Name Description Required
product_code Identifier of the product for which the payment is initiated,Provided From eSewa's end Yes
amount Total amount to be paid Yes
transaction_uuid Unique transaction identifier provided by the merchant Yes
signed_field_names List of fields used to generate the request signature Yes
signature Cryptographic signature generated using the specified signed fields Yes
callback_url Endpoint to which the payment status is sent after transaction processing Yes
redirect_url URL to which the application redirects the user once the payment is completed Yes
properties Additional attributes required for payment processing and displayed to the user.Key should be in Snake case Yes
failure_url a redirect URL of merchant application where customer will be redirected after FAILURE or PENDING transaction Yes
signed_field_names Unique field names to be sent which is used for generating signature Yes
signature hmac signature generated through above process No

Sample Success Response:

{
 "code": "IP-200",
 "data": {
 "booking_id": "VkQ=",
 "deeplink": "https://rc-links.esewa.com.np/pay/VkQ=",
 "correlation_id": "01KDJVQ3W2T1K9F1XE42P2ARPA"
 },
 "message": "Success"
} 
Sample Failure Response:
{
 "code": "IP-400",
 "error_message": "Invalid Signature"
} 
Field Name Description
code Response code
booking_id Unique identifier generated by eSewa
deeplink Endpoint to which the eSewa app should be redirected
correlation_id Unique automatic generated identifier
message Message associated with response code

Status Check

The Transaction Status Check API allows the merchant to verify the final status of a transaction after it has been initiated. This API is particularly useful in cases where the client does not receive a confirmation response (e.g., due to timeout,network failure, or system error). By consuming this API, the merchant candetermine whether the transaction was successful, failed, or still in process,ensuring reliability and preventing duplicate transactions

Request URL:

Method:POST

https://rc-checkout.esewa.com.np/api/client/intent/payment/status 
Sample Request Payload:
{
 "booking_id": "U0A=",
 "product_code": "INTENT",
 "correlation_id": "01KF852D8XABT1BRDAS5C96838",
 "signed_field_names": "booking_id,product_code,correlation_id",
 "signature": "signature"
} 
Field Name Description
booking_id Unique identifiersend by eSewa during Initial/book
product_code Identifier of the product for which the payment is initiated
correlation_id Unique automatic generated identifier send by eSewa during Initial/Book.
signed_field_names List of fields used to generate the request signature
signature Cryptographic signature generated using the specified signed fields
Sample Success Response:
{
 "code": "IP-200",
 "data": {
 "booking_id": "U0A=",
 "product_code": "INTENT",
 "status": "SUCCESS",
 "correlation_id": "01KF852D8XABT1BRDAS5C96838",
 "transaction_id": "txn-20251220-001",
 "reference_code": "000DTSM",
 "updated_at": "2026-01-18 14:41:43"
 },
 "message": "Payment status fetched successfully"
}
 
Field Name Description
code Response code
booking_id Unique identifier generated by eSewa
product_code Identifier of the product for which the payment is initiated
status Status of the transaction(Refer to table below for details
correlation_id Unique automatic generated identifier
transaction_id Transaction identifier of eSewa
reference_code Transaction reference code
updated_at Transaction updated date timestamp
message Message associated with response code

Status description:

Status Description
BOOKED Payment request has been successfully created and booked, but payment is not yet completed.
SUCCESS Payment has been completed Successfully
PENDING Payment is still under processing; final status is not yet determined.
FAILED Payment processing failed due to an error or rejection.
CANCELED Payment request was canceled by the user or system.
REVERTED The payment amount has been reverted (refunded back to the user)

Cancel Payment

The Cancel Payment API allows a third-party merchant to cancel an existing payment booking that was previously initialized through the eSewa Intent Payment system but has not yet been successfully completed. This API ensures proper transaction lifecycle management and prevents further processing of a booking that is no longer valid or required The merchant can invoke this API using the unique booking_id generated during the Initialize/Book Payment step. Upon receiving the request, the system validates merchant authentication, verifies the booking reference, and checks the current transaction status. Cancellation is permitted only if the booking is in a cancellable state. If the transaction is already completed, failed, expired, or reversed, the cancellation request will be rejected.

Request URL:

Method:POST

{checkout}/api/client/intent/payment/cancel 
Sample Request Payload:
{
 "booking_id": "V0VR",
 "product_code": "INTENT",
 "signed_field_names": "booking_id,product_code",
 "signature": "signature"
} 
Field Name Description
booking_id Unique identifiersend by eSewa during Initial/book
product_code Identifier of the product for which the payment is initiated
signed_field_names List of fields used to generate the request signature
signature Cryptographic signature generated using the specified signed fields
Sample Success Response:
{
 "code": "IP-210",
 "data": {
 "booking_id": "UEo=",
 "status": "CANCELED",
 "correlation_id": "01KEXZY0QKN89X6CNKEJ0RNVMS",
 "transaction_id": "txn-20251220-001"
 },
 "message": "Transaction cancelled"
} 
Sample Failure Response:
{
 "code": "IP-410",
 "error_message": "Transaction already processed"
} 
Field Name Description
code Response code
booking_id Unique identifier generated by eSewa
status Status of the transaction
correlation_id Unique automatic generated identifier
transaction_id Transaction identifier of eSewa
message Message associated with response code

CallBack URL

After a payment is completed on the eSewa side, eSewa sends a notification to the merchant's callback URL (http://client.com.np) that was provided during the booking request. This callback informs the merchant about the final or current status of the payment request. The status is system-determined and reflects the progress or outcome of the transaction. Based on this status, the merchant can update their internal system.

Sample Request Payload:
{
"product_code": "INTENT",
"amount": 1,
"reference_code": "000DTSM",
"correlation_id": "01KF852D8XABT1BRDAS5C96838",
"status": "SUCCESS",
"signature": "signature",
"signed_field_names":
"product_code,amount,reference_code,correlation_id,status"
} 
Field Name Description
product_code Identifier of the product for which the payment is initiated
amount Transaction amount
reference_code Transaction reference code
correlation_id Unique automatic generated identifier
status Current payment status (e.g., SUCCESS)
signature HMAC signature generated to verify authenticity
signed_field_names Fields used to generate the signature

Browser Implementation

This implementation supports dual payment flows based on the user's environment:

  • 1. Web Browser → Redirects to eSewa ePay Web Payment.

  • 2. Mobile Browser → Uses Intent-based payment to open the eSewa mobile app.

  • 3. Flutter WebView → Skips both flows (handled separately)

Core Idea

We detect the user environment using User agent,Touch capability,Screen size. Then it is dynamically decided whether it to be redirected to mobile browser(using deeplink or to web using epay

const isMobileUA = /Android|iPhone|iPad|iPod|Mobile/i.test(userAgent);
const isTouchDevice = navigator.maxTouchPoints > 0;
const isSmallScreen = window.innerWidth <= 768;
const mobileBrowser = isMobileUA && isTouchDevice && isSmallScreen;
const flutterWebView = /wv|Flutter/i.test(userAgent); 

Testing Environment

Please find the demo apps for testing in this link