How Refunds Work
Vowena supports on-chain refunds initiated by the merchant. When a merchant issues a refund, they are transferring their own funds back to the subscriber. The contract never holds funds - refunds are a direct merchant-to-subscriber transfer recorded on-chain.Refunds in Vowena are voluntary. The protocol does not force refunds on cancellation. Merchants decide when and how much to refund based on their own policies. The protocol provides the mechanism and the verifiable receipt.
Refund Flow
Merchant calls refund
The merchant calls
refund(sub_id, amount) with the subscription ID and the amount to refund.Authorization
The contract calls
merchant.require_auth() - confirming the caller is the plan’s merchant. Only the merchant who owns the plan can issue refunds for subscriptions on that plan.Token transfer
The contract calls
token.transfer(merchant, subscriber, amount). This is a direct transfer from the merchant’s wallet to the subscriber’s wallet. The contract acts as the executor but never holds the tokens.Partial Refunds
Refunds support any amount - there is no requirement to refund the full billing amount. Common scenarios:| Scenario | Refund Amount | Example |
|---|---|---|
| Full period refund | plan.amount | Subscriber cancels mid-cycle, merchant refunds the last charge |
| Partial refund | Any i128 > 0 | Pro-rated refund for unused days in a billing period |
| Goodwill credit | Any i128 > 0 | Merchant issues a credit for service disruption |
| Multi-period refund | plan.amount * N | Merchant refunds multiple past periods |
Code Examples
Verifiable Receipts
Every refund emits aRefundIssued event that serves as a permanent, publicly verifiable receipt:
For subscribers
The refund is visible in their wallet’s transaction history and can be independently verified by querying the Stellar ledger. No “refund pending” ambiguity.
For merchants
The on-chain event serves as an immutable accounting record. Integrate with the SDK event listener to sync refunds to your accounting system.
Key Properties
Refunds do not affect subscription status
Refunds do not affect subscription status
Issuing a refund does not cancel, pause, or otherwise change the subscription. The subscription continues in whatever state it was in. If the merchant wants to cancel after refunding, they should instruct the subscriber to call
cancel().Refunds are not reversible
Refunds are not reversible
Once the token transfer executes, it is final. There is no “undo refund” function. This is a direct on-chain transfer with immediate settlement.
Multiple refunds per subscription
Multiple refunds per subscription
A merchant can issue multiple refunds for the same subscription. Each one is a separate transaction with its own event. There is no lifetime refund cap enforced by the contract.
What’s Next
Security
Understand the full security model and consumer protection guarantees.
Billing
See how charges work and why the pre-check mechanism matters.