Introduction
SubscriptionManager allows you to retrieve subscription information from merchant accounts when a card is provisioned via CardSwitcher. When enabled, theCARD_UPDATED webhook will include a subscriptions array containing IDs for subscriptions detected on the merchant account.
SubscriptionManager must be enabled for your account. Reach out to the Knot team to get started.
Receive Subscription IDs
When a card is successfully updated, theCARD_UPDATED webhook will include subscription IDs in data.subscriptions:
Retrieve Full Subscription Details
For each subscription ID, call Get Subscription By ID to retrieve the full subscription object.Get ongoing updates
New subscriptions
To be notified when new subscriptions are detected on a merchant account, listen to theNEW_SUBSCRIPTIONS_AVAILABLE webhook. You will receive this event each time a new subscription is found on the merchant account.
Upon receiving the NEW_SUBSCRIPTIONS_AVAILABLE webhook, make a request to Get Subscription By ID for each ID in data.subscriptions, passing the ID received in the webhook as a path parameter.
Updated subscriptions
Receiving updated subscription information is entirely optional and may not be relevant for your use case.
UPDATED_SUBSCRIPTIONS_AVAILABLE webhook. You will receive this event for a merchant account each time there are existing subscriptions for which data has changed (e.g. a price change or status update).
Upon receiving the UPDATED_SUBSCRIPTIONS_AVAILABLE webhook, make a request to Get Subscription By ID for each ID in data.subscriptions, passing the ID received in the webhook as a path parameter.
Cancel a Subscription
Once a user has linked a merchant account to the Knot platform through CardSwitcher, they can cancel a subscription or bill associated with that merchant account. Follow the steps below to determine whether cancellation is available and to execute it.Display the subscription in your app
Call Get Merchant Accounts with the user’s In the response, check that the merchant account’s
external_user_id and merchant_id to check whether cancellation is supported for that merchant account.connection.scopes array contains an object with "type": "cancel" and that the subscription’s is_cancellable field is true. Only when both conditions are met should you display a cancel button to the user.Call the Cancel Subscription endpoint
When the user taps the cancel button, call Cancel Subscription with the subscription ID to cancel the subscription or bill within seconds. Subscribe to the
CANCELLATION_SUCCEEDED and CANCELLATION_FAILED webhooks to be notified of the outcome.Testing
To test SubscriptionManager in thedevelopment environment, first perform a card switch via CardSwitcher with one of the merchants below. The resulting CARD_UPDATED webhook will include subscription IDs that you can then use to test retrieval. The following is a subset of merchants available for testing — it is not the full list of supported merchants.
- Verizon
- T-Mobile
- Spectrum
- Xfinity Internet
- Xfinity Mobile
- Apple
- Netflix
- Disney+
- Hulu
- Spotify