Subscription Flow
This guide provides a structured process for managing subscriptions via the API.
Subscription Statuses
Status | Description |
---|---|
INIT | Subscription started but not yet paid. No access granted. |
ACTIVE | Subscription is active, successfully paid, and access granted. Monthly payments occur. |
DEACTIVATING | User has canceled the subscription, but it remains active until the next billing cycle. |
CANCELLED | Subscription is fully canceled, and access is revoked. |
1. Get Available Subscriptions
Endpoint:
GET reg/subscription/details/available
Retrieves a list of available subscription plans that a user can subscribe to.
Response Example:
{
"amount": 0,
"currency": "string",
"description": "string",
"details": {},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"initialPaymentAmount": 0,
"level": 0,
"mostPopular": true,
"name": "string",
"subscriptionInterval": "DAYS30",
"trialAvailable": true
}
2. Start Subscription
Endpoint:
POST reg/subscription
Starts a new subscription for a user and returns an invoice response containing a payment link.
Body Parameters:
Name | Type | Required | Description |
---|---|---|---|
accountId | string | Internal account used for payment. | |
anyCurrency | boolean | ✅ | Indicates whether the subscription can be paid in any currency. |
subscriptionDetailsId | string | Unique identifier of the subscription details form. |
Response Example:
{
"accountId": "string",
"anyCurrency": true,
"subscriptionDetailsId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
3. Initialize Payment
Endpoint:
POST /invoice/payment
Initializes the payment for the subscription.
Body Parameters:
Name | Type | Required | Description |
---|---|---|---|
invoiceId | string | ✅ | Identifier of the invoice from Step 2. |
type | string | ✅ | Payment provider type (e.g., PLATFORM , CHECKOUT ). |
accountId | string | ✅ | Identifier of the account from the wallet service. |
currency | string | ✅ | Currency used for the payment. |
anyCurrency | boolean | ✅ | Flag indicating whether multiple currencies are supported. |
Headers:
referer
: Required with any value.
Response Example:
{
"id": "string",
"invoiceId": "string",
"status": "INIT",
"type": "string",
"amount": 0,
"description": "string",
"statusDescription": "string",
"last_modified_date": "2025-02-11T13:20:00.212Z",
"created_date": "2025-02-11T13:20:00.212Z",
"session": {}
}
4. Confirm Invoice Payment
Endpoint:
POST payment/pay
Confirms the payment for an invoice.
Body Parameters:
Name | Type | Required | Description |
---|---|---|---|
invoiceId | string | ✅ | Identifier of the invoice from Step 2. |
type | string | ✅ | Payment provider type (e.g., PLATFORM , CHECKOUT ). |
paymentId | string | ✅ | Unique identifier for the payment from Step 3. |
accountId | string | ✅ | Internal account ID of the user making the payment. |
currency | string | ✅ | Currency used for the payment. |
anyCurrency | boolean | ✅ | Flag indicating whether multiple currencies are supported. |
Updated about 10 hours ago