Advanced

Signing Billing Portal Links

We recommend using the Boathouse API to fetch a billing portal link for your logged-in user. But here we will show you how to manually create that link for a user.

Before you begin make sure:

The billing portal takes 5 parameters in the query string.

  • Parameter "c": The Paddle Customer ID.
  • Parameter "e": A UNIX timestamp value after which the link is invalid. (A maximum expiration of 1 hour is recommended.)
  • Parameter "p": The Portal ID.
  • Parameter "r": The URL to send the user when they finish using the billing portal.
  • Parameter "s": An url encoded HMAC signature hash for the first four values calculated as follows:

Create a query string of the first four values (Remember to URL encode all values):

c={customerID}&e={expiry}&p={portalID}&r={returnUrl}

Sign this string with an HMAC SHA265 hash algorithm and the portal secret from your Boathouse dashboard. See here for a list of code snippets on how to calculate a HMAC signature.

Then you can redirect your user to

https://my.boathouse.pro/portal?c={customerID}&e={expiry}&p={portalID}&r={returnUrl}&s={signature}
Previous
Help Scout Plugin