跳到主要内容Skip to content
Docs

Billing (Console)

Top up credits and review your balance history.

Where to manage billing

Billing is available in the Console at Billing. The page shows balance history and your top-ups.

USDC Polygon top-ups

0-0 can top up credits with Morlane direct payments. The backend creates a Morlane payment for `USDC` on `Polygon`, and the Billing page opens Morlane's embedded checkout URL inside a modal iframe instead of redirecting the user away from the console.

  • Configure `MORLANE_API_BASE_URL`, `MORLANE_API_KEY`, `MORLANE_STORE_ID`, `MORLANE_PRODUCT_ID`, `MORLANE_ASSET=USDC`, and `MORLANE_NETWORK=Polygon` in the backend environment.
  • Create a product-scoped Morlane webhook pointing to `<APP_PUBLIC_URL>/api/webhook/morlane` with `payment.paid` and `payment.overpaid` events.
  • The frontend listens for `morlane.checkout.paid` from `/pay/{checkoutId}?embed=1`, then polls `/api/billing/topup/status` until the local balance is updated.
  • The webhook handler fetches the Morlane payment again and validates store, product, asset, network, amount, and request ID before crediting the user.