Skip to main content
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
1

Create Order

Merchant backend calls createQrOrder with payment details
2

Display QR

Merchant displays the QR code to the customer
3

Customer Scans

Customer opens Rebell app and scans the QR code
4

Customer Confirms

Customer confirms payment in their app
5

Webhook Notification

Merchant receives payment status via webhook

Request Parameters

bizType
string
required
Business type. Use ORDER_CODE for QR order payments.
productCode
string
required
Payment product code assigned by Rebell.
codeType
string
required
QR code type. Use CGCP (Customer Generated Code Payment).
paymentRequestId
string
required
Merchant-generated unique identifier (idempotency key).Max length: 64 characters
paymentAmount
object
required
Payment amount details.
order
object
Order details including description and merchant info.
paymentNotifyUrl
string
Webhook URL for payment notifications.
extendInfo
string
Extended information as JSON string.

Response Parameters

result
object
required
Standard result object
paymentRequestId
string
Echo of the merchant’s payment request ID
paymentId
string
Rebell-assigned payment identifier
qrCode
string
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

resultStatusresultCodeDescriptionAction
SSUCCESSQR order createdDisplay QR and start polling
FPARAM_ILLEGALInvalid parametersCheck request
FREPEAT_REQ_INCONSISTENTDuplicate with different paramsUse new paymentRequestId
UUNKNOWN_EXCEPTIONUnknown errorRetry request

Inquiry Payment

Poll for payment status

QR Order Pay Guide

Complete integration guide