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
- Visit the Rupee API registration page
- Register with your email and passowrd, gmail, or github account.
- Verify your email address
- Log in using same credentials
Create Project
Set up your first project to organize your integration
- Log in to your Rupee API dashboard
- Navigate to "Projects" section
- Click "Create New Project"
- Enter project details (name, description, website URL)
- Click "Create Project"
Get API Key and Project Key
Obtain credentials to authenticate your API requests
- Navigate to "Settings" section in your project dashboard
- Copy and securely store both API Key and Project Key
- 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 Name | Value | Description |
---|---|---|
api-key | Your API Key | Authentication key from your dashboard |
Content-Type | application/json | Request content type |
Request Body Fields
Field Name | Type | Required | Description |
---|---|---|---|
amount | Number | Yes | Payment amount in smallest currency unit (paise for INR) |
successUrl | String | Yes | URL to redirect after successful payment |
failureUrl | String | Yes | URL to redirect after failed payment |
projectID | String | Yes | Your project identifier from dashboard |
orderID | String | Yes | Unique 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 Name | Type | Description |
---|---|---|
success | Boolean | true - Request successful |
redirectUrl | String | URL 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 Name | Type | Description |
---|---|---|
transactionCode | String | Code of the transaction |
totalAmount | String | Amount of transacion |
status | String | Payment status (COMPLETE/COMPLETED) |
Lookup Route
Check Payment Status
Verify payment status using the lookup endpoint
Endpoint: GET /api/v1/payments/lookup
Query Parameters
Field Name | Type | Required | Description |
---|---|---|---|
paymentId | String | Yes | Payment ID to lookup |
orderId | String | No | Alternative lookup using order ID |
Response Fields
Field Name | Type | Description |
---|---|---|
paymentId | String | Payment identifier |
orderId | String | Order identifier |
status | String | pendingsuccessfailedexpired |
amount | Number | Payment amount |
transactionId | String | Gateway transaction ID (if completed) |
createdAt | String | Payment creation timestamp |
completedAt | String | Payment completion timestamp (if completed) |
Test Credentials
eS
eSewa Test CredentialsUse these credentials for testing eSewa payments
Field | Value |
---|---|
eSewa ID | 9806800001/2/3/4/5 |
Password | Nepal@123 |
MPIN | 1234 |
OTP | 123456 |
Note: These credentials work only in the test environment. All transactions will be simulated.
K
Khalti Test CredentialsUse these credentials for testing Khalti payments
Field | Value |
---|---|
Mobile Number | 9800000001 |
MPIN | 1111 |
OTP | 987654 |
Password | khalti@123 |
Note: These credentials work only in the test environment. All transactions will be simulated.