Rupee API Documentation

Rupee API Documentation

Complete guide to integrate our payment gateway into your application

Configuration

Register to Rupee API
Create your account to access our payment gateway services
  1. Visit the Rupee API registration page
  2. Register with your email and passowrd, gmail, or github account.
  3. Verify your email address
  4. Log in using same credentials
Create Project
Set up your first project to organize your integration
  1. Log in to your Rupee API dashboard
  2. Navigate to "Projects" section
  3. Click "Create New Project"
  4. Enter project details (name, description, website URL)
  5. Click "Create Project"
Get API Key and Project Key
Obtain credentials to authenticate your API requests
  1. Navigate to "Settings" section in your project dashboard
  2. Copy and securely store both API Key and Project Key
  3. Never expose these keys in client-side code

Workflow Figure

Complete Payment Flow
Your Application
1. API Call
Rupee API
2. Redirect URL
Payment Page
3a. Success
3b. Failure
Success URL
Failure URL

Integration

3.1 API Request
Make a POST request to initiate payment

Endpoint: POST https://rupeeapi.vercel.app/api/esewa/proceedPayment

Endpoint: POST https://rupeeapi.vercel.app/api/khalti/proceedPayment

Headers

Header NameValueDescription
api-keyYour API KeyAuthentication key from your dashboard
Content-Typeapplication/jsonRequest content type

Request Body Fields

Field NameTypeRequiredDescription
amountNumberYesPayment amount in smallest currency unit (paise for INR)
successUrlStringYesURL to redirect after successful payment
failureUrlStringYesURL to redirect after failed payment
projectIDStringYesYour project identifier from dashboard
orderIDStringYesUnique order identifier from your system
3.2 API Response
Response contains redirect URL for payment page

The application needs to redirect to the provided URL to enter eSewa/Khalti payment page.

Field NameTypeDescription
successBooleantrue - Request successful
redirectUrlStringURL to redirect user for payment
3.3 Process Transaction
Handle payment completion on success/failure URLs

After payment completion, users are redirected to your provided URLs with query parameters.

Parameter NameTypeDescription
transactionCodeStringCode of the transaction
totalAmountStringAmount of transacion
statusStringPayment status (COMPLETE/COMPLETED)

Lookup Route

Check Payment Status
Verify payment status using the lookup endpoint

Endpoint: GET /api/v1/payments/lookup

Query Parameters

Field NameTypeRequiredDescription
paymentIdStringYesPayment ID to lookup
orderIdStringNoAlternative lookup using order ID

Response Fields

Field NameTypeDescription
paymentIdStringPayment identifier
orderIdStringOrder identifier
statusStringpendingsuccessfailedexpired
amountNumberPayment amount
transactionIdStringGateway transaction ID (if completed)
createdAtStringPayment creation timestamp
completedAtStringPayment completion timestamp (if completed)

Test Credentials

eS
eSewa Test Credentials
Use these credentials for testing eSewa payments
FieldValue
eSewa ID9806800001/2/3/4/5
PasswordNepal@123
MPIN1234
OTP123456

Note: These credentials work only in the test environment. All transactions will be simulated.

K
Khalti Test Credentials
Use these credentials for testing Khalti payments
FieldValue
Mobile Number9800000001
MPIN1111
OTP987654
Passwordkhalti@123

Note: These credentials work only in the test environment. All transactions will be simulated.