Subscription Flow
Subscriptions are an integral part of modern business models, offering flexibility and recurring value to users. This guide outlines the step-by-step process for retrieving available subscriptions, starting a subscription, and completing the payment process to activate it. By following these instructions, you can seamlessly integrate subscription management into your system.
Step 1: Retrieve Available Subscriptions
To retrieve the list of available subscriptions, use the following endpoint:
API Endpoint: Get Subscriptions Info
Response Example:
[
{
"id": "3930d928-48c5-44c4-b720-ec47a6ac0fec",
"name": "Tier 3",
"description": "Tier 1 Description",
"amount": 3,
"originalAmount": 3,
"initialPaymentAmount": 12,
"originalInitialPaymentAmount": 12,
"trialAvailable": false,
"currency": "USDT",
"subscriptionInterval": "DAYS30"
},
{
"id": "f3635093-b1cc-4c98-8677-2c12ef3d5542",
"name": "Tier 1",
"description": "Tier 1 Description",
"amount": 1,
"originalAmount": 1,
"initialPaymentAmount": 10,
"originalInitialPaymentAmount": 10,
"trialAvailable": false,
"currency": "USDT",
"subscriptionInterval": "DAYS30"
},
{
"id": "7dd39e5a-e117-46e1-882d-afb44cbe08eb",
"name": "Tier 2",
"description": "<p style=\"color: red\">Tier 2 Description</p><br>\n<ul><li>sss</li><li>dddd</li></ul>",
"amount": 2,
"originalAmount": 2,
"initialPaymentAmount": 11,
"originalInitialPaymentAmount": 11,
"trialAvailable": false,
"currency": "USDT",
"subscriptionInterval": "DAYS30"
}
]
Step 2: Start a Subscription
Once the user selects a subscription, start the subscription by providing the account ID and subscription details ID.
API Endpoint: Start Subscription
Required Parameters:
accountId
(string): The ID of the account from which the subscription will be paid.subscriptionDetailsId
(string): The ID of the selected subscription.
Step 3: Create an Invoice Payment
After starting the subscription, you will receive an invoiceId
. Use this ID to create an invoice payment through the following endpoint:
API Endpoint: Payment Get or Create
Payment Method: PLATFORM
Step 4: Complete the Payment
Finally, complete the payment using the following endpoint:
API Endpoint: Pay Invoice
Once the payment is successful, the subscription will be activated.
Updated 9 days ago