[Feature Request] Hosted Invoice PDFs
As of today (31 Dec 2025), Dodo Payments does not provide us with any option for a hosted invoice PDF. As of now we get the contents of the PDF in the response which we can then stream to the user or save it in S3 and then provide them with a view url.
It would be great if we can obtain a InvoiceUrl in the payment details itself. That way, we could paginate over payments for a given subscription without having to worry about handling invoice processing at our end.
Else right now we hav to do something like this
`// Step 1: Get all the payments details
iter := s.client.Payments.ListAutoPaging(ctx, dodopayments.PaymentListParams{
SubscriptionID: dodopayments.F(req.SubscriptionId),
})
paymentInvoices := make([]*DodoPaymentsInvoiceDetails, 0)
for iter.Next() {
p := iter.Current()
// FEATURE SUGGESTION => p.InvoiceUrl to be obtained here to skip all the rest of the processing given below
pdf, err := s.client.Invoices.Payments.Get(ctx, p.PaymentID)
if err != nil {
goLibOtelLogger.Errorf(ctx, err, "error fetching invoice pdf for payment id %s: %v", p.PaymentID, err)
paymentInvoice.ErrorFetching = true
paymentInvoice.Invoice = nil
paymentInvoices = append(paymentInvoices, paymentInvoice)
continue
}
paymentInvoice.Invoice = pdf
paymentInvoice.ErrorFetching = false
paymentInvoices = append(paymentInvoices, paymentInvoice)
}
if err := iter.Err(); err != nil {
return nil, err
}
// Step 2: Process paymentInvoices and upload to S3`I am looking forward to this feature. Please, please help implement this as soon as possible.
6 Comments
Sign in to comment
·6 months agoWe have the Invoice URL in the PaymentResponse Object:
https://docs.dodopayments.com/api-reference/payments/get-payments-1#response-invoice-url-one-of-0
As far as I can see the invoice is available on a URL like
https://live.dodopayments.com/invoices/payments/%sWhere %s is replaced with the Payment ID.
Example =>
https://live.dodopayments.com/invoices/payments/pay_0NVPPK68IbhBUVMXqZvsU
For Test Environment =>
https://test.dodopayments.com/invoices/payments/pay_0NVPUdyJRLvHCzinIsJKb
If the same URL can be returned in the payment response in the SDK, it would be great
Hence, keeping in mind the environments, the URL will start from
- Test Mode:
https://test.dodopayments.com - Live Mode:
https://live.dodopayments.com
This would be a lovely addition
Can include the url in dodopayments.PaymentListResponse
·6 months ago
@Ayush Agarwal As requested in the feature, please update the respective SDKs, too.
As I can check right now,
dodopayments.PaymentListResponsedoes not have any invoice url present in it. (SDK => github.com/dodopayments/dodopayments-go v1.73.0)Along with the APIs, please help with SDK updates too.
We added in the PaymentResponse - we will also add in the Payment List Response too.