Subscription Invoice PDF

Getting an Invoice

The Klub plugin has a klub/invoice-route that allows you to retrieve the most current URL to the invoice PDF.

You could utilize this to show a link to that PDF at your member's account next to the information about their subscription.

site/snippets/stripe-invoice.php
<?php
$subscriptionID = klub()->subscriptions()->subscriptions()[0]['id'];
?>
<!-- form with POST to prevent browser URL preloading -->
<form action="<?= site()->url() ?>/klub/invoice/<?= $subscriptionID ?>" 
      method="POST">
    <input type="hidden" name="token" value="<?= csrf() ?>">
    <button type="submit">Download Invoice</button>
</form>
Kirby Klub is not affiliated with the developers of Kirby CMS. We are merely standing on the shoulder of giants.
© 2025 Bruno Meilick All rights reserved.