PayRamHost hosted onboarding is paused · Guides keep updatingGet notified when it reopens →

Docs / Subscription billing

How to bill subscriptions in crypto: renewal invoices and prepaid credit

A crypto payment is started by the customer and cannot be charged automatically. A subscription has to be either “invoice before renewal, extend on receipt” or “prepaid balance deducted by usage”.

Last updated · By the PayRamHost editors · Markdown version

PayRamHost hosted merchant onboarding has been paused since 29 November 2026. Where this guide mentions PayRamHost, it describes the situation before the pause; the PayRam usage it explains still applies.

The short version: PayRam natively supports one-off payments and invoices and does not include a subscription feature (the official FAQ says subscriptions must be implemented at the application layer, or with custom scripts using the APIs). A crypto payment is always started by the customer, and a merchant cannot pull funds from a customer’s wallet, so the practical approach is “a new invoice every billing period”: before the renewal date, create a payment, send the customer the payment link, and extend the subscription once the webhook confirms receipt. The alternative is “prepaid credit”: give the customer a fixed deposit address and keep the balance in your own system, deducting from it each month.

1. Why you cannot charge automatically

Card subscriptions renew automatically because the customer authorises the merchant to “pull” funds. PayRam works by “push”: each time, the customer opens the payment page (or scans a code) and sends a transfer from their own wallet. The official FAQ says PayRam natively supports one-off payments and invoices, that subscriptions are not a default feature, and that they would have to be implemented at the application layer or with custom scripting through the available APIs.

That means your “subscription” is really: remind the customer before it expires, and the customer pays again. That is not a defect, but it must be clear in your product design and your terms. Do not let customers think it renews automatically.

2. Approach one: an invoice for every period

This is the most direct approach, and your own system drives the whole flow:

  1. Create a subscription record. In your database, record the customer, the plan, the price in US dollars, the period length and the renewal date.
  2. Create a payment before the renewal date. A few days ahead, use the create-payment endpoint to create a payment for this period. Set invoiceID to a value that is unique per subscription and period (for example sub-123-2026-12) and use expire to set the link’s validity to the renewal date; the default is only 24 hours.
  3. Send it to the customer. Email the returned payment link or send it as an in-app message.
  4. Wait for the webhook. When a FILLED or OVER_FILLED notification arrives, extend the subscription; see the webhook guide.
  5. Reminders and grace. If the renewal date nears without payment, send reminders; after the date, allow a grace period and suspend the service only when it ends.

With only a few customers and no wish to write code, you can instead generate payment links by hand in the dashboard and send them. The principle is the same.

3. An example renewal timeline

An example, with days to adjust for your business (our recommendation):

WhenAction
7 days before renewalCreate the renewal payment, email the payment link, set its validity to the renewal date
3 days beforeIf still OPEN, send a reminder email
1 day beforeRemind again and explain that the service enters a grace period after the date
Renewal dateThe link expires and the status becomes CANCELLED; the service enters the grace period
3 days afterThe grace period ends; if unpaid, suspend the service and send a new “reactivate” link

When a customer pays before the renewal date, extend from the original renewal date, not from the payment date, otherwise customers who pay early lose days.

4. Driving the subscription from payment statuses

A payment has five statuses, covered in payment statuses. A suggested mapping to subscription actions:

StatusWhat to do with the subscription
OPENNot paid yet. Keep the current subscription and send reminders per the timeline
PARTIALLY_FILLEDUnderpaid. Ask the customer to top up and do not extend until they do; or refund what was received, per your policy
FILLEDPaid in full. Extend the subscription by one period
OVER_FILLEDOverpaid. Extend by one period and either refund the excess or credit it against the next period (state which in your terms)
CANCELLEDThe link expired. Start the grace period; if the customer wants to renew later, create a new payment

5. A code skeleton

A Node.js skeleton to show the idea. The database and email functions are placeholders for your own implementation:

// Run once a day: create renewal payments for subscriptions due within 7 days
async function createRenewalInvoices() {
  const subs = await db.subscriptions.dueWithin(7, { withoutOpenInvoice: true });
  for (const sub of subs) {
    const invoiceId = `sub-${sub.id}-${sub.nextPeriod}`; // unique per subscription and period
    if (await db.invoices.exists(invoiceId)) continue;   // check your own database first

    const res = await fetch(`${BASE_URL}/api/v1/payment`, {
      method: 'POST',
      headers: { 'API-Key': API_KEY, 'Content-Type': 'application/json' },
      body: JSON.stringify({
        customerEmail: sub.email,
        customerID: String(sub.customerId),
        amountInUSD: sub.priceUsd,
        invoiceID: invoiceId,
        expire: sub.dueDate.toISOString(), // RFC 3339, the renewal date
      }),
    });
    const { reference_id, url } = await res.json();

    await db.invoices.save({ invoiceId, referenceId: reference_id, url, subId: sub.id });
    await sendEmail(sub.email, renewalEmail(url, sub.dueDate));
  }
}

// Webhook handler: extend only on receipt
async function onPaymentEvent(e) {
  const inv = await db.invoices.findByInvoiceId(e.invoice_id);
  if (!inv) return;

  const key = `${e.reference_id}:${e.status}`;     // idempotency
  if (await alreadyProcessed(key)) return;

  if (e.status === 'FILLED' || e.status === 'OVER_FILLED') {
    await db.subscriptions.extendFromCurrentExpiry(inv.subId); // extend from the old renewal date
  } else if (e.status === 'PARTIALLY_FILLED') {
    await sendTopUpReminder(inv, e.filled_amount);
  } else if (e.status === 'CANCELLED') {
    await startGracePeriod(inv.subId);
  }
  await rememberProcessed(key);
}

Signature verification, retries and idempotency for webhooks are covered in the webhook guide.

6. Approach two: prepaid credit

If your product is “pay for what you use” (API calls, credits, a member wallet), prepaying is the more natural fit:

  1. Use the assign-deposit-address endpoint to give each customer a fixed deposit address.
  2. The customer deposits at any time. You confirm receipt with a webhook or the status endpoint and then add to their balance, keeping the books in your own system.
  3. Your system deducts from the balance monthly or by usage, and reminds the customer to top up when the balance runs low.

The benefit is that customers do not go through the payment page every month; the cost is that you maintain the balance ledger, refunds and reconciliation yourself. The two approaches can be combined: invoices for the monthly plan and prepaid credit for the usage part.

7. Common pitfalls

  • Do not let customers assume automatic renewal. State on the order page, in emails and in your terms that each period needs a manual payment.
  • Make each period’s invoiceID unique. It makes reconciliation easy and lets you find the subscription from the webhook.
  • Set expire. The default is only 24 hours, too short for renewals.
  • Be explicit about coin and network. You can restrict a payment to one coin and one chain with currency and network, which reduces the chance of customers choosing wrongly.
  • Handle payments that arrive after expiry by hand. If a customer still sends money after an invoice has expired, check the on-chain record and contact the customer. Do not leave that money unaccounted for.
  • Run the whole renewal flow once with 1 US dollar first, including the reminder emails, the payment and the extension. See the go-live checklist.

8. FAQ

Will PayRam support automatic renewal in future?

We do not know. At the time of writing, the official documentation says subscriptions must be built at the application layer.

How should I set prices? Is paying in USDC the same as paying in ETH?

A payment is created with an amount in US dollars. Stablecoins are priced at one dollar, so the amount due is essentially the same; if a customer pays in a non-stablecoin such as ETH, the payment page converts at the price at that moment. For subscriptions we suggest customers pay in stablecoins, since the price is steadier and reconciliation is simpler.

What if a customer wants to cancel?

Simply stop creating invoices for the next period. A period that has already been paid is handled under your refund policy; see refunds and payouts.

Does this need any special feature enabled on PayRam?

No. Everything above uses the ordinary create-payment endpoint, webhooks and (optionally) the fixed deposit address endpoint.

  • Create payments via API: Add crypto payments to your own site with the PayRam API: create a payment and get a payment link, send the customer to the payment page, confirm receipt with webhooks and the status endpoint, and reconcile by order number. With curl, Node.js and Python examples.
  • Webhook guide: How to receive PayRam webhooks: register an endpoint, verify X-Payram-Signature, understand retry rules and payment states, handle duplicates, with Node.js and Python examples.
  • Payment statuses: What PayRam's five payment statuses mean, how to handle underpaid (PARTIALLY_FILLED), overpaid (OVER_FILLED) and expired (CANCELLED) payments, and how to keep your order status in sync using webhooks and the status endpoint.
  • Fixed deposit addresses: How PayRam's assign-deposit-address endpoint works: give the same customer a fixed deposit address in a blockchain family, for prepaid balances and repeat top-ups. The request and response, what a family such as ETH_Family means, a Node.js example and integration advice.

Sources

This guide is based on the PayRam official documentation below, checked on 2026-11-09. PayRamHost is an independently operated service and is not affiliated with PayRam. If anything differs, the official documentation prevails.