Day 6: Embed IRBM QR Code in Invoice PDF Using UUID #irbqrcode

After your invoice is submitted and accepted by IRBM, you can retrieve a QR code using the UUID. This QR code should be embedded in your invoice PDF for customer verification and audit purposes.

โœ… API Endpoint:

GET /api/v1.0/invoices/qr-code/{uuid}

โœ… Example Laravel Request:


$response = Http::withToken($token)
    ->get("https://preprod-api.myinvois.hasil.gov.my/api/v1.0/invoices/qr-code/{$invoice->irb_uuid}");

if ($response->successful()) {
    $qrBase64 = $response->json()['qrCodeImageBase64'] ?? null;

    if ($qrBase64) {
        Storage::disk('public')->put("qr_codes/{$invoice->id}.png", base64_decode($qrBase64));
        $invoice->update(['irb_qr_path' => "qr_codes/{$invoice->id}.png"]);
    }
}

โœ… Blade View for PDF (example):


@if($invoice->irb_qr_path)
    <img src="{{ storage_path('app/public/' . $invoice->irb_qr_path) }}" width="120">
@endif

๐Ÿ’ก Benefits:

  • โœ… Complies with IRBM invoice presentation guidelines
  • โœ… Verifiable by customers and authorities
  • โœ… Gives your invoice a professional, compliant look

Coming up in Day 7:

Weโ€™ll version and archive each submitted invoice XML as a digital record for long-term compliance.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.