Rupixpe Payment Gateway API

Complete API documentation for integrating Payin and Payout services

Getting Started

Welcome to Rupixpe Payment Gateway API documentation. This guide will help you integrate our payment services into your application.

Base URL

https://merchant.rupixpe.com/api/v1

Quick Setup

  1. Sign up for a merchant account at merchant.rupixpe.com
  2. Complete your KYC verification
  3. Get your API credentials from the Settings page
  4. Start integrating using the code examples below
Note: All API requests must be made over HTTPS. Requests made over plain HTTP will fail.

Authentication

Rupixpe API uses API Key and Secret for authentication. Include these in your request headers.

Headers

Header Value Description
X-API-Key Your API Key Your merchant API key from settings
X-API-Secret Your API Secret Your merchant API secret
Content-Type application/json Request content type

Node.js Example

const axios = require('axios');

const API_KEY = 'your_api_key_here';
const API_SECRET = 'your_api_secret_here';
const BASE_URL = 'https://merchant.rupixpe.com/api/v1';

const apiClient = axios.create({
    baseURL: BASE_URL,
    headers: {
        'X-API-Key': API_KEY,
        'X-API-Secret': API_SECRET,
        'Content-Type': 'application/json'
    }
});

Payin API (Payment Collection)

Use Payin API to collect payments from your customers via UPI.

Create Payin Transaction

POST /payin/create

Creates a new payment collection request.

Request Parameters

Parameter Type Required Description
order_id string Required Your unique order identifier
amount number Required Amount in INR (minimum: 10)
customer_name string Required Customer's full name
customer_email string Required Customer's email address
customer_phone string Required Customer's phone number (10 digits)
redirect_url string Optional URL to redirect after payment
webhook_url string Optional Webhook URL for this transaction

Node.js Example

async function createPayin() {
    try {
        const response = await apiClient.post('/payin/create', {
            order_id: 'ORDER_' + Date.now(),
            amount: 100.00,
            customer_name: 'John Doe',
            customer_email: 'john@example.com',
            customer_phone: '9876543210',
            redirect_url: 'https://yoursite.com/payment/success',
            webhook_url: 'https://yoursite.com/webhook/payin'
        });

        console.log('Transaction ID:', response.data.data.transaction_id);
        console.log('Payment URL:', response.data.data.payment_url);

        return response.data;
    } catch (error) {
        console.error('Error:', error.response?.data || error.message);
    }
}

createPayin();

Success Response

{
    "success": true,
    "message": "Payin transaction created successfully",
    "data": {
        "transaction_id": "TXN_ABC123XYZ",
        "order_id": "ORDER_1234567890",
        "amount": 100.00,
        "status": "pending",
        "payment_url": "https://merchant.rupixpe.com/pay/TXN_ABC123XYZ",
        "created_at": "2025-10-02T00:00:00.000Z"
    }
}

Check Payin Status

GET /payin/status/:transaction_id

Node.js Example

async function checkPayinStatus(transactionId) {
    try {
        const response = await apiClient.get(`/payin/status/${transactionId}`);

        console.log('Status:', response.data.data.status);
        console.log('Amount:', response.data.data.amount);

        return response.data;
    } catch (error) {
        console.error('Error:', error.response?.data || error.message);
    }
}

checkPayinStatus('TXN_ABC123XYZ');

Success Response

{
    "success": true,
    "data": {
        "transaction_id": "TXN_ABC123XYZ",
        "order_id": "ORDER_1234567890",
        "amount": 100.00,
        "status": "success",
        "upi_id": "john@paytm",
        "utr": "123456789012",
        "created_at": "2025-10-02T00:00:00.000Z",
        "completed_at": "2025-10-02T00:01:30.000Z"
    }
}

List Payin Transactions

GET /payin/list

Query Parameters

Parameter Type Description
page number Page number (default: 1)
limit number Items per page (default: 20, max: 100)
status string Filter by status: pending, success, failed
from_date string Start date (YYYY-MM-DD)
to_date string End date (YYYY-MM-DD)

Node.js Example

async function listPayins() {
    try {
        const response = await apiClient.get('/payin/list', {
            params: {
                page: 1,
                limit: 20,
                status: 'success',
                from_date: '2025-10-01',
                to_date: '2025-10-02'
            }
        });

        console.log('Total:', response.data.data.total);
        console.log('Transactions:', response.data.data.transactions);

        return response.data;
    } catch (error) {
        console.error('Error:', error.response?.data || error.message);
    }
}

listPayins();

Payout API (Money Transfer)

Use Payout API to transfer money to your customers or vendors via Bank Transfer (IMPS/NEFT/RTGS).

Initiate Payout

POST /payout/initiate

Request Parameters

Parameter Type Required Description
reference_id string Required Your unique payout reference
amount number Required Amount in INR (minimum: 100)
beneficiary_name string Required Beneficiary's full name
beneficiary_email string Required Beneficiary's email
beneficiary_phone string Required Beneficiary's phone (10 digits)
account_number string Required Beneficiary's bank account number
ifsc_code string Required Beneficiary's bank IFSC code
mode string Optional Transfer mode: 'IMPS', 'NEFT', or 'RTGS' (default: IMPS)
purpose string Optional Purpose of transfer

Node.js Example

async function initiatePayout() {
    try {
        const response = await apiClient.post('/payout/initiate', {
            reference_id: 'PAYOUT_' + Date.now(),
            amount: 1000.00,
            beneficiary_name: 'Jane Doe',
            beneficiary_email: 'jane@example.com',
            beneficiary_phone: '9876543210',
            account_number: '1234567890',
            ifsc_code: 'HDFC0001234',
            mode: 'IMPS',
            purpose: 'Vendor payment'
        });

        console.log('Payout ID:', response.data.data.payout_id);
        console.log('Status:', response.data.data.status);

        return response.data;
    } catch (error) {
        console.error('Error:', error.response?.data || error.message);
    }
}

initiatePayout();

Success Response

{
    "success": true,
    "message": "Payout initiated successfully",
    "data": {
        "payout_id": "POUT_XYZ789ABC",
        "reference_id": "PAYOUT_1234567890",
        "amount": 500.00,
        "status": "pending",
        "created_at": "2025-10-02T00:00:00.000Z"
    }
}

Check Payout Status

GET /payout/status/:payout_id

Node.js Example

async function checkPayoutStatus(payoutId) {
    try {
        const response = await apiClient.get(`/payout/status/${payoutId}`);

        console.log('Status:', response.data.data.status);
        console.log('Amount:', response.data.data.amount);
        console.log('UTR:', response.data.data.utr);

        return response.data;
    } catch (error) {
        console.error('Error:', error.response?.data || error.message);
    }
}

checkPayoutStatus('POUT_XYZ789ABC');

List Payout Transactions

GET /payout/list

Node.js Example

async function listPayouts() {
    try {
        const response = await apiClient.get('/payout/list', {
            params: {
                page: 1,
                limit: 20,
                status: 'success'
            }
        });

        console.log('Total:', response.data.data.total);
        console.log('Payouts:', response.data.data.payouts);

        return response.data;
    } catch (error) {
        console.error('Error:', error.response?.data || error.message);
    }
}

listPayouts();

Check Wallet Balance

GET /wallet/balance

Node.js Example

async function getWalletBalance() {
    try {
        const response = await apiClient.get('/wallet/balance');

        console.log('Available Balance:', response.data.data.available_balance);
        console.log('Pending Balance:', response.data.data.pending_balance);

        return response.data;
    } catch (error) {
        console.error('Error:', error.response?.data || error.message);
    }
}

getWalletBalance();

Webhooks

Webhooks allow you to receive real-time notifications about transaction status changes.

Setup Webhook URLs

Configure your webhook URLs in the Merchant Dashboard Settings:

  • Payin Webhook URL: Receives payment collection updates
  • Payout Webhook URL: Receives payout status updates
Important: Your webhook endpoint must respond with HTTP 200 status within 30 seconds.

Payin Webhook Payload

{
    "event": "payin.success",
    "transaction_id": "TXN_ABC123XYZ",
    "order_id": "ORDER_1234567890",
    "amount": 100.00,
    "status": "success",
    "utr": "123456789012",
    "customer_upi": "john@paytm",
    "completed_at": "2025-10-02T00:01:30.000Z",
    "signature": "sha256_hash_for_verification"
}

Payout Webhook Payload

{
    "event": "payout.success",
    "payout_id": "POUT_XYZ789ABC",
    "reference_id": "PAYOUT_1234567890",
    "amount": 500.00,
    "status": "success",
    "utr": "987654321098",
    "beneficiary_name": "Jane Doe",
    "beneficiary_account": "1234567890",
    "completed_at": "2025-10-02T00:05:45.000Z",
    "signature": "sha256_hash_for_verification"
}

Webhook Events

Event Description
payin.success Payment collection successful
payin.failed Payment collection failed
payin.pending Payment is being processed
payin.cancelled Payment was cancelled
payout.success Payout completed successfully
payout.failed Payout failed
payout.pending Payout is being processed

Node.js Webhook Handler Example

const express = require('express');
const app = express();

app.use(express.json());

// Payin webhook handler
app.post('/webhook/payin', (req, res) => {
    const payload = req.body;

    console.log('Payin Webhook Received:', payload.event);
    console.log('Transaction ID:', payload.transaction_id);
    console.log('Status:', payload.status);

    // Process the webhook based on event
    switch(payload.event) {
        case 'payin.success':
            // Update order status in your database
            // Send confirmation email to customer
            console.log('Payment successful!');
            break;
        case 'payin.failed':
            // Handle failed payment
            console.log('Payment failed!');
            break;
    }

    // Always respond with 200
    res.status(200).json({ received: true });
});

// Payout webhook handler
app.post('/webhook/payout', (req, res) => {
    const payload = req.body;

    console.log('Payout Webhook Received:', payload.event);
    console.log('Payout ID:', payload.payout_id);
    console.log('Status:', payload.status);

    // Process the webhook based on event
    switch(payload.event) {
        case 'payout.success':
            // Update payout status in your database
            console.log('Payout successful!');
            break;
        case 'payout.failed':
            // Handle failed payout
            console.log('Payout failed!');
            break;
    }

    // Always respond with 200
    res.status(200).json({ received: true });
});

app.listen(3000, () => {
    console.log('Webhook server running on port 3000');
});

Error Codes

Rupixpe API uses standard HTTP response codes and returns detailed error information.

HTTP Status Codes

Code Meaning Description
200 Success Request completed successfully
400 Bad Request Invalid parameters or missing required fields
401 Unauthorized Invalid or missing API credentials
403 Forbidden KYC not approved or insufficient permissions
404 Not Found Resource not found
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Something went wrong on our end

Error Response Format

{
    "success": false,
    "error": {
        "code": "INSUFFICIENT_BALANCE",
        "message": "Insufficient wallet balance for payout"
    }
}

Common Error Codes

Error Code Description
INVALID_CREDENTIALS API Key or Secret is invalid
KYC_NOT_APPROVED Complete KYC verification to use this API
INSUFFICIENT_BALANCE Not enough balance in wallet
INVALID_AMOUNT Amount below minimum or above maximum limit
DUPLICATE_ORDER Order ID already exists
INVALID_UPI Invalid UPI ID format
RATE_LIMIT_EXCEEDED Too many requests, please slow down

Complete Integration Example

Here's a complete Node.js example showing all major operations:

const axios = require('axios');

class RupixpeAPI {
    constructor(apiKey, apiSecret) {
        this.client = axios.create({
            baseURL: 'https://merchant.rupixpe.com/api/v1',
            headers: {
                'X-API-Key': apiKey,
                'X-API-Secret': apiSecret,
                'Content-Type': 'application/json'
            }
        });
    }

    // Create Payin
    async createPayin(orderData) {
        try {
            const response = await this.client.post('/payin/create', orderData);
            return response.data;
        } catch (error) {
            throw new Error(error.response?.data?.error?.message || error.message);
        }
    }

    // Check Payin Status
    async getPayinStatus(transactionId) {
        try {
            const response = await this.client.get(`/payin/status/${transactionId}`);
            return response.data;
        } catch (error) {
            throw new Error(error.response?.data?.error?.message || error.message);
        }
    }

    // Initiate Payout
    async initiatePayout(payoutData) {
        try {
            const response = await this.client.post('/payout/initiate', payoutData);
            return response.data;
        } catch (error) {
            throw new Error(error.response?.data?.error?.message || error.message);
        }
    }

    // Check Payout Status
    async getPayoutStatus(payoutId) {
        try {
            const response = await this.client.get(`/payout/status/${payoutId}`);
            return response.data;
        } catch (error) {
            throw new Error(error.response?.data?.error?.message || error.message);
        }
    }

    // Get Wallet Balance
    async getWalletBalance() {
        try {
            const response = await this.client.get('/wallet/balance');
            return response.data;
        } catch (error) {
            throw new Error(error.response?.data?.error?.message || error.message);
        }
    }
}

// Usage Example
async function main() {
    const api = new RupixpeAPI('your_api_key', 'your_api_secret');

    try {
        // 1. Check Wallet Balance
        console.log('Checking wallet balance...');
        const balance = await api.getWalletBalance();
        console.log('Available Balance:', balance.data.available_balance);

        // 2. Create a Payin
        console.log('\nCreating payin transaction...');
        const payin = await api.createPayin({
            order_id: 'ORDER_' + Date.now(),
            amount: 100.00,
            customer_name: 'John Doe',
            customer_email: 'john@example.com',
            customer_phone: '9876543210'
        });
        console.log('Transaction ID:', payin.data.transaction_id);
        console.log('Payment URL:', payin.data.payment_url);

        // 3. Check Payin Status
        setTimeout(async () => {
            console.log('\nChecking payin status...');
            const status = await api.getPayinStatus(payin.data.transaction_id);
            console.log('Status:', status.data.status);

            // 4. If successful, initiate a payout
            if (status.data.status === 'success') {
                console.log('\nInitiating payout...');
                const payout = await api.initiatePayout({
                    reference_id: 'PAYOUT_' + Date.now(),
                    amount: 50.00,
                    beneficiary_name: 'Jane Doe',
                    beneficiary_email: 'jane@example.com',
                    beneficiary_phone: '9876543210',
                    account_number: '1234567890',
                    ifsc_code: 'HDFC0001234',
                    mode: 'IMPS',
                    purpose: 'Refund'
                });
                console.log('Payout ID:', payout.data.payout_id);
            }
        }, 5000);

    } catch (error) {
        console.error('Error:', error.message);
    }
}

main();

Support

Need help with integration? We're here to assist you!

Contact Information

Email: support@rupixpe.com

Merchant Dashboard: merchant.rupixpe.com

Response Time: Within 24 hours

Testing

We recommend testing all integrations in a controlled environment before going live:

  • Use small amounts for initial testing
  • Test all webhook events
  • Verify error handling
  • Test rate limits