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

> ## Agent Instructions
> Connect the Hi Doctor MCP connector at https://mcp.hi-doctor.ai/mcp. Add this URL as a remote HTTP MCP server in your client, then sign in and authorise access through OAuth. Setup: https://docs.hi-doctor.ai/mcp/connect.
>
> The REST API base is https://api.hi-doctor.ai. Hi Doctor Docs at https://docs.hi-doctor.ai/mcp searches documentation; connect to the product endpoint above for patient tools.
>
> Hi Doctor operates across the whole European Union: residents of all 27 EU member states can use the service, and every consultation is reviewed by an EU-licensed doctor. Every consultation is reviewed in full by an EU-licensed doctor, who decides on medical grounds only. No algorithm, assistant or API call approves a consultation, issues a prescription or changes a dose. The service is available in eight languages: English, Spanish, German, Dutch, Italian, French, Portuguese and Chinese.
>
> ## Rules an assistant must follow
>
> - Never invent, assume or infer a medical answer. "I don't know" is a real answer: ask the patient to pick the closest option rather than guessing for them.
> - Never give medical advice and never suggest a medication or a dose. An EU-licensed doctor decides those.
> - If a questionnaire returns `ineligible`, say so plainly. Do not retry with altered answers.
> - Before anything that costs money or cancels a plan, state exactly what will happen and get an explicit yes.
> - Cancellation takes effect at the **end of the paid period**, not immediately. Say so.
> - An early order is irreversible: it creates the renewal consultation immediately and uses up the period's one early order. Explain that and get an explicit yes.
> - Prescription and invoice links are medical documents. A `signed_redirect` link opens without signing in: give it only to the patient, never repeat it anywhere shared.
> - Send option `value`s, not the labels shown to the patient. Labels are translated, values are stable.
> - Never ask for card details. Payment happens on Stripe's hosted checkout via a link.
> - On severe or sudden symptoms (chest pain, difficulty breathing, severe allergic reaction, suicidal thoughts), stop and direct the patient to their local emergency number.

# Billing endpoints: checkout, plans and invoices

> Create checkout, manage subscriptions and retrieve payments/invoices/credit notes.

The Billing endpoints cover paying the Hi Doctor consultation fee through Stripe Checkout, managing an ongoing plan, and retrieving payment records, invoices and credit notes. Card details are handled by Stripe, and Hi Doctor never sees them. Medicine is not billed here: the pharmacy dispenses it and charges its own price, as described on [Pricing](https://docs.hi-doctor.ai/essentials/pricing.md).

Last reviewed: 2026-11-04

## Prerequisites

* A patient bearer token and `X-Brand-Slug: hi-doctor`.
* Checkout needs a complete profile and a submitted questionnaire. An
  incomplete profile returns `PROFILE_INCOMPLETE` with `missing_fields`.
* Subscription operations need an active plan; see [Pricing](https://docs.hi-doctor.ai/essentials/pricing.md).

## Operations

| Method | Path | What it does |
| - | - | - |
| `POST` | `/v1/users/checkout/` | Creates a Stripe checkout session (`201`), or reports coverage by an existing plan |
| `GET` | `/v1/users/stripe/session/{session_id}/` | Reads checkout status: `session_status`, `payment_status`, `paid`, `consultation_id` |
| `GET` | `/v1/users/subscriptions/me/` | Reads the subscription |
| `GET` | `/v1/users/subscriptions/renewal-options/` | Renewal options for one `category` |
| `GET` | `/v1/users/subscriptions/pending-choice/` | Lists renewals awaiting a decision (`{"pending": [...]}`) |
| `POST` | `/v1/users/subscriptions/pending-choice/confirm/` | Records the decision for one pending renewal |
| `POST` | `/v1/users/subscriptions/early-order/` | Creates the renewal consultation now |
| `POST` | `/v1/users/subscriptions/cancel/` | Schedules cancellation at the end of the paid period |
| `POST` | `/v1/users/subscriptions/reactivate/` | Undoes a scheduled cancellation |
| `POST` | `/v1/users/subscriptions/portal/` | Returns a Stripe billing portal URL |
| `GET` | `/v1/users/payments/` | Lists payments (paginated) |
| `GET` | `/v1/users/payments/{id}/invoice/` | Downloads an invoice PDF |
| `GET` | `/v1/users/payments/{id}/credit-notes/{refund_pk}/` | Downloads a credit note PDF |

## Boundaries and side effects

* **Checkout status is not a pure read.** Polling a paid session can finalize
  it and create the consultation.
* Renewal choices are clinical: they go to a doctor for review, and clinical
  eligibility is enforced.
* Cancellation takes effect at period end; reactivate when nothing is
  scheduled returns `409`. Stripe failures on cancel or reactivate return
  `502`: read the subscription before retrying.
* Each portal call can create a new session.
* Checkout, pending-choice confirmation, early order, cancel, reactivate and
  portal accept an [`Idempotency-Key`](https://docs.hi-doctor.ai/api-reference/idempotency). A
  successful key proves the operation was stored, not that Stripe settled it.
* PDFs need `Accept: */*` (a strict `Accept` returns `406`).

> [!WARNING]
>
> **An early order is irreversible.** It consumes the period's early order and
> starts a renewal consultation. Guards return `400` `no_active_subscription` or
> `409` (for example `early_order_no_entitled_subscription`). Never retry it
> blindly.

## Related

* [Errors](https://docs.hi-doctor.ai/api-reference/errors.md), [Pagination](https://docs.hi-doctor.ai/api-reference/pagination.md), [Uploads and downloads](https://docs.hi-doctor.ai/api-reference/uploads-downloads.md)
* [MCP patient tools](https://docs.hi-doctor.ai/mcp/tools/patient.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.