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

  1. 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.
  2. Build a link within your app where the customer can navigate to manage their subscription.
  3. 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

  1. mutation($chainId: String!) {
            createSubscriptionToken(chainId: $chainId) {
                token {
                    id
                    expiresAt
                    buyer {
                        id
                    }
                }
            }
        }
    
    Insert the chainId as the variable within the call above.

The response to this call will be a token:

  1. {
      "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:

  1. https://app.salesbricks.com/subscription-management/<TOKEN_ID>
  2. For example: https://app.salesbricks.com/subscription-management/56c21827-8009-4f13-933d-22c8c8a9fb9a
  3. 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