Methods
| Method | Description |
|---|---|
create(plan) | Create a new plan |
publish(id) | Publish a draft plan |
details(id) | Get plan details |
list(params?) | List plans with pagination |
update(id, plan) | Update a plan |
delete(id) | Delete a plan |
Create a plan
Publish a plan
Plans start as drafts. Publish them to make them available:Get plan details
List plans
Thelist() method supports filtering by active (boolean) and expired (boolean) query params:
Update a plan
Delete a plan
Plan request fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Plan name |
description | string | Yes | Plan description |
frequency | number | Yes | Billing frequency in days |
price | number | Yes | Price in smallest currency unit |
currency | string | Yes | Currency code (e.g., "USD") |
start_date | string | Yes | Start date in YYYY-MM-DD format |
end_date | string | No | Optional end date |
is_auto_renewable | boolean | Yes | Whether the plan auto-renews |
allow_amount_override | boolean | Yes | Whether subscribers can override the amount |
created_by | string | Yes | Creator identifier |
Plan details (response)
| Field | Type | Description |
|---|---|---|
hash_id | string | Plan ID |
name | string | Plan name |
description | string | Plan description |
frequency | number | Billing frequency in days |
price | number | Price |
overridden_price | number | Overridden price (if set by a campaign) |
campaign_id | string | Associated campaign ID |
campaign_name | string | Associated campaign name |
is_active | boolean | Whether the plan is active |
is_auto_renewable | boolean | Whether it auto-renews |
currency | string | Currency code |
start_time | string | ISO datetime |
end_time | string | ISO datetime |
created_at | string | ISO datetime |
updated_at | string | ISO datetime |