Generates a secure, time-limited magic link that allows customers to access their subscription management portal. This endpoint supports lookup by either customer ID or email address, making it flexible for different integration scenarios.
Key Features:
Customer Lookup Logic:
Option 1: By Customer ID (Preferred)
GET /api/external/v2/manage-subscription-link?customerId=12345
Option 2: By Email
GET /api/external/v2/manage-subscription-link?emailId=customer@example.com
Validation Rules:
customerId OR emailId must be providedToken Generation:
Token Contents:
Security Features:
Generated URL Structure:
https://[shop-domain]/[manage-subscriptions-path]?token=[encrypted-token]
Example URLs:
https://mystore.com/tools/recurring/customer_portal?token=eyJhbGc...
https://shop.myshopify.com/tools/recurring/customer_portal?token=eyJhbGc...
Use Cases:
1. Email Campaigns:
2. Customer Support:
3. Post-Purchase Flows:
4. Account Management:
Response Format:
{
"manageSubscriptionLink": "https://mystore.com/tools/recurring/customer_portal?token=eyJhbGciOiJIUzI1NiJ9...",
"tokenExpirationTime": "2024-03-15T14:30:00Z"
}
Response Fields:
manageSubscriptionLink: Complete URL ready to usetokenExpirationTime: ISO 8601 timestamp when token expiresIntegration Examples:
Email Template:
const response = await fetch(
`/api/external/v2/manage-subscription-link?emailId=${customerEmail}`,
{ headers: { 'X-API-Key': 'your-key' } }
).then(r => r.json());
const emailHtml = `
<p>Hi ${customerName},</p>
<p>Manage your subscription:</p>
<a href="${response.manageSubscriptionLink}">Manage Subscription</a>
<p><small>Link expires ${formatDate(response.tokenExpirationTime)}</small></p>
`;
SMS Notification:
const { manageSubscriptionLink } = await getPortalLink(customerId);
const shortUrl = await shortenUrl(manageSubscriptionLink);
await sendSMS(customerPhone,
`Your subscription ships tomorrow! Manage it here: ${shortUrl}`
);
Important Considerations:
Token Expiration:
Domain Selection:
publicDomain if configuredCustomer Lookup Errors:
Security Notes:
Best Practices:
Comparison with /manage-subscription-link/:
Authentication: Requires valid X-API-Key header
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link{
"manageSubscriptionLink": "https://mystore.com/tools/recurring/customer_portal?token=eyJhbGciOiJIUzI1NiJ9.eyJjdXN0b21lcklkIjoxMjM0NSwic2hvcCI6Im15c3RvcmUubXlzaG9waWZ5LmNvbSIsInRpbWVzdGFtcCI6MTcwOTU2MjAwMH0.abc123xyz",
"tokenExpirationTime": "2024-03-15T14:30:00Z"
}Documentation Index
Fetch the complete documentation index at: https://appstleinc-aeca3e0a.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/manage-subscription-link{
"manageSubscriptionLink": "https://mystore.com/tools/recurring/customer_portal?token=eyJhbGciOiJIUzI1NiJ9.eyJjdXN0b21lcklkIjoxMjM0NSwic2hvcCI6Im15c3RvcmUubXlzaG9waWZ5LmNvbSIsInRpbWVzdGFtcCI6MTcwOTU2MjAwMH0.abc123xyz",
"tokenExpirationTime": "2024-03-15T14:30:00Z"
}