> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praxis-ai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Stripe Billing

> How Pria connects to Stripe for credit purchases, subscriptions, invoices, and the customer billing portal.

Pria uses **Stripe** as its payments backend. Every credit purchase, recurring subscription, invoice, and payment-method change flows through Stripe. The integration is built-in — there is nothing for an Account admin or end user to set up.

<Tip>
  This page describes what Stripe powers, where you encounter it in the product, and how Pria reconciles Stripe events back into your credit balance. For pricing and credit math see [Plans & Credits](/mdx/introduction/plans-and-credits).
</Tip>

***

## What Stripe powers in Pria

<CardGroup cols={2}>
  <Card title="Credit purchases" icon="coins">
    One-time purchases of credit bundles for a personal balance, an Account, or a specific Digital Twin.
  </Card>

  <Card title="Recurring subscriptions" icon="rotate">
    Monthly or annual recurring credit allotments for Accounts, including Named-User subscriptions.
  </Card>

  <Card title="Invoice history" icon="file-invoice-dollar">
    Itemized invoices and PDF receipts for every charge — accessible inside Pria and from the Stripe Billing Portal.
  </Card>

  <Card title="Payment methods" icon="credit-card">
    Saved cards, bank accounts, and billing addresses managed through Stripe's Billing Portal.
  </Card>
</CardGroup>

***

## Where users buy

Credit purchases originate in two places inside Pria:

* **Account → Credits → Buy More** — opens the credit gallery, where you pick a bundle (Personal or Volume) and complete the purchase through Stripe Checkout.
* **Low-balance alert** — when your balance drops below a threshold, Pria surfaces a banner with a one-click path into the same purchase flow.

Both surfaces redirect to a hosted **Stripe Checkout** page. Stripe handles card capture, 3-D Secure, tax (where enabled), receipts, and the success/cancel redirect back to Pria.

***

## One-time vs recurring purchases

| Type                         | When used                                                | How it's billed                                                                 |
| ---------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------- |
| **One-time**                 | Personal top-ups, Account-level credit packs             | Charge on the spot, credits applied immediately on `checkout.session.completed` |
| **Recurring (subscription)** | Account-level monthly/annual contracts, Named-User plans | Stripe issues an invoice each period; credits apply on `invoice.paid`           |

<Info>
  To start, change, or cancel a recurring subscription contract for your Account, contact the Praxis AI team at [humans@praxis-ai.com](mailto:humans@praxis-ai.com). Self-service one-time top-ups remain available anytime from the credit gallery.
</Info>

***

## Customer Billing Portal

Stripe's hosted **Billing Portal** is the self-service surface for everything Stripe owns. Open it from **Account → Manage Billing** — Pria generates a portal session and redirects you to Stripe.

From the portal you can:

* Add or replace credit cards and bank accounts
* Set the default payment method
* Download itemized invoices and receipts in PDF
* Update the billing address used on invoices
* Cancel an active subscription
* View the full charge history

When you close the portal, Stripe redirects you back to Pria and any change you made (new card, cancelled subscription, etc.) is immediately reflected.

***

## Invoice retrieval

Every charge produces an invoice (or a receipt for one-time non-invoiced sessions). Pria stores the Stripe invoice ID and URL on each payment record so you can:

* Open the hosted invoice directly from **Account → Credits → History**
* Download the PDF from the Stripe Billing Portal
* Reference the invoice ID when filing a support request

Receipts are also emailed by Stripe to the address on file at the moment of purchase.

***

## Webhooks — key events Pria listens for

Stripe pushes events to Pria as they happen. Pria handles all of this automatically — **there is nothing to configure on the customer side.**

| Event                           | What Pria does                                                           |
| ------------------------------- | ------------------------------------------------------------------------ |
| `customer.created`              | Records the Stripe customer ID against the matching Pria user            |
| `checkout.session.completed`    | Applies one-time credit purchases and starts subscriptions               |
| `charge.succeeded`              | Confirms a successful charge against an account or instance              |
| `invoice.paid`                  | Applies the recurring credit allotment for the new billing period        |
| `invoice.payment_failed`        | Flags the subscription as past-due and triggers Stripe's dunning retries |
| `customer.subscription.created` | Provisions the subscription on the matching Account                      |
| `customer.subscription.updated` | Reflects plan changes, quantity changes, or pause/resume                 |
| `customer.subscription.deleted` | Ends the subscription and stops future credit allotments                 |

If a webhook fails to reconcile (for example, the customer email doesn't match any Pria user), the Praxis AI team is notified automatically and the payment is held until it can be resolved.

***

## Refunds

Refunds are handled manually so that an audit trail exists for every change.

<Warning>
  To request a refund, a goodwill credit, or a balance correction, contact the Praxis AI team at [humans@praxis-ai.com](mailto:humans@praxis-ai.com). Refunds are issued through Stripe directly and reconciled back into Pria.
</Warning>

***

## Tax considerations

Where tax collection is enabled on the Account, Stripe handles tax calculation, collection, and remittance using **Stripe Tax**. The tax amount appears on every invoice and receipt. Tax behaviour follows the customer's billing address as recorded in the Stripe customer record — keep the billing address current in the Billing Portal to avoid mis-applied tax.

If your Account requires custom tax handling (exemption certificates, VAT-only invoicing, regional carve-outs), contact the Praxis AI team at [humans@praxis-ai.com](mailto:humans@praxis-ai.com).

***

## Account vs Institution routing

A single user can purchase credits that land in different balances:

* **Personal purchases** flow into the user's personal balance.
* **Account purchases** flow into the parent Account's shared pool.
* **Targeted Digital Twin purchases** can be routed to a specific instance via an optional `institutionId` metadata field on the Stripe Checkout session — Pria reads this on `checkout.session.completed` and credits the matching instance directly.

This routing happens automatically based on where you clicked **Buy More**; you do not enter the institution ID by hand. See [Credit Management](/mdx/admin-guide/credit-management) for how an admin moves credits between Account, Instance, and User after the fact.

***

## Failed payments and dunning

If a recurring charge fails (expired card, insufficient funds, bank decline), Stripe automatically retries on its standard dunning schedule. While retries are in flight:

* The subscription stays active but Pria flags it as "past due" in the Billing Portal.
* The customer email on file receives Stripe's standard payment-failure notice.
* Pria surfaces a low-balance alert inside the product so end users see the impact.

If dunning ultimately fails, the subscription is cancelled and recurring credit allotments stop. Update the payment method in the Billing Portal at any point during the retry window to keep the subscription active.

***

## Related

* [Billing & Subscriptions](/mdx/admin-guide/billing) — admin-side billing controls and plan tiers
* [Credit Management](/mdx/admin-guide/credit-management) — moving credits between Account, Instance, and User
* [Credits](/mdx/user-guide/credits) — user-facing view of credit balance and usage
* [Plans & Credits](/mdx/introduction/plans-and-credits) — full pricing tables, caching math, and Named-User subscription model
