---
title: "Billing and payments"
description: "Set up the payer account, manage invoices, and resolve billing requirements for Live orders."
---

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

# Billing and payments

Affinity bills the payer assigned to the order. Platform-managed orders use the platform's billing account, including when a provider signs in Clinic.
Direct practice orders use the practice's billing account.

## Find the payer

| Order relationship     | Where to manage Affinity billing          |
| ---------------------- | ----------------------------------------- |
| Platform-managed order | The platform's **Settings > Billing**     |
| Direct practice order  | The practice's **Billing** page in Clinic |

Clinic shows **Billed to** and the platform name at checkout for a platform-managed practice.
Its billing settings also identify the platform that manages order billing.
Contact that platform about its payment arrangement with your practice.
Adding a practice payment method does not resolve a platform billing requirement.

## Set up Live payments

Use an account with billing management permission.

1. Select the payer organization and Live mode.
2. Open its billing settings.
3. Confirm the billing email and address.
4. Open the payment-method action to continue to Stripe.
5. Add a supported card or US bank account and set the default payment method.
6. Return to Affinity and confirm the payment method appears.

Stripe manages payment-method entry. Do not send card or bank details through prescription or order API fields.
Billing viewers can inspect records. Updating billing details or starting an invoice payment requires billing management permission.

For platform-managed practices, Clinic hides payment-method setup for the platform account.
An authorized platform member must complete that setup in Platform.

## Account credit and payment terms

Automatic billing requires a ready default payment method unless available account credit covers the charge.
Affinity checks the final amount before pharmacy transmission, including charges already reserved by other orders.
A positive credit balance at signing does not guarantee that credit covers the final order amount.

Accounts with negotiated invoice terms require a billing email.
Approved credit limits, account holds, and overdue invoices still apply.
Use the terms shown on your billing account; do not assume every account has the same payment schedule.

## Invoices, payments, and activity

The payer's billing page shows available account credit, open invoices, and billing activity for the selected mode.
Platform billing includes charges billed to the platform across its managed practices.

Open an invoice to review its charges or download the available document.
Use the invoice payment action when payment is available.
In Live mode, this action opens Stripe's hosted invoice page.
If Stripe is still preparing the invoice, wait and refresh before trying again.

Payment confirmation can arrive after you return from Stripe.
Check the invoice status in Affinity before treating it as paid.
Receipts become available when the corresponding payment record supports a receipt.

## Test billing

Test mode uses simulated payment profiles and invoice settlement. It does not charge a real payment method.
The displayed Test card ending in `4242` is a simulated profile; no card entry is required.
Stripe payment-method management is unavailable in Test mode.

Paying an eligible Test invoice updates its simulated payment and invoice records within Affinity.
Test and Live billing activity remain separate. A successful Test payment does not configure Live billing.

## Resolve a Live billing block

Signing and pharmacy submission check the order's payer, even when the clinician works in Clinic.
Resolve the reported issue on that payer's account.

| Billing issue                              | Action                                                                                   |
| ------------------------------------------ | ---------------------------------------------------------------------------------------- |
| Account unavailable or on hold             | Ask the payer's billing administrator or Affinity support to resolve the account status. |
| Credit does not cover the order            | Add a ready default payment method or arrange sufficient account credit.                 |
| Missing billing email for negotiated terms | Save a billing email on the payer's account.                                             |
| Approved credit limit exceeded             | Resolve the outstanding balance or contact Affinity about the approved limit.            |
| Invoice overdue beyond its grace period    | Resolve the overdue invoice before retrying submission.                                  |
| Platform billing not ready in Clinic       | Contact the named platform. Its billing administrator must resolve the issue.            |

Billing readiness does not replace clinician authorization, prescription validation, or Live product eligibility.
See [Test and Live mode](/guides/test-and-live-mode/) for production-access requirements.

## API integrations

### Platform selling prices

Platform selling prices control the amount shown to managed practices. They do not change what the platform pays Affinity.
Read `purchaseAmountCents` and the catalog `basis` before setting `amountCents` through the selling-price API.
Both amounts use the same quantity and unit. Compare them directly to identify a discount below your Affinity purchase price.

Intentional discounts are allowed. The Platform price editor warns when the entered amount is below the purchase price.
API clients can show the same warning when `amountCents < purchaseAmountCents`.
A null `amountCents` removes the override and inherits pricing; it is not a zero-dollar price.

`requiresReview` reports a saved price whose product pricing terms changed. It does not indicate whether a price is profitable.
When it is true, review the new basis and save the price with the current `baseVersion`.

### Order billing

The order workflow determines the payer from the order's platform or practice relationship.
You do not provide Stripe customer IDs or payment-method details in `orders.create`, signing, or submission requests.

Billing management uses authenticated dashboard sessions and billing permissions.
The dashboard's platform billing routes are not public API-key SDK methods.
Use Platform to configure the payer before submitting Live orders through the SDK.

Handle billing conflicts by displaying the returned problem detail and directing the payer to billing settings.
Do not repeatedly retry an unchanged billing conflict or create a replacement order to bypass it.
After resolving the issue, re-read the order and follow the normal signing or submission workflow.
See [Build a headless integration](/guides/choose-an-integration/) for attestation, version checks, and retry requirements.

Source: https://docs-staging.affinityrx.com/guides/billing/index.mdx
