POST /v2/payments/createQrOrder
Creates a payment order and returns a QR code that the merchant displays. The customer scans this QR code with their Rebell app to complete payment.
Use Case
This is the “Merchant Presented Mode” (MPM) flow for QR-based payments. Ideal for:
Point of sale displays
Self-service kiosks
Table ordering systems
Vending machines
Create Order
Merchant backend calls createQrOrder with payment details
Display QR
Merchant displays the QR code to the customer
Customer Scans
Customer opens Rebell app and scans the QR code
Customer Confirms
Customer confirms payment in their app
Webhook Notification
Merchant receives payment status via webhook
Request Parameters
Business type. Use ORDER_CODE for QR order payments.
Payment product code assigned by Rebell.
QR code type. Use CGCP (Customer Generated Code Payment).
Merchant-generated unique identifier (idempotency key). Max length : 64 characters
Payment amount details. ISO-4217 currency code (e.g., EUR)
Order details including description and merchant info.
Webhook URL for payment notifications.
Extended information as JSON string.
Response Parameters
Echo of the merchant’s payment request ID
Rebell-assigned payment identifier
QR code content to display to the customer
Example Request
{
"bizType" : "ORDER_CODE" ,
"productCode" : "5105010010000100040" ,
"codeType" : "CGCP" ,
"paymentRequestId" : "QR-20240110-001" ,
"paymentAmount" : {
"currency" : "EUR" ,
"value" : "1500"
},
"order" : {
"orderDescription" : "Table 5 - Dinner" ,
"orderMemo" : "No nuts allergy" ,
"merchant" : {
"store" : {
"externalStoreId" : "STORE_001"
}
}
},
"paymentNotifyUrl" : "https://merchant.example.com/webhooks/payment"
}
Example Response
{
"result" : {
"resultCode" : "SUCCESS" ,
"resultStatus" : "S" ,
"resultMessage" : "success"
},
"paymentRequestId" : "QR-20240110-001" ,
"paymentId" : "2024011012345678901234" ,
"qrCode" : "https://pay.rebellapp.com/qr/abc123xyz..."
}
Displaying the QR Code
Generate a QR code image from the qrCode response value:
import QRCode from 'qrcode' ;
async function displayPaymentQR ( qrCodeContent ) {
// Generate as data URL for HTML display
const dataUrl = await QRCode . toDataURL ( qrCodeContent , {
width: 300 ,
margin: 2 ,
color: { dark: '#000000' , light: '#ffffff' }
});
return `<img src=" ${ dataUrl } " alt="Scan to pay" />` ;
}
// Or generate to canvas
async function renderToCanvas ( qrCodeContent , canvasElement ) {
await QRCode . toCanvas ( canvasElement , qrCodeContent , {
width: 300
});
}
Polling for Payment Status
After displaying the QR code, poll for payment completion:
async function waitForPayment ( paymentId , paymentRequestId , timeout = 300000 ) {
const startTime = Date . now ();
const pollInterval = 3000 ; // 3 seconds
while ( Date . now () - startTime < timeout ) {
const status = await rebellAPI . inquiryPayment ({
paymentId ,
paymentRequestId
});
if ( status . result . resultStatus === 'S' ) {
if ( status . paymentStatus === 'SUCCESS' ) {
return { success: true , paymentId };
}
if ( status . paymentStatus === 'FAIL' ) {
return { success: false , reason: status . result . resultMessage };
}
}
// Still processing, wait and retry
await new Promise ( resolve => setTimeout ( resolve , pollInterval ));
}
return { success: false , reason: 'Timeout waiting for payment' };
}
Result Codes
resultStatus resultCode Description Action SSUCCESSQR order created Display QR and start polling FPARAM_ILLEGALInvalid parameters Check request FREPEAT_REQ_INCONSISTENTDuplicate with different params Use new paymentRequestId UUNKNOWN_EXCEPTIONUnknown error Retry request
Inquiry Payment Poll for payment status
QR Order Pay Guide Complete integration guide