Build a Recharge-hosted customer portal

Create a custom Recharge-hosted customer portal and give customers complete control over their subscriptions.

Build a custom Recharge-hosted portal and give customers the tools they need to manage their subscriptions. The Recharge-hosted portal is the easiest and fastest way to integrate a customer portal experience through Recharge.

📘

Platform

  • Custom

Overview

Redirect customers to an existing page using minimal API calls while ensuring the existing infrastructure performs the technical heavy lifting to manage customers' subscriptions.

Building a Recharge-hosted customer portal requires two steps:

  1. Make a middleware call to the Recharge Customers API to fetch the customer's hash value. The hash value acts as an authenticator to authorize the customer to access the relevant customer portal. After retrieving the customer's hash value, create a URL that redirects the customer to the Recharge customer portal.
  2. Insert a Manage Subscriptions link on the My Account page (or an equivalent page depending on the platform) that navigates customers to the Recharge portal.

Step 1 - Fetch the customer hash

Using middleware, retrieve the customer hash when the customer navigates to the My Account page. Only the customer ID is required to retrieve this information. The redirect URL uses a hash property, found in the API call response.

import requests

headers = {"X-Recharge-Access-Token": "your_api_token"}
url = "https://api.rechargeapps.com/customers/18819267"

result = requests.get(url, headers=headers)

See Retrieve a customer in the Recharge API Reference Guide for additional information.


Step 2 - Add the Manage Subscriptions link to the My Account page

Customers use the Manage Subscriptions link in their Shopify customer account to manage their subscriptions and their personal information.

Use the Recharge JavaScript SDK to generate the Manage Subscriptions link on the My Account page. The URL requires a temp_token value, which you can only retrieve via API.

For more details, see Customer Portal Link in the Recharge JavaScript SDK documentation.


Need Help? Contact Us