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

# Platform partners

> Running Tagada Rx for a fleet of merchants: white-label CRM, per-store activation, headless integration on your own funnel infrastructure, and partner economics.

# Tagada Rx for platform partners

You run a platform — a funnel builder, an agency, a telehealth enabler, a
payment orchestrator — and **your merchants** (not you) sell the treatments.
Tagada Rx is built so a partner can operate the whole clinical stack for a
fleet of merchant stores without Tagada ever appearing patient-side.

<Info>
  **The decoupling promise applies fleet-wide.** Every merchant store is a
  standard Tagada store with the Rx add-on activated. Your merchants can use
  Tagada-hosted [storefront templates](/developer-tools/rx/storefront-templates),
  or you can keep them on **your own funnel infrastructure** and drive
  everything through the [Headless SDK](/developer-tools/rx/headless-sdk)
  (browser) + [Node SDK](/developer-tools/rx/node-sdk) (your backend). Same
  [building blocks](/developer-tools/rx/building-blocks) either way.
</Info>

***

## The two partner shapes

<CardGroup cols={2}>
  <Card title="Payment layer only" icon="credit-card">
    Your merchants already have clinicians and pharmacies plugged in. They
    apply with their LegitScript certificate; you take a markup on
    processing (think Stripe Connect for regulated verticals). Integrate
    headless with the Node SDK — no Tagada CRM required.
  </Card>

  <Card title="Full stack with TagadaRx" icon="hospital">
    Your merchants need clinicians and pharmacies too. You operate the
    **white-label CRM**; each merchant store activates the Rx integration
    (clinical network, intake, cases, portal, ship-day rebilling). Your
    margin flows through the CRM layer.
  </Card>
</CardGroup>

The rest of this page covers the full-stack shape.

***

## Fleet provisioning, per merchant store

Rx is activated **per store**, so a fleet is a loop over your merchants.
From your backend, with your partner-scoped API key:

```ts theme={null}
import { Tagada } from '@tagadapay/node-sdk';

const tagada = new Tagada(process.env.TAGADA_API_KEY!);

// For each merchant store you provision:
await tagada.rx.requestActivation({
  storeId: merchant.storeId,
  clinicalNetworkSlug: 'mdi',
  operatingMode: 'affiliate',      // or 'direct' — see Operating modes
});

// After the setup fee is settled (billing confirms it in prod):
await tagada.rx.confirmSetupFeePaid({ storeId: merchant.storeId });

// Map each Rx product to its clinical offering:
await tagada.rx.setProductOffering({
  storeId: merchant.storeId,
  productId: product.id,
  externalOfferingId: offering.uuid,
  requiresIdVerification: true,
});

// Audit the fleet at any time:
const status = await tagada.rx.integrationStatus(merchant.storeId);
// 'not_requested' | 'pending_payment' | 'active'
```

The [operating mode](/developer-tools/rx/operating-modes) is chosen per
store: merchants validating a vertical start in `affiliate` (Tagada is
merchant of record, commission per case), and graduate to `direct` (their
own MIDs, full revenue) when volume justifies it — with zero storefront
changes.

***

## Storefronts: hosted templates or your infrastructure

**Option 1 — Tagada-hosted (fastest).** Each merchant brand is one plugin
instance of a [storefront template](/developer-tools/rx/storefront-templates)
mounted on its own domain — same code, per-brand config (branding,
verticals, products, payment flow). Good when your merchants don't have
their own frontend stack.

**Option 2 — Your funnel infrastructure (headless).** Your funnel builder
renders the pages; the Rx bricks are API calls:

```ts theme={null}
import { createTagadaClient } from '@tagadapay/headless-sdk';

const tagada = createTagadaClient({ storeId: merchant.storeId });

// At product load — should this SKU be gated behind an intake?
const check = await tagada.rx.isRequiredForProduct(productId);

// Post-payment — network-authored questionnaire, then case submission:
const { questions } = await tagada.rx.getQuestionsForProduct(productId);
const result = await tagada.rx.submitCase({
  orderId, checkoutToken, productId, patient, intakeAnswers,
});

// Thank-you page — authoritative status:
const { cases } = await tagada.rx.getCasesForOrder({ orderId, checkoutToken });
```

No API key ships to the browser: case routes prove ownership with the
`(orderId, checkoutToken)` pair. Your platform backend keeps the API-key
surface (`tagada.rx.*`) for provisioning and ops.

<Warning>
  **PHI rule, fleet edition:** patient identity and intake answers are
  pass-through. Neither you nor your merchants may store them — they go from
  the patient's browser through Tagada to the clinical network in one request.
  Building intake storage into your platform would make you a PHI processor.
</Warning>

***

## White-label rules

Patients must never see the platform plumbing:

* **Branding priority:** the merchant's brand first; the marketplace brand
  (e.g. TGD Care) when attribution is unavoidable; the platform name never.
* Storefront domains, transactional emails, questionnaires, and the patient
  portal all carry the merchant brand (hosted templates handle this via
  per-instance config).
* The white-label CRM is your operator surface: your team and your
  merchants manage cases, orders, and patients there under your brand.

***

## Partner economics

| Layer                     | Affiliate mode (MoR)                                                                                                                                                    | Direct mode                            |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
| Merchant revenue          | Commission per submitted case (versioned [affiliate terms](/developer-tools/rx/operating-modes#how-affiliate-commissions-work); auto-accrual, auto-reversal on decline) | Full order revenue minus platform fees |
| Partner margin            | Negotiated on top of the case commission / CRM layer                                                                                                                    | Markup on processing and/or CRM layer  |
| Who is merchant of record | Tagada                                                                                                                                                                  | The merchant                           |

Accruals post automatically at case submission (`accrualAmountMinor` in the
`submitCase` response) and reverse automatically on clinician decline —
there is no billing call to make per case.

***

## Fleet monitoring

Everything your ops dashboard needs is on the Node SDK:

```ts theme={null}
// Cases across a store, filterable and paginated
const { cases } = await tagada.rx.cases.list({ storeId: merchant.storeId });

// One case + full append-only event timeline (for support tooling)
const detail = await tagada.rx.cases.retrieve('rxcase_xxx');

// Manual refill for support edge cases (shipped/delivered only)
await tagada.rx.cases.requestRefill({ caseId: 'rxcase_xxx' });
```

Case webhooks land in each store's event stream, so your platform can mirror
statuses into your own merchant dashboard without polling.
