Skip to main content

Generate QR Payload

Generate a QR code payload for quick payment collection. The generated payload can be converted to a QR code image that customers can scan with the FLEX mobile app to make instant payments.
The API returns a QR payload string, not an image. You’ll need to encode this payload into a QR code image using a QR code generation library.

Request Parameters

number
required
Payment amount in the specified currency (maximum: 999,999,999)
string
Unique reference for tracking this transaction (max 100 characters). Auto-generated if not provided.
string
Description or note for the payment (max 250 characters)
string
default:"NGN"
Currency code: NGN (Nigerian Naira) or FP (FLEX Points)
object
Additional custom data to store with the transaction

Request Example

Response

The API returns a QR payload string that contains encrypted payment information.

Converting Payload to QR Code

After receiving the QR payload, you need to encode it into a QR code image. Here’s how to do it in different languages:

Installation Commands


Complete Example: Web Implementation

Here’s a complete example showing how to generate and display a QR code on a web page:

Use Cases

Point of Sale

Display QR codes at checkout counters for quick payment

E-commerce

Show QR code on order confirmation page as alternative payment method

Invoices

Include QR codes in PDF invoices for instant payment

Event Ticketing

Generate unique QR codes for ticket purchases

Best Practices

Use unique references for each QR code to track individual transactions
Set appropriate amounts - QR codes are typically used for fixed amounts
Include metadata to link QR payments back to your internal systems (order IDs, SKUs, etc.)
Display payment details alongside the QR code so customers know what they’re paying for
QR code payloads don’t expire automatically. Implement your own expiration logic if needed by tracking QR generation timestamps.

Error Responses


Payment Requests

Create payment requests with customer approval

Transaction History

Track all your transactions