UPIExpress UPI Express
API Documentation

Complete API Documentation

Everything you need to integrate UPIExpress Dynamic UPI QR payments into your application.

🚀 Quick Start

Get started with UPIExpress API in just a few simple steps:

1

Sign Up & Get API Keys

Create an account and get your API credentials from the dashboard.

2

Connect UPI Merchant Account

Connect your existing UPI merchant account (BharatPe, PhonePe, GPay, etc.) with UPIExpress.

3

Create Your First Order

Use the /api/create_order endpoint to generate a dynamic QR code.

curl -X POST https://upiexpress.com/api/create_order \
  -H "Content-Type: application/json" \
  -d '{
    "key": "your-api-key",
    "client_txn_id": "unique-id-123",
    "amount": "100",
    "customer_name": "John Doe",
    "customer_email": "john@example.com",
    "customer_mobile": "9876543210",
    "redirect_url": "https://yourwebsite.com/thank-you"
  }'
4

Handle Payment Status

Use webhooks or poll the status API to get payment confirmation.

Pro Tip

For testing, use our sandbox environment. Contact support to get sandbox credentials.

🔐 Authentication

All API requests require authentication using your API key. Include the API key in the request body for all endpoints.

Getting Your API Key

  1. Login to your UPIExpress dashboard
  2. Navigate to API & Docs → API Keys & Webhooks
  3. Generate a new API key or use the existing one
  4. Keep your API key secure and never expose it in client-side code

Request Format

Include your API key in the request body:

{
  "key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  // other parameters...
}

📚 API Reference

POST

Create Payment Order

https://upiexpress.com/api/create_order

Create a new payment order and generate a dynamic UPI QR code.

Request Parameters

Parameter Type Required Description
key string Yes Your API key
client_txn_id string Yes Unique transaction ID from your system
amount string Yes Transaction amount (in INR)
customer_name string Yes Customer's full name
customer_email string Yes Customer's email address
customer_mobile string Yes Customer's mobile number (10 digits)
redirect_url string Yes URL to redirect after payment
webhook_url string No Callback URL for payment status updates
note string No Product/service description (max 25 chars)
udf1 - udf5 string No Custom fields for your reference

Example Request

{
  "key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "client_txn_id": "order_123456",
  "amount": "100.50",
  "customer_name": "John Doe",
  "customer_email": "john@example.com",
  "customer_mobile": "9876543210",
  "redirect_url": "https://yourstore.com/thank-you",
  "webhook_url": "https://yourstore.com/webhook/upi",
  "note": "Premium Subscription",
  "udf1": "user_id_123"
}

Success Response

{
  "status": true,
  "msg": "Order Created",
  "data": {
    "order_id": 500041,
    "payment_url": "https://upiexpress.com/payment/yiVaLXVNv4PDi5H72k4u0nx0C7DAfHHXXxwKMJ8xL855PX6ByS",
    "upi_id_hash": "caccc40fd94...",
    "upi_intent": {
      "bhim_link": "upi://pay?pa=...",
      "phonepe_link": "phonepe://pay?pa=...",
      "paytm_link": "paytmmp://pay?pa=...",
      "gpay_link": "tez://upi/pay?pa=..."
    }
  }
}
POST

Check Order Status

https://upiexpress.com/api/check_order_status

Check the status of a payment order. Rate limited to 500 requests per minute.

Request Parameters

Parameter Type Required Description
key string Yes Your API key
client_txn_id string Yes Your unique transaction ID
txn_date string No Transaction date (DD-MM-YYYY format)

Example Request

{
  "key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "client_txn_id": "order_123456"
}

Success Response

{
  "status": true,
  "msg": "Transaction found",
  "data": {
    "id": 66,
    "amount": 100.50,
    "txn_id": "UPIEX50004120220115144330001",
    "order_id": 500041,
    "client_txn_id": "order_123456",
    "customer_name": "John Doe",
    "customer_email": "john@example.com",
    "customer_mobile": "9876543210",
    "upi_txn_id": "209876543210",
    "status": "success",
    "note": "Premium Subscription",
    "udf1": "user_id_123",
    "txnAt": "2022-01-15",
    "createdAt": "2022-01-15T14:43:30.000Z"
  }
}

🔔 Webhooks

Webhooks allow you to receive real-time notifications about payment status changes. Configure your webhook URL to automatically receive updates.

Webhook Payload

When a payment status changes, we'll POST JSON data to your webhook URL:

{
  "id": 66,
  "amount": 100,
  "convenience_fee": 0,
  "total_amount": 100,
  "txn_id": "UPIEX50004120220115144330001",
  "order_id": 500041,
  "client_txn_id": "abcd1234",
  "customer_name": "Jon Doe",
  "customer_email": "jondoe@gmail.com",
  "customer_mobile": "9876543210",
  "upi_txn_id": "209876543210",
  "status": "success",
  "note": "Product information",
  "udf1": "",
  "udf2": "",
  "udf3": "",
  "redirect_url": "https://upiexpress.com",
  "webhook_url": "https://upiexpress.com",
  "txnAt": "2022-01-15",
  "createdAt": "2022-01-15T14:43:30.000Z",
  "MerchantId": "AB12s87d6f5g4h3j2k11Øm9n8o7p6q5r4"
}

Event Types

Event Description
payment.success Payment completed successfully
payment.failed Payment failed
payment.pending Payment initiated but pending
payment.expired Payment link expired

⚠️ Error Handling

All API endpoints return consistent error responses. Always handle errors gracefully in your implementation.

Common Error Responses

HTTP Status Error Code Message Solution
400 INVALID_API_KEY Invalid API key provided Check your API key
400 MISSING_PARAMETER Required parameter missing Check request parameters
402 PLAN_EXPIRED Your plan has expired Renew your subscription
404 ORDER_NOT_FOUND Transaction not found Verify order ID
429 RATE_LIMITED Too many requests Wait and retry
500 INTERNAL_ERROR Internal server error Contact support

Example Error Response

{
  "status": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API key provided",
    "details": "The API key provided is invalid or expired"
  }
}

💡 Best Practices

1. Unique Transaction IDs

Always generate unique client_txn_id for each transaction. Never reuse IDs.

2. Implement Webhooks

Use webhooks for real-time updates instead of polling the status API frequently.

3. Handle Timeouts

Payment links expire after 15 minutes. Handle expired payments gracefully.

4. Secure API Keys

Store API keys securely in environment variables, never in client-side code.

5. Validate Responses

Always verify the upi_id_hash before redirecting users to payment URLs.

6. Monitor Webhook Deliveries

Implement logging for webhook deliveries and set up alerts for failures.

❓ Frequently Asked Questions

Q: How long are payment links valid?

Payment links are valid for 15 minutes. After that, a new order must be created.

Q: Can I customize the QR code appearance?

Yes, you can customize QR code size and colors through our dashboard settings.

Q: Is there a sandbox environment?

Yes, contact support to get access to our sandbox environment for testing.

Q: What UPI apps are supported?

All major UPI apps: GPay, PhonePe, Paytm, BHIM, Amazon Pay, and 200+ other banks.

Q: How do I handle refunds?

Refunds are processed directly from your connected UPI merchant account dashboard.

🛠️ Support

Documentation

Detailed guides and tutorials

View Integration Guide

Contact Support

Get help from our team

Contact Us

API Status

Current API Status: ● Operational

Last updated: Just now | Uptime: 99.9%

Ready to Start Integrating?

Join thousands of businesses accepting payments with UPIExpress. Get started in minutes with our easy-to-use API.