CreateSubscriptionService
Creates a new subscription service with one or more plans. Each plan defines a pricing tier with a duration and amount.
Request
POST /nxt?requestType=createSubscriptionService
All endpoints use port 22024 by default.
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
name | string | Service name | Yes |
description | string | Service description | Yes |
holdingId | string | Holding ID for payment currency | Yes |
holdingType | byte | Holding type (0-3) | Yes |
plans | string | JSON array of plan objects | Yes |
secretPhrase | string | Service owner's secret passphrase | Yes |
Plan Object Format
Each plan in the plans array must contain:
| Field | Type | Description |
|---|---|---|
plan | string | Plan name |
description | string | Plan description |
duration | int | Duration in days |
amountQNT | string | Amount in QNT |
metadata | object | Optional key-value pairs |
Response
{
"transaction": "1234567890123456789",
"fullHash": "abc123def456...",
"errorCode": 0,
"errorDescription": ""
}
Example
curl -X POST "http://localhost:22024/nxt?requestType=createSubscriptionService" \
-d "name=Premium Service" \
-d "description=Premium subscription" \
-d "holdingId=1234567890123456789" \
-d "holdingType=1" \
-d "plans=[{\"plan\":\"Basic\",\"description\":\"Basic plan\",\"duration\":30,\"amountQNT\":\"100000000\"},{\"plan\":\"Pro\",\"description\":\"Pro plan\",\"duration\":30,\"amountQNT\":\"500000000\"}]" \
-d "secretPhrase=your_secret_passphrase"