Day 5: Check IRBM Invoice Status via UUID and Update Locally #irbstatus

After submitting your invoice, you may want to check its status from IRBM’s backend — especially for pending or delayed responses. The IRBM API lets you query invoice status using the UUID.

✅ API Endpoint:

GET /api/v1.0/invoices/status/{uuid}

✅ Example Request (Laravel):


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

if ($response->successful()) {
    $invoice->update([
        'irb_status' => $response['invoiceStatus'] ?? 'UNKNOWN',
        'irb_status_checked_at' => now(),
    ]);
} else {
    Log::warning('IRB status check failed', [
        'uuid' => $invoice->irb_uuid,
        'code' => $response->status(),
        'body' => $response->body(),
    ]);
}

✅ Recommended Columns:

  • irb_status
  • irb_status_checked_at

💡 Use cases:

  • Auto-update invoice status for dashboard reporting
  • Reconcile statuses if API submission failed to return properly
  • Enable users to manually “Recheck Status” on UI

Coming up in Day 6:

We’ll auto-embed the IRBM QR code into your invoice PDFs using the UUID.

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.