Skip to main content
Creates a new billing plan on-chain. The plan defines the terms of recurring payments - token, amount, billing period, trial length, and price protection ceiling. Returns the auto-incremented plan_id.

Parameters


Authorization

The merchant address must sign the transaction.

Return value

u64 - the newly created plan ID.

Events emitted


Error cases


Examples

Stellar tokens use 7 decimal places. The SDK’s toStroops() helper converts human-readable amounts:
When using the CLI, pass the raw stroop value directly.
Set price_ceiling thoughtfully. It protects subscribers from unexpected price hikes - the merchant can call update_plan_amount to raise the price, but never above the ceiling. If you need to exceed the ceiling, create a new plan and use the migration flow.