splitTransactionQR(params)
Splits large transactions exceeding a threshold (default ₹2,000) into ₹1,999 intervals and generates concurrent QR codes for each chunk.
Why Split at ₹1,999?
Under National Payments Corporation of India (NPCI) regulations:
- Transactions less than or equal to ₹2,000 on Prepaid Payment Instruments (PPI wallets like Paytm wallet, PhonePe wallet) bypass merchant interchange fees (typically up to 1.1%).
- Sub-₹2,000 transactions experience significantly fewer bank OTP delays, faster client verification, and higher completion rates.
- By splitting higher amounts into ₹1,999 chunks, each individual payment remains safely under the ₹2,000 threshold while completing the full invoice balance.
Function Signature
function splitTransactionQR(params: SplitQRParams): Promise<SplitQRItem[]>;Parameters (SplitQRParams)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| UPI_ID | string | Required | — | Valid UPI handle (e.g. store@okhdfcbank). |
| AMOUNT | number | Required | — | Total amount to receive (positive number up to ₹10,00,000). |
| splitInterval | number | Optional | 1999 | Maximum amount per split chunk. |
| threshold | number | Optional | 2000 | Amount above which splitting is triggered. If AMOUNT <= threshold, 1 QR is generated. |
| name | string | Optional | — | Payee name (encoded as pn). |
| note | string | Optional | — | Transaction note. Automatically appends (Part X/Y) to each chunk. |
| currency | string | Optional | "INR" | Currency code. |
Return Value (SplitQRItem[])
Returns a Promise resolving to an array of objects:
| Property | Type | Description |
|---|---|---|
| id | string | Unique UUID (v4) identifying this specific split chunk. |
| amount | number | The numerical amount for this individual chunk (e.g. 1999). |
| image | string | Base64 Data URL of the generated QR code (data:image/png;base64,...). |
Example Output (for ₹5,000)
[
{
"id": "4a236fad-ebc5-471f-86ab-86a4f9e621e7",
"amount": 1999,
"image": "data:image/png;base64,iVBORw0KGgo..."
},
{
"id": "c19ba6ae-664a-47d7-9948-bf3558fefb6d",
"amount": 1999,
"image": "data:image/png;base64,iVBORw0KGgo..."
},
{
"id": "3c44b4ad-44e7-414f-86c4-60ae9f228ec6",
"amount": 1002,
"image": "data:image/png;base64,iVBORw0KGgo..."
}
]Live Interactive Split Calculator
Experiment with amounts, split intervals, and thresholds to see the generated QR codes in real-time:
Interactive UPI QR StudioLive v3.0.0
Simulate live QR generation & transaction splitting directly in your browser
Ready to Generate
Adjust parameters on the left and click Generate to see the base64 QR Data URL and split chunks live.
Step-by-Step Implementation Guide
Invoke splitTransactionQR
Pass your UPI ID and the total order amount. The library automatically checks whether splitting is necessary.
import { splitTransactionQR } from "@omkarbhosale/upiqr";
async function processHighValuePayment() {
try {
const qrs = await splitTransactionQR({
UPI_ID: "merchant@okhdfcbank",
AMOUNT: 5000,
name: "Omkar Store",
note: "Order #8491",
});
console.log(qrs);
} catch (error) {
console.error("Split generation failed:", error.message);
}
}
processHighValuePayment();Render Stepper or Tab Carousel
If multiple items are returned in the array, render a multi-step checkout UI with tabs (e.g. "Part 1 of 3: ₹1,999", "Part 2 of 3: ₹1,999", "Part 3 of 3: ₹1,002").
Track Payment Completion
Each chunk includes a unique UUID in item.id. You can store these IDs in your database to track which parts the customer has confirmed.
Custom Split Intervals & Thresholds
You can customize the threshold and chunk interval to match custom business requirements:
import { splitTransactionQR } from "@omkarbhosale/upiqr";
// Split transactions above ₹500 into ₹400 intervals
const qrs = await splitTransactionQR({
UPI_ID: "merchant@upi",
AMOUNT: 1000,
threshold: 500, // Split anything > ₹500
splitInterval: 400, // Chunk size: ₹400
name: "Omkar Store",
note: "Custom Split"
});
// Returns 3 QRs: ₹400 + ₹400 + ₹200Amounts Within Threshold (≤ ₹2,000)
If the amount is less than or equal to the threshold, no splitting occurs. The returned array simply contains a single QR item:
// Transactions <= threshold are NOT split
const qrs = await splitTransactionQR({
UPI_ID: "merchant@upi",
AMOUNT: 1500,
});
// Returns 1 item in the array:
// [ { id: "...", amount: 1500, image: "data:image/png;base64,..." } ]