Write
Subs sdk write methods
Create Plan
Initialize Subs Client
Payment Configuration
Payment Plans Setup
Execute Creation
Returns App Url
Payment Struct
1. name
name
Type:
string
Description: Unique identifier for the payment plan (e.g.,
Student
,Premium
).Rules:
Must be unique across all your payment plans.
2. owner
owner
Type:
string
(Stellar public key)Description: Revenue beneficiary address.
Default: Use your
creatorAddress
(if not specified).Revenue Sharing:
If
owner ≠ creatorAddress
, fees are split:owner
earnsfee%
creatorAddress
earns100% - fee%
.
3. fee
fee
Type:
BigInt
(basis points: 10 = 1%)Description: Revenue share for
owner
(only ifowner ≠ creatorAddress
).Example:
4. payment_type
payment_type
Type:
PaymentType
Options:
Future: May support NFTs or other assets via
values
.
5. payment_tokens
payment_tokens
Type:
Array<Token>
Structure:
Rules:
If the
first_amount
is set to 0 no change.But you can customize the First payment more or less then the
price
Use valid Stellar Token Address otherwise the payment won't work.
Example:
6. period_type
period_type
Type:
PeriodType
Options:
Example:
7. trial_period
trial_period
Type:
BigInt
Description: Free trial duration (units depend on
period_type
):DAYS
,WEEK
,MONTH
,YEAR
→ Trial in days.HOURS
→ Trial in hours.MINUTES
→ Trial in minutes.
Example:
8. limit_period
limit_period
Type:
BigInt
Description: Number of billing cycles users must commit to.
Example:
9. loading_time
loading_time
Type:
BigInt
Description: Grace period (in days) for late payments before subscription deactivation.
Example:
Last updated