🇮🇳 Made for Indian Merchants • 0% Platform Commission • Instant Direct Bank UPI Settlement
REST API v1.3.0

Developer API Documentation

Complete integration reference for WebPress Pay payment engine.

1. Overview & Architecture

WebPress Pay is a direct-to-bank peer-to-peer UPI payment facilitation engine. It allows merchants to generate dynamic UPI QR codes and 1-tap mobile deep links (PhonePe, Google Pay, Paytm, BHIM, CRED) and reconciles payments in real time using 12-digit bank UTR numbers.

Key Principles:
  • Direct Settlement: Customer payments go directly into your bank account. No funds are pooled on the gateway server.
  • 0% Commissions: You keep 100% of customer payments. Only flat subscription access applies.
  • Instant Webhooks: Automated background workers dispatch instant HTTP POST notifications when an order is verified.

2. Authentication & API Keys

All API requests require authentication via your unique Merchant User Token (`user_token`). You can find or regenerate your secret token inside the Merchant Dashboard under API Credentials.

Finding Your Merchant Token:
  1. Log in to your Merchant Dashboard.
  2. Navigate to API Details in the left sidebar.
  3. Copy your 32-character hexadecimal User Token.
Security Notice: Keep your Merchant User Token secure. Never expose it in client-side HTML, frontend JavaScript, or public Git repositories.

3. Base URLs & Content Types

Parameter Value
Base URL https://webpresspay.com
HTTP Method POST
Content-Type application/x-www-form-urlencoded or multipart/form-data
Response Format application/json

POST

4. Create Payment Order (PayIN)

Initiates a payment session and returns a secure hosted checkout URL.

Endpoint: /api/create-order  (or /payment/create_order.php)
Request Parameters:
Field Type Required Description
user_token String Yes Your 32-character merchant API token.
amount Numeric Yes Amount in INR (e.g. 100.00).
order_id String Yes Unique order reference (alphanumeric, max 100 chars).
customer_mobile String Yes 10-digit Indian mobile number of customer.
redirect_url URL Optional URL where customer is redirected after payment completion.
remark1 String Optional Custom metadata / note (passed back in webhooks).
remark2 String Optional Additional custom reference note.
Success Response (HTTP 201 Created):
{
  "status": true,
  "message": "Order Created Successfully",
  "result": {
    "orderId": "ORDER_1724749200",
    "payment_url": "https://webpresspay.com/payment3/pay_now.php?token=a8f9c2e0b1d3..."
  }
}
Error Response (HTTP 400 / 401 / 403):
{
  "status": false,
  "message": "Invalid or unauthorized Merchant User Token"
}

POST

5. Check Order Status

Query the real-time settlement status of any previously initiated order.

Endpoint: /api/check-order-status  (or /payment/check_order.php)
Request Parameters:
Field Type Required Description
user_token String Yes Your merchant API token.
order_id String Yes The order ID to look up.
Success Response — Paid (HTTP 200 OK):
{
  "status": "COMPLETED",
  "message": "Transaction Successfully",
  "result": {
    "txnStatus": "COMPLETED",
    "resultInfo": "Transaction Success",
    "orderId": "ORDER_1724749200",
    "status": "SUCCESS",
    "amount": "100.00",
    "date": "2026-08-27 14:30:00",
    "utr": "423984719283"
  }
}

6. Connection Diagnostic / Ping

Test whether your server can reach the WebPress Pay platform and confirm that your API token is valid without creating real orders.

Endpoint: /api/check-order-status with order_id = "TEST_PING_1792251324"
{
  "status": true,
  "message": "Connection Successful! Merchant API Token is verified and active.",
  "result": {
    "token_status": "VALID",
    "mode": "LIVE"
  }
}

7. Webhook & Instant Payment Notification (IPN)

When a payment is verified, our automated background worker sends an asynchronous HTTP POST request to your configured Webhook URL.

Webhook Payload (HTTP POST):
{
  "order_id": "ORDER_1724749200",
  "amount": "100.00",
  "status": "SUCCESS",
  "customer_mobile": "9707842047",
  "remark1": "Order Checkout",
  "remark2": ""
}
Sample Webhook Listener (PHP):
<?php
$payload = $_POST;

if (!empty($payload['status']) && $payload['status'] === 'SUCCESS') {
    $orderId = $payload['order_id'];
    $amount  = $payload['amount'];
    
    // Fulfill customer order in your database
    // updateOrderStatus($orderId, 'PROCESSING');
    
    // Always return HTTP 200 JSON
    header('Content-Type: application/json');
    echo json_encode(['status' => true, 'message' => 'Order fulfilled']);
    exit;
}
?>

8. PHP SDK Integration

Download the official PHP SDK v1.3.0 for clean object-oriented integration.

<?php
require_once __DIR__ . '/WebPressPay.php';

$client = new WebPressPay('YOUR_MERCHANT_TOKEN', 'https://webpresspay.com');

// 1. Diagnostic test
$ping = $client->testConnection();
if (!$ping['success']) {
    die("Connection failed: " . $ping['message']);
}

// 2. Create Order
$order = $client->createOrder([
    'amount'          => 250.00,
    'order_id'        => 'INV_' . time(),
    'customer_mobile' => '9707842047',
    'redirect_url'    => 'https://yourwebsite.com/payment-complete'
]);

if (!empty($order['status'])) {
    // Redirect customer
    header('Location: ' . $order['result']['payment_url']);
    exit;
}
?>

9. WordPress WooCommerce Plugin Setup

  1. Download upi-payment-woocommerce.zip from the SDK Files Page.
  2. In your WordPress Admin, go to Plugins → Add New → Upload Plugin and upload the ZIP.
  3. Activate the plugin.
  4. Go to WooCommerce → Settings → Payments → WebPress Pay UPI.
  5. Enter your Base URL (https://webpresspay.com) and Merchant Token.
  6. Click Test Connection to confirm instant communication.
  7. Save changes. Your checkout is now accepting direct UPI payments!

10. cURL Command Example

curl -X POST "https://webpresspay.com/api/create-order" \
  -d "user_token=YOUR_MERCHANT_TOKEN" \
  -d "amount=100.00" \
  -d "order_id=ORDER_12345" \
  -d "customer_mobile=9707842047" \
  -d "redirect_url=https://yourwebsite.com/success"

11. Error Codes & Troubleshooting

HTTP Code Error Message Cause & Solution
401 Invalid or unauthorized Merchant User Token Check that your user_token matches your active token in Merchant Dashboard.
403 Merchant Account is Suspended/Banned Your merchant account has been locked. Contact administrator support.
400 Order ID already exists for this user Pass a fresh, unique order_id for every new payment attempt.
400 Your Subscription Plan has expired Log in to Merchant Dashboard → Subscription and renew your plan.
Chat with Us