Raast QR
import { createRaastP2PQr, createMerchantQr, parseRaastQr, validateRaastQr } from 'pakdatakit/raast'
Builds and reads payment QR payloads following the State Bank of Pakistan’s QR standard (Circular Letter No. 1 of 2022). Turn the returned string into an image with any QR library.
- Bank
- —
- Amount
- —
0002020102110202000424PK36SCBL000000112345670210045772
Example
Section titled “Example”import { createRaastP2PQr } from 'pakdatakit';
createRaastP2PQr({ iban: 'PK36SCBL0000001123456702', amount: 1500, expiresIn: '1d', now: new Date(2026, 10, 18, 10, 0) });// → '0002020102120202000424PK36SCBL00000011234567020504150007121911202610001004CD46'from datetime import datetimefrom pakdatakit import create_raast_p2p_qr
create_raast_p2p_qr(iban='PK36SCBL0000001123456702', amount=1500, expires_in='1d', now=datetime(2026, 11, 18, 10, 0))# → '0002020102120202000424PK36SCBL00000011234567020504150007121911202610001004CD46'import 'package:pakdatakit/pakdatakit.dart';
createRaastP2PQr(iban: 'PK36SCBL0000001123456702', amount: 1500, expiresIn: '1d', now: DateTime(2026, 11, 18, 10, 0));// → '0002020102120202000424PK36SCBL00000011234567020504150007121911202610001004CD46'using PakDataKit;
RaastQr.CreateP2P(new RaastP2POptions { Iban = "PK36SCBL0000001123456702", Amount = 1500, ExpiresIn = "1d", Now = new DateTime(2026, 11, 18, 10, 0, 0) });// → "0002020102120202000424PK36SCBL00000011234567020504150007121911202610001004CD46"use PakDataKit\RaastQr;
RaastQr::createP2P(['iban' => 'PK36SCBL0000001123456702', 'amount' => 1500, 'expiresIn' => '1d', 'now' => new DateTimeImmutable('2026-11-18 10:00:00')]);// → '0002020102120202000424PK36SCBL00000011234567020504150007121911202610001004CD46'Reference
Section titled “Reference”createRaastP2PQr()
Section titled “createRaastP2PQr()”function createRaastP2PQr(options: { iban: string; amount?: number; expiresAt?: Date; expiresIn?: string | number; // e.g. '1d', '2h', or milliseconds bankName?: string; particulars?: string;}): string;Returns the QR payload text.
Caveats. Person-to-person QR codes use scheme 00: banking apps reject the 30 in SBP’s document. A QR with an amount needs expiresAt or expiresIn. Test-scan with your bank’s app before using a QR for payments.
parseRaastQr()
Section titled “parseRaastQr()”function parseRaastQr(payload: string): ParsedRaastQr | null;Returns the decoded fields (IBAN, bank, amount, expiry), or null when the text is not a Raast QR.
validateRaastQr()
Section titled “validateRaastQr()”function validateRaastQr(payload: string, now?: Date): RaastQrValidation;Returns whether a scanned QR is safe to pay: the CRC, IBAN checksum, amount and expiry, with readable problems.
Related: IBAN and banks, createMerchantQr().