Skip to content

The Raw Payload

Sometimes you don't want an image. You want the string that goes inside the image, so something else can draw it.

php
$payload = RaastQr::make()->amount('2500')->toPayload();
// 0002020102120202000424PK33ABCD000000000000000005042500...

Or without a builder:

php
RaastQr::payload([
    'iban' => 'PK33ABCD0000000000000000',
    'amount' => '2500',
    'expiry' => '2026-12-31',
]);

When You'd Want This

Thermal receipt printers. Most support a native QR command and want the data, not a bitmap:

php
$printer->qrCode(RaastQr::make()->amount($sale->total)->toPayload());

JavaScript front ends. Send the payload down and let the browser render it, which keeps the image generation off your server entirely:

php
return response()->json([
    'payload' => RaastQr::make()->amount($order->total)->toPayload(),
]);

PDF libraries that already have a QR renderer built in.

A different PHP QR library. Though if that's the reason, a custom renderer is tidier — you keep the whole fluent API and just swap the drawing.

What's in It

The payload is a tag-length-value string:

0002 02                    format version
0102 12                    dynamic (11 when static)
0202 00                    payload type
0424 PK33ABCD0000...       the destination account
0504 2500                  amount, when present
0712 311220262359          expiry as DDMMYYYYHHMM, when present
1004 A1B2                  CRC-16 checksum

See Payload Format for the full breakdown.

Inspecting from the Terminal

bash
php artisan raast-qr:generate PK33ABCD0000000000000000 --amount=2500 --payload

Handy when a banking app is refusing a code and you want to see exactly what it's reading.

The Payload Is Not a Secret

It contains an account number, an amount and an expiry. That's it — no credentials, no token, nothing that lets anyone take money.

It's not sensitive in the way an API key is. It is personal data, so don't log it into a shared observability tool without thinking about it.


Made with ❤️ from Pakistan