App subscription API (Deprecated)
Use the subscription API to create an app subscription
Apps in inTandem requires a subscription for working for the business. To get a subscription, the business needs to purchase the app via inTandem's app market or the partner's own market.
When purchasing via inTandem's market, the flow guarantees the creation of a subscription when completing the purchase flow. When redirecting the user to the partner's market, its up to the partner to make sure to create, and expire the subscription when applicable.
Step by step process:
Get the app
- Get the app - The flow begins when the user finds the app, mainly via an integration point, and clicks on get the app CTA.
- App info page - The CTA redirects the user to the appropriate app market, either inTandem's app info page, or the configured partner's URL.
- Purchase flow - When the user decides to purchase the app, the app market takes the user through the different steps of the purchase flow, those usually include a checkout form, getting the user's confirmation and completing the billing and payments.
- Create app subscription - When the purchase flow ends successfully, a subscription is required to grant the app to the business. To create a subscription use the Create Subscription API. An example of such a call:
curl --location 'https://api.vcita.biz/business/subscriptionsmng/v1/subscriptions' \ --header 'Authorization: Bearer {user token}' \ --header 'Content-Type: application/json' \ --data '{ "subscription": { "purchase_params": { "item_uid": "appadvancecampaigneditor", "item_type": "app", "currency": "USD", "recurrence": "free" } } }'
Parameters:
- item_uid - The app's unique code
- item_type - The type of the underlying product. Use app to indicate that the subscription is for an app
- currency - One of the currencies inTandem supports USD; GBP; EUR
- recurrence - Use free as the business is charged outside of inTandem.
- Install the app - In case the app is not already installed, the partner needs to call the Install app API to add the app to the business. An example of install app call:
curl --location --request POST 'https://api.vcita.biz/platform/v1/apps/{app id}/install_app' \
--header 'Authorization: Bearer {user token}' \
Parameters
- app_id - The unique app id. Use the same as the item_uid in the Create Subscription API call.
- Access the app - The business can now access the app and start using it. While doing so, the app itself needs to check the existence of an active subscription using List Subscription API, checking there is an active (is_active=true) subscription for the relevant app.
Remove the app
There are cases when the business no longer wishes to use the app. In this case, the app should be uninstalled, and the subscription needs to be expired.
- Expire the subscription - When the day comes, call the Update Subscription API to set the cancellation and expiration dates. An example of an Update subscription API call:
curl --location --request PUT 'https://api.vcita.biz/business/subscriptionsmng/v1/subscriptions/{sub scription id}' \ --header 'Authorization: Bearer {user token}' \ --header 'Content-Type: application/json' \ --data '{ "subscription": { "purchase_state": "expired" } }'
Parameters
- Subscription id - The unique identifier of the app's subscription
- purchase_state -Call with expired to inactivate the subscription
- Uninstall the app - Remove the app from the business's product by calling the Uninstall App API. An example of uninstall app API call:
curl --location --request POST 'https://api.vcita.biz/platform/v1/apps/{app id}/uninstall_app' \ --header 'Authorization: Bearer {user token}' \
Parameters
- app_id - The unique app id. Use the same as the item_uid in the Create Subscription API call.
This flow ensures a smooth and transparent process for managing the app's subscription lifecycle even when purchasing it from the partners instead of from inTandem.
Updated 30 days ago