V8 Central — Product & Technical Spec
  1. Docs
  2. Core platform
  3. Billing

#Billing

Phase 3 deferred billing to "its own phase", and that phase has now been written. Billing data (plans, payments, receipts…) is stored in Central and v7 users' billing moves to V8 (R5). V8 requirement Rules exist, endpoints do not Missing — nothing on this page can be built until the billing API is published. Where a row below still says V7 only, the backend doc has not spoken about it.

#What Phase 6 settles

#Rule V8 requirement
6.1Stripe, PayPal, Instamojo, each with on/off and test/live mode. The user sees only enabled gateways
6.2Billing details (name, address, country, tax number) live on the account that pays and are copied onto every receipt
6.3Wallet = paid + free + promo credits; promo credits expire; spend order as V7. V7's server credits are dropped
6.4Top-up: minimum from settings, maximum $4,000 per payment, promo codes (not at or below the minimum), tax as V7, credit added only after the gateway confirms, each payment credited once. V7's "+3 server limit" per payment is dropped (2026-10-05) — the server limit comes only from the plan
6.5Stripe saved card + auto-recharge when credits fall to the user's minimum
6.6Low-credit reminder minimum set by the user, $1–$1,000
6.7Payments and charges list, and a receipt for every payment with billing details and tax
6.8–6.11Managed servers: admin price list per provider / region / size (DigitalOcean, Vultr, Linode, Hetzner); create needs one month's price in credit; hourly rate = monthly ÷ (days in month × 24), full hours, paid credits only; usage per server
6.12–6.13Negative balance = managed servers only (corrected 2026-10-05, see below). Starts when paid credits reach 0 or below and the dates are saved once: reminders → due date (+4 d) → expire date (+3 d) → deletion date (+7 d); trial 2 / 2 / 4, all V7 defaults. On the expire date servers with no apps and no databases are deleted and the others are powered off (Central asks each server's OSS panel); the rest are deleted on the deletion date. Adding credit stops the process, clears the saved dates and ends trial mode — but does not power a server back on

#V7 model: prepaid wallet credits

ConceptV7 storageNotes
Wallet balanceusers.credits, users.free_credits, users.server_creditsPer user, not per organization. V8 keeps paid / free / promo and drops server_credits, whose leftover is added to paid credits at migration (6.3) V8 requirement. The exact spend order is "as V7" and is still not written out Assumption
Wallet historywallet_histories (type debit/credit, service, amount, links to invoice/transaction/organization)
Transactionstransactions: base, discount, tax, final amount, gateway, status (0 failed · 1 success · 2 pending · 3 refund), conversion_rate, payment_link, refund fields, promo code, affiliate commission
Chargescharges: service, amounts, status, hourly counters (total_spent_hours, total_unpaid_hours)Usage-based charges (e.g. hourly managed servers)
Invoicesinvoices: invoice_number, status, amount, name, address, tax_numbers, organization_id (nullable)
Billing detailsuser_billing_details / organization billing detailsName, address, tax IDs
CardsStripe customer (stripe_id, pm_type, pm_last_four)
Auto-rechargestripe_auto_charges: is_enabled, min_credit, charge_amountDaily job at 23:00 tops up when the balance < min
Low-credit reminderusers.reminder_minimum_creditDaily reminder email
Negative balanceusers.negative_periodMust be paid before deleting the account (V8 3.7 keeps this)

#Features (V7 → V8 status)

FeatureV7V8
Wallet / balanceYesKept (6.3) V8 requirement — D-4 answered
Credits (paid + free + promo)YesKept, promo credits expire. Server credits dropped (6.3) V8 requirement
Add credit (top-up)POST /user/wallet: amount min = minimum_transaction setting, max 4000, gateway, optional promo, optional plan purchaseSame rules confirmed (6.4): minimum from settings, max $4,000, promo not at or below the minimum, credited only once and only after the gateway confirms V8 requirement. The "+3 server limit" bonus is dropped (2026-10-05). No endpoint yet Missing
TransactionsGET /payment, receipt GET /payment-receipt/{key}/receiptPayments and charges in one history, receipt per payment (6.7) V8 requirement. No endpoint yet Missing
Payment methodsStripe cards: list, setup intent, add, set default, deleteStripe saved card kept (6.5) V8 requirement. No endpoint yet Missing
InvoicesGET /organizations/{org}/invoices, download/view POST …/invoices/{number}/{action}Phase 6 says receipt, not invoice, and puts billing details on the account rather than the organization (6.2, 6.7) V8 requirement. Whether V7's organization invoices survive under that name is unstated Open question
Auto-rechargeGET/POST /stripe-auto-chargeKept (6.5): charges the chosen amount when credits fall to the user's minimum V8 requirement
Low-credit reminderusers.reminder_minimum_creditKept (6.6), user-set between $1 and $1,000 V8 requirement
Payment historyTransactions + wallet historyKept (6.7) V8 requirement
Taxestax_amount exists on transactions/charges. How it's calculated isn't visible in the inspected code (spend helper returns tax_amount: 0 by default)"Tax as V7 (Instamojo, or Stripe for India)" (6.4) — the trigger is named, the calculation and display rule are still not Open question D-22
CurrencyUSD in all V7 messages ("$"). conversion_rate (default 80.08) converts to INR for InstamojoPhase 6 writes every amount in $ but states no currency rule Open question D-22
Subscription paymentsDeducted from credits, recorded as chargesConfirmed by Phase 7 (7.5) V8 requirement
Managed servers (hourly)Hourly charges on managed/premium serversSpecified (6.8–6.11): admin price list, hourly rate from the monthly price, paid credits only, usage per server V8 requirement
Negative balanceusers.negative_period + deletion flowSpecified for managed servers (6.12–6.13) V8 requirement. The V7 wallet track (days 1–15 for plan-billed servers) is not being rebuilt; plan expiry covers it (7.12)
Pending chargesGET /user/charges/pending-pay/show, pay pendingNot mentioned by Phase 6 Open question
Credit expiryDaily credit:expire jobConfirmed for promo credits (6.3) V8 requirement

#Payment gateways

Answered by Phase 6 (6.1), 2026-10-05 V8 requirement: V8 keeps all three V7 gateways — Stripe, PayPal and Instamojo. Each has its own on/off switch, test/live mode and keys, read from the database until the admin panel exists, and the user sees only the enabled ones. So D-5 is closed: the frontend builds the gateway choice from the API and hard-codes no gateway. Stripe is still the only gateway that can save a card and drive auto-recharge (6.5).

#Payment flow (must keep)

Confirmed by Phase 6 (6.4): credits are added only after the gateway confirms the payment, and each payment is credited once. So the rule the frontend already followed is now a written backend rule: the return page shows "Confirming payment…" and asks the API, and never treats a redirect back from the gateway as success. V8 requirement

  1. BE creates a pending transaction (status 2) with a unique key and returns the gateway URL. V7 only payment/{key}/execute
  2. The browser goes to the gateway.
  3. The gateway returns to Central's return page. FE shows "Confirming payment…" and asks BE for the status. It never trusts query parameters.
  4. BE verifies with the gateway (payment/{key}/verify), and ideally also through a server-to-server webhook. V7 relies on the verify call. Webhooks for Stripe/PayPal aren't visible in the V7 routes Missing.
  5. On success: credits added, wallet history written, then the plan purchased if one was attached. On failure: the transaction is marked failed (a 30-minute transaction:failed job also expires stale pending ones). V7 only
  6. FE polls the transaction until it's success/failed (timeout → "still processing, we'll email you") and then refreshes wallet, subscription and invoices.

#Billing screens (concept from the demo, data from API only)

RouteContentDemo
/billingOverview: balance, current plan, this month's spend, last receipt, alerts (low balance, failed payment, negative-balance track)Demo UI only overview
/billing/walletPaid / free / promo balances, add credit, auto-recharge status, recent wallet activity, balance trendDemo UI only wallet · V8 requirement 6.3
/billing/transactionsPaginated history of payments and charges, with status, gateway and the receipt on payment rowsDemo UI only · V8 requirement 6.7
/billing/usageManaged servers: hours used, amount so far this month, last charged, per serverV8 requirement 6.11
/billing/payment-methodsCards (Stripe)V7 only · V8 requirement 6.5
/billing/auto-rechargeToggle, threshold, amount, and the low-credit reminder minimumDemo UI only V7 only · V8 requirement 6.5, 6.6
/billing/settingsBilling details (name, address, country, tax number) — account levelDemo UI only V7 only · V8 requirement 6.2

Screen-by-screen spec: FE: Billing screens. The demo also has Invoices and Lifetime pages; Phase 6 says receipt rather than invoice, and lifetime is still parked (D-4).

#Permissions

V7 organization permissions Usage Summary (charges), Invoices and Plan are hidden and owner-only by default (admin_default = 0). Billing is the owner's business. V7 only Phase 6 points the same way: billing details are stored on the account that pays (6.2). Keep in V8: Billing = Owner only unless a role explicitly grants it.

ServerAvatar V8 Central · prepared by central-app-2 (Pair 2 frontend) for Bhavik Jethwa · nothing in this spec is implemented yet · Built 2026-10-05 12:37 UTC