Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Abhishek_patel's avatar

How to get Razorpay paid invoice PDF or URL after successful payment in Laravel?

I'm using Razorpay in my Laravel application to handle donation payments. The payment process is working fine, but now I want to automatically get the paid invoice PDF or URL after a successful payment and show it to the user (or send it via email).

Here's what I want to achieve:

  • After successful payment via Razorpay, fetch the invoice (PDF or link).
  • Display or share this invoice with the user.

Has anyone implemented this in Laravel? What’s the correct way to retrieve the paid invoice from Razorpay after payment confirmation?

I'm using the Razorpay PHP SDK and this is how I'm currently creating the order and verifying payment:

use Razorpay\Api\Api;
$api = new Api(env('RAZORPAY_KEY'), env('RAZORPAY_SECRET'));
// Payment verification logic here...

Should I generate the invoice manually via the Razorpay API, or is it done automatically for donations?

Any advice, example code, or links to Razorpay documentation would be appreciated.

Thanks!

0 likes
1 reply

Please or to participate in this conversation.