Timed items and subscriptions
Sell items that last a set time, remind players before they end, and bill real subscriptions on gateways that support them.
Give an item a duration and it is timed: the reward is given on payment and taken back when the time is up. billing decides how it renews. once works on every gateway and reminds the player to renew. recurring creates a real subscription that the gateway charges every period.
Setting it up
vip:
price: 4.99
# Optional time the reward lasts, like 30d, 12h or 90m. Omit for permanent
duration: 30d
# Billing for a timed item: once or recurring
billing: once
reward:
type: command
commands:
- "lp user %player% parent add vip"
# Optional commands run when the reward is taken back (refund, dispute or the end of a timed item)
revoke-commands:
- "lp user %player% parent remove vip"
# Optional commands run each time a recurring payment renews
renew-commands: []duration is a number and a unit: m minutes, h hours, d days, w weeks. For example 90m, 12h, 30d, 2w.
Always give a timed item revoke-commands. Without them nothing can be taken back when the time is up, and the console warns about it when the file loads.
billing: once
The player pays once for one period. Works on every gateway.
- The end. Every minute Emberstore checks for items whose time is up. The
revoke-commandsrun (once per unit, as when given) and the player getspurchase.item-expired, now or on their next join. - Reminders. On each day listed in
subscriptions.renewal-reminder-daysbefore the end, the player getspurchase.renewal-reminderwith a clickable link to/store subscriptions. A reminder missed while offline is sent on join, and each one only once. - Renewing.
/store subscriptions renew <id>(or the green [Renew] in/store subscriptions) starts a normal checkout for the same item. Paid while the item is still running, it adds anotherdurationto the end and runsrenew-commands, not the grant commands. Paid after it ended, it is a new purchase and the grant commands run again. - Buying the same timed item again while it runs also extends it.
subscriptions:
# Days before a timed item ends when the player is reminded to renew
renewal-reminder-days: [3, 1]billing: recurring
A real subscription at the gateway. The gateway charges the player every period and Emberstore extends the item each time.
- Only offered through gateways that support it: Stripe, PayPal, Razorpay, Creem and Dodo Payments, and only when the
durationfits that gateway (whole days, with limits per gateway listed on each gateway page). Hours and minutes never fit. If no enabled gateway can bill an item, the console says so and the item cannot be bought. - The first payment gives the reward. Every renewal adds
durationand runsrenew-commands. /store subscriptions cancel <id>(or the red [Cancel]) cancels at the gateway. The item keeps working until its paid time ends, then ends like any other. A cancellation made at the gateway works the same way.- If a renewal payment never arrives, the paid time runs out and the item ends.
- Periods are exact lengths.
30drenews every 30 days, not on the same date each month.
/store subscriptions
Lists the player's subscriptions and timed items from the last 30 days, with the end date and state (Active, Not renewing, Ended, Payment failed). Items gifted to the player show who they are from. The renew and cancel controls only show for items the player bought themselves.
Refunds and timed items
A refund or chargeback on any payment of a timed item takes the reward back straight away and ends the subscription. If the item had already ended, nothing is taken back a second time. See Refunds.
Ending items on time is done by the server with webhook.enabled: true. On a single server leave it on. See Networks.
Stock, limits, quantity, gifts and bundles
Limit how many of an item can ever be sold or bought per player, let players buy several at once, gift items and sell bundles.
Refunds and take-backs
Refund orders from in game, and have rewards taken back by themselves on refunds, chargebacks and the end of timed items.