# 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 Endpoint: GET /api/external/v2/manage-subscription-link/{customerId} Version: 0.0.1 ## Header parameters: - `X-API-Key` (string, required) API Key for authentication Example: "sk_live_1234567890abcdef" ## Path parameters: - `customerId` (integer, required) Customer ID to generate portal link for. Provide the numeric ID without the gid:// prefix Example: 987654321 ## Query parameters: - `api_key` (string) API Key (Deprecated - Use X-API-Key header instead) ## Response 200 fields (application/json): - `manageSubscriptionLink` (string) - `tokenExpirationTime` (string) ## Response 400 fields ## Response 401 fields ## Response 403 fields ## Response 404 fields ## Response 500 fields