Create & Manage Services
How to register your service, set up subscription plans, and integrate payments.
Overview
As a service provider, you can register your service on the protocol and create subscription plans. Users subscribe and pay automatically — you receive USDC directly to your wallet every billing cycle.
Registering a Service
- Connect your wallet and go to the "Service Panel" tab
- Enter your Service Name — this is what users will see
- Enter the Payment Receiver Address — where USDC payments will be sent
- Click "Register Service" and confirm the transaction
Adding Subscription Plans
After registering, add one or more plans to your service:
- Enter your Service ID (shown after registration)
- Set the Price in USDC (e.g., 10 for 10 USDC)
- Choose the Billing Period — Daily, Weekly, Monthly, or Yearly
- Select the Payment Token (USDC)
- Click "Add Plan" and confirm
You can add multiple plans to the same service (e.g., Basic, Pro, Enterprise tiers).
Gas Sponsorship (Paymaster)
You can sponsor gas fees for your subscribers so they don't pay transaction costs:
- In the Service Panel, find the "Paymaster — Gas Sponsorship" section
- Enter the amount of LTC to deposit
- Click "Deposit to Paymaster"
Your deposit covers gas for all subscribers to your service. Monitor the balance and top up as needed.
Integrating Into Your App
You can verify subscription status on-chain to gate access to your service.
Check if a user is subscribed
const module = new ethers.Contract(
SUBSCRIPTION_MODULE_ADDRESS,
["function isActive(address,uint256) view returns (bool)"],
provider
);
// Check subscription #0 for a user
const active = await module.isActive(userAddress, 0);
if (active) {
// Grant access
}
Get subscription details
// sub.serviceId — your service ID
// sub.planId — which plan they're on
// sub.active — is it active?
// sub.paused — is it paused?
// sub.lastCharged — timestamp of last payment
Direct subscription links
Send users directly to a specific plan. They'll see a confirmation dialog and subscribe in one click:
<a href="https://your-domain.com/app.html?subscribe=1,0">
Subscribe Now
</a>
Format: app.html?subscribe={serviceId},{planId}
Embeddable widget
Add a styled subscription button to any website. Just include the widget script and a container element:
<div id="sub-widget"></div>
<script src="https://your-domain.com/widget.js"
data-service-id="1"
data-plan-id="0"
data-app-url="https://your-domain.com/app.html"
data-service-name="My Service"
data-price="10"
data-period="month"
data-theme="dark">
</script>
SubscriptionWidget.render({
target: '#sub-widget',
serviceId: 1,
planId: 0,
appUrl: 'https://your-domain.com/app.html',
theme: 'dark', // or 'light'
serviceName: 'My Service',
price: '10',
period: 'month',
buttonText: 'Subscribe with Crypto'
});
Monitoring Payments
Payments are processed on-chain. You can monitor them by:
- Watching your receiver address — USDC transfers appear as standard ERC-20 transfers
- Listening to events — The SubscriptionModule emits
PaymentProcessedevents with subscriber, amount, and token details - Querying on-chain — Use
getSubscriberCountandgetSubscriptionto enumerate all subscribers
Contract Addresses
ServiceRegistry: check app.js CONTRACTS object
SubscriptionModule: check app.js CONTRACTS object
AccountFactory: check app.js CONTRACTS object
USDC Token: check app.js TOKENS object
Best Practices
- Use a dedicated receiver address — makes accounting easier
- Fund the Paymaster — removes friction for subscribers
- Offer multiple plans — give users options (monthly vs yearly, tiers)
- Monitor your Paymaster balance — top up before it runs out
- Verify subscriptions server-side — don't trust client-only checks for access control