> ## 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.

# Start checkout

> Creates a Stripe checkout session for a treatment, or returns an existing consultation already covered by an active plan. Refuses with `PROFILE_INCOMPLETE` if the profile is missing required fields.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/users/checkout/
openapi: 3.0.3
info:
  title: Hi-Doctor API
  version: 1.0.0
  description: >-
    Patient-facing REST API for Hi-Doctor.


    Authenticate with email and password to receive a JWT pair, then send the
    access token as `Authorization: Bearer <token>` on every subsequent request.


    Only patient-accessible endpoints are documented here. Clinician and
    back-office endpoints are intentionally omitted.
  contact:
    name: Hi-Doctor
    email: hello@hi-doctor.ai
    url: https://hi-doctor.ai
servers:
  - url: https://api.hi-doctor.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Registration, email verification, sign-in and profile.
  - name: Questionnaires
    description: Complete a consultation questionnaire and submit it for medical review.
  - name: Consultations
    description: Consultations a doctor has reviewed or is reviewing.
  - name: Prescriptions
    description: Prescriptions and reissue requests.
  - name: Billing
    description: Checkout, subscription management and the Stripe billing portal.
  - name: Records
    description: Orders, invoices and side-effect reports.
  - name: Messages
    description: The patient's private thread with their medical team.
  - name: Progress
    description: Weight, injection and note tracking. Requires an active treatment plan.
  - name: Referrals
    description: Referral summary and transactions.
paths:
  /v1/users/checkout/:
    post:
      tags:
        - Billing
      summary: Start checkout
      description: >-
        Creates a Stripe checkout session for a treatment, or returns an
        existing consultation already covered by an active plan. Refuses with
        `PROFILE_INCOMPLETE` if the profile is missing required fields.
      operationId: users_checkout_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CartCreate'
            example:
              items:
                - treatment_id: wegovy
                  dosage: 0.5 mg
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CartCreate'
          description: ''
        '400':
          description: >-
            Validation failed. `items` is required and must not be empty; each
            item needs `treatment_id` and `dosage`. Per-item errors come back as
            an array positionally matching `items`.
          content:
            application/json:
              example:
                items:
                  - dosage:
                      - This field is required.
        '401':
          description: >-
            No bearer token, or a token that is expired or malformed.
            Re-authenticate; do not retry the same token.
          content:
            application/json:
              example:
                detail: Given token not valid for any token type
                code: token_not_valid
                messages:
                  - token_class: AccessToken
                    token_type: access
                    message: Token is invalid
      security:
        - jwtAuth: []
components:
  schemas:
    CartCreate:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/CartItem'
        plan:
          allOf:
            - $ref: '#/components/schemas/PlanEnum'
          default: one_off
        language:
          type: string
          default: EN
        return_path:
          type: string
          maxLength: 500
        session_id:
          type: string
          nullable: true
          maxLength: 64
      required:
        - items
    CartItem:
      type: object
      properties:
        treatment_id:
          type: string
        dosage:
          type: string
        quantity:
          type: integer
          minimum: 1
          default: 1
      required:
        - dosage
        - treatment_id
    PlanEnum:
      enum:
        - one_off
        - subscription
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token from POST /v1/users/token/
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````