Live Api Request
Get Start
RupantorPay API Documentation

Welcome To RupantorPay Documentation Last updated: 2025-02-06

RupantorPay is a simple and secure payment automation tool designed to use personal accounts as payment gateways, enabling you to accept payments from customers through your website. This documentation provides a complete overview of how RupantorPay works and how to integrate the RupantorPay API into your website.

Setup Your Panel

Checkpoint Tips:

Setup Your Mobile App

Checkpoint Tips:
  • Download the mobile app: Download Mobile App
  • Complete the setup process:
    1. Install the app with necessary permissions
    2. Register a device from Devices Section
    3. Copy the device key
    4. Enter your email and device key in the mobile app
    5. Grant SMS and Notification permissions to the app

API Introduction

The RupantorPay Payment Gateway enables merchants to receive payments from customers by temporarily redirecting them to RupantorPay.com. The gateway connects multiple payment terminals including card systems, mobile financial systems, and local/international wallets. After payment completion, customers are returned to the merchant's site, and the merchant receives payment notification with transaction details.

Note: This document is intended for technical personnel supporting merchant websites. Working knowledge of HTML forms or cURL is required.

API Operation

Our REST APIs support both GET and POST methods in two environments:

  • Sandbox: For testing purposes (use test credentials)
  • Live: For production processing (use live credentials)

POST GET Create Payment URL

https://payment.rupantorpay.com/api/payment/checkout

Endpoint for creating new payment requests

POST GET Verify Payment

https://payment.rupantorpay.com/api/payment/verify-payment

Endpoint for verifying completed transactions

Server Requirements: Your server must support cURL for API integration. For HTML Form submission, see the HTML Post method examples below.

Parameter Details

Payment Initialization Parameters - Required for POST requests to create payment URLs
Field Name Description Required Example Values
fullname Customer Full Name Yes John Doe
email Customer Email Address Yes john@gmail.com
amount Total payable amount (skip trailing zeros for whole numbers) Yes 10 or 10.50 or 10.6
success_url URL to redirect after successful payment Yes https://yourdomain.com/success.php
webhook_url URL for server-to-server payment notifications No https://yourdomain.com/webhook.php
cancel_url URL to redirect if payment is cancelled Yes https://yourdomain.com/cancel.php
meta_data Additional JSON formatted data No {"order_id": "12345", "product": "Premium"}
Payment Verification Parameters - Required for GET requests to verify payments
Field Name Description Required Example Values
transaction_id Transaction ID received in success URL Yes OVKPXW165414

Headers Details

Header Name Value
Content-Type application/json
X-API-KEY Your API key from Brands section
X-CLIENT <?= $_SERVER['HTTP_HOST']; ?>
Checkout POPUP

Add This JS To Your Page:

<script src="https://rupantorpay.com/public/assets/js/checkout.js"></script>
  
<script> rupantorpayCheckOut(payment_url); </script>
  

Note: payment_url should be obtained from the payment API endpoint.

Integration Examples

Integrate our payment gateway into various platforms including PHP, Laravel, WordPress, WooCommerce, and more.

cURL Example

For server-side integration using PHP cURL

View Example

Verification

How to verify completed payments

View Example

Sample Request

Create a Payment Request

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://payment.rupantorpay.com/api/payment/checkout',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "success_url": "yourdomain.com/success",
    "cancel_url": "yourdomain.com/cancel",
    "webhook_url": "yourdomain.com/webhook",
    "metadata": {
      "phone": "016****"
    },
    "amount": "10"
  }',
   CURLOPT_HTTPHEADER => array(
    'X-API-KEY: API key From Brands',
    'Content-Type: application/json',
    'X-CLIENT: <?= $_SERVER["HTTP_HOST"]; ?>'
  ),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;

?>
      

<?php
$client = new Client();
$headers = [
    'X-API-KEY: API key From Brands',
    'Content-Type: application/json',
    'X-CLIENT: <?= $_SERVER["HTTP_HOST"]; ?>'
];
$body = '{
  "success_url": "yourdomain.com/success",
  "cancel_url": "yourdomain.com/cancel",
  "webhook_url": "yourdomain.com/webhook",
  "metadata": {
    "phone": "016****"
  },
  "amount": "10"
}';
$request = new Request('POST', 'https://payment.rupantorpay.com/api/payment/checkout', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
?>
      

const axios = require('axios');
let data = JSON.stringify({
  "success_url": "yourdomain.com/success",
  "cancel_url": "yourdomain.com/cancel",
  "webhook_url": "yourdomain.com/webhook",
  "metadata": {
    "phone": "016****"
  },
  "amount": "10"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://payment.rupantorpay.com/api/payment/checkout',
  headers: { 
    'X-API-KEY: API key From Brands',
    'Content-Type: application/json',
    'X-CLIENT: <?= $_SERVER["HTTP_HOST"]; ?>'
  },
  data: data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
      

import requests
import json

url = "https://payment.rupantorpay.com/api/payment/checkout"

payload = json.dumps({
  "success_url": "yourdomain.com/success",
  "cancel_url": "yourdomain.com/cancel",
  "webhook_url": "yourdomain.com/webhook", # Optional: For real-time updates
  "metadata": {
    "phone": "016****"
  },
  "amount": "10"
})
headers = {
    'X-API-KEY: API key From Brands',
    'Content-Type: application/json',
    'X-CLIENT: <?= $_SERVER["HTTP_HOST"]; ?>'
}
response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
      

package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://payment.rupantorpay.com/api/payment/checkout"
  method := "POST"

  payload := strings.NewReader(`{
    "success_url": "yourdomain.com/success",
    "cancel_url": "yourdomain.com/cancel",
    "webhook_url": "yourdomain.com/webhook",
    "metadata": {
      "phone": "01521412457"
    },
    "amount": "10"
  }`)

  client := &http.Client {}
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", "gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef")
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-CLIENT", " <?= $_SERVER["HTTP_HOST"]; ?>'")
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
      
Sample Response

{
    "status": 1,
    "message": "Payment Link",
    "payment_url": "https://payment.rupantorpay.com/api/execute/b32174038622a436c132a893183a8f74"
}
      

Response Details

Field Name Type Description
Success Response
status bool TRUE
message String Message for Status
payment_url String Payment Link (where customers will complete their payment)
Error Response
status bool FALSE
message String Message associated with the error response
Payment Completion Flow
After completing payment, customers will be redirected to success or cancel page with these query parameters:
yourdomain.com/(success/cancel)?
transactionId=******&
paymentMethod=***&
paymentAmount=**.**&
paymentFee=**.**&
currency=****&
status=PENDING|COMPLETED|ERROR
Returned Parameters (GET)

Parameters returned to your success/cancel URLs:

Param Name Data Type Description
transactionId string (50) Unique transaction identifier
paymentMethod string (50) Payment method used
paymentAmount string (50) Amount paid by customer
paymentFee string (50) Transaction fee deducted
currency string (50) Currency used for payment
status string Payment status (pending/success/failed)

Verify Request

Create a Verify Payment Request

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://payment.rupantorpay.com/api/payment/verify-payment',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{"transaction_id":"ABCDEFH"}',
  CURLOPT_HTTPHEADER => array(
    'X-API-KEY: API key From Brands',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
      

<?php
$client = new Client();
$headers = [
  'X-API-KEY' => 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef',
  'Content-Type' => 'application/json'
];
$body = '{
  "transaction_id": "ABCDEFH"
}';
$request = new Request('POST', 'https://payment.rupantorpay.com/api/payment/verify-payment', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

?>
      

const axios = require('axios');
let data = JSON.stringify({
  "transaction_id": "ABCDEFH"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://payment.rupantorpay.com/api/payment/verify-payment',
  headers: { 
    'X-API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
      

import http.client
import json

conn = http.client.HTTPSConnection("local.payment.rupantorpay.com")
payload = json.dumps({
  "transaction_id": "ABCDEFH"
})
headers = {
  'X-API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef',
  'Content-Type': 'application/json'
}
conn.request("POST", "/api/payment/verify-payment", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
      

package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://payment.rupantorpay.com/api/payment/verify-payment"
  method := "POST"

  payload := strings.NewReader(`{"transaction_id":"ABCDEFH"}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", "gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
      
Sample Response

{
    "fullname" => "John Doe",
    "email" => "john@gmail.com",
    "amount" => "900.000",
    "transaction_id" => "OVKPXW165414",
    "trx_id" => "7TRKHJH",
    "currency" => "BDT",
    "metadata" => {
        "phone" => "015****"
    },
    "payment_method" => "bkash",
    "status" => "COMPLETED"
}
      

📋 Response Details

Field Name Type Description
Success Response
status string COMPLETED or PENDING or ERROR
fullname String Customer Name
email String Customer Email
amount String Amount
transaction_id String Transaction id Generated by System
trx_id String Real Transaction id from Gateway
currency String currency from Gateway
metadata json Metadata used for Payment creation
Error Response
status bool FALSE
message String Message associated with the error response

Ready-Made Modules

Integrate our payment gateway quickly with our pre-built modules for popular platforms.

Open Source Modules

Find additional integration modules and contribute to our open-source projects.

Visit GitHub
Composer Command

See documentation for composer installation:

📦 GitHub Repository rupantorpay/LaravelSDK

composer require rupantorpay/laravel-sdk

WordPress Module

Integrate our payment gateway into your WordPress website effortlessly. Works with e-commerce stores, membership sites, and donation platforms.

Installation Steps:
  1. Log in to your WordPress admin panel
  2. Go to Plugins > Add New
  3. Search for "rupantorPay"
  4. Install and activate the plugin
  5. Configure with your API credentials

WHMCS Module

Seamlessly integrate with your WHMCS setup to accept payments, manage invoices, and track transactions.

Modified SMM Panel Module

Enhance your SMM panel with streamlined payment processing for social media marketing services.

SMM Panel Module

Standard integration module for SMM panels with payment processing capabilities.

Sketware SWB

Integration solution for Application platform with RupantorPay payment processing.

Active CMS

Integration solution for Application platform with RupantorPay payment processing.

Market BOB Module

Integration solution for Market BOB platform with RupantorPay payment processing.

Laravel Module

Composer package for Laravel applications with RupantorPay payment integration.