Customers
Generate customer portal link
Generates a secure, time-limited link that allows customers to access their subscription management portal. This link provides customers with self-service capabilities to manage their subscriptions without requiring login credentials.
Key Features:
- Generates unique encrypted token for customer authentication
- Token expires after 2 hours for security
- Direct access to subscription management without password
- Uses store’s custom domain when available
- Supports white-label customer portals
Token Security:
- Token contains encrypted customer ID, shop, and timestamp
- Cannot be reused after expiration
- Unique token generated for each request
- Cryptographically secure encryption
Customer Portal Access: Once customers click the link, they can:
- View all active subscriptions
- Update payment methods
- Change delivery addresses
- Modify product quantities
- Pause or cancel subscriptions
- Update delivery schedules
- Apply discount codes
- View order history
Use Cases:
- Email campaigns with ‘Manage Subscription’ CTAs
- Customer service providing quick access
- Post-purchase email flows
- Account management integrations
- Reducing support ticket volume
URL Structure:
The generated URL follows this pattern:
https://[store-domain]/[manage-subscription-path]?token=[encrypted-token]
Important Notes:
- Links are single-use and expire after 2 hours
- New link must be generated after expiration
- Customer ID must be valid and active
- Store must have customer portal configured
Authentication: Requires valid X-API-Key header
GET
/
api
/
external
/
v2
/
manage-subscription-link
/
{customerId}
Generate customer portal link
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId} \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId}"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId}';
const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"customerId": 987654321,
"expiresInMinutes": 120,
"manageSubscriptionLink": "https://store.example.com/pages/manage-subscriptions?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaG9wIjoic3RvcmUuZXhhbXBsZS5jb20iLCJjdXN0b21lcklkIjo5ODc2NTQzMjEsImNyZWF0ZWRBdCI6MTcxMDUxMjQwMDAwMH0.dGhpcyBpcyBhIHNhbXBsZSB0b2tlbiBmb3IgZG9jdW1lbnRhdGlvbg",
"portalUrl": "https://store.example.com/pages/manage-subscriptions",
"tokenExpirationTime": "2024-03-15T16:30:00.000Z"
}Headers
API Key for authentication
Path Parameters
Customer ID to generate portal link for. Provide the numeric ID without the gid:// prefix
Required range:
x >= 1Query Parameters
API Key (Deprecated - Use X-API-Key header instead)
⌘I
Generate customer portal link
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId} \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId}"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId}';
const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link/{customerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"customerId": 987654321,
"expiresInMinutes": 120,
"manageSubscriptionLink": "https://store.example.com/pages/manage-subscriptions?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaG9wIjoic3RvcmUuZXhhbXBsZS5jb20iLCJjdXN0b21lcklkIjo5ODc2NTQzMjEsImNyZWF0ZWRBdCI6MTcxMDUxMjQwMDAwMH0.dGhpcyBpcyBhIHNhbXBsZSB0b2tlbiBmb3IgZG9jdW1lbnRhdGlvbg",
"portalUrl": "https://store.example.com/pages/manage-subscriptions",
"tokenExpirationTime": "2024-03-15T16:30:00.000Z"
}