Emberstore logoEmberstore

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.

A 30 day timed item with billing once: granted on day 0, renewal reminders 3 days and 1 day before the end, then the revoke commands run at the end. Below, billing recurring: the gateway charges each period and each renewal extends the item.

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.

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-commands run (once per unit, as when given) and the player gets purchase.item-expired, now or on their next join.
  • Reminders. On each day listed in subscriptions.renewal-reminder-days before the end, the player gets purchase.renewal-reminder with 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 another duration to the end and runs renew-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 duration fits 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 duration and runs renew-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. 30d renews 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.

On this page