Skip to main content
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

X-API-Key
string
required

API Key for authentication

Path Parameters

customerId
integer<int64>
required

Customer ID to generate portal link for. Provide the numeric ID without the gid:// prefix

Required range: x >= 1

Query Parameters

api_key
string

API Key (Deprecated - Use X-API-Key header instead)

Response

Manage subscription link successfully generated

tokenExpirationTime
string<date-time>