Manage My Subscription
Overview
With the Manage My Subscription feature you can embed a link within your app where your customers can manage their subscriptions (for example increase license counts or change plans) and manage their payments.
Integration Steps
- Gather the customer's subscription ID (referenced as chain_id within the Webhooks and APIs). This data can be captured through our Webhooks (for example the order.complete webhook), or queried using our GraphAPI.
- Build a link within your app where the customer can navigate to manage their subscription.
- When the link is clicked, your system will need to make an API call to Salesbrick's GraphQL API.
POST https://api.salesbricks.com/api/v1/graphql
-
Insert the chainId as the variable within the call above.mutation($chainId: String!) { createSubscriptionToken(chainId: $chainId) { token { id expiresAt buyer { id } } } }
The response to this call will be a token:
-
{ "data": { "createSubscriptionToken": { "token": { "id": "546c21827-8009-4f13-933d-22c8c8a9fb9a", "expiresAt": "2024-01-05T23:38:16.667405+00:00", "buyer": { "id": "997c5c51-17a5-4759-956e-bb87f7afd289" } } } } }
This token is then appended to a the following base URL to create the customer-specific subscription link:
- https://app.salesbricks.com/subscription-management/<TOKEN_ID>
- For example: https://app.salesbricks.com/subscription-management/56c21827-8009-4f13-933d-22c8c8a9fb9a
- Launch this URL in a separate tab for the best experience. Upon checkout a redirect URL can be set into your product in this area: Product > Click on your product > Details > Checkout redirect URL
Updated 15 days ago