OpenCaseLaw Billing API

The Billing API from OpenCaseLaw — 10 operation(s) for billing.

GitHub OpenAPI

Operations 10

POST /billing/portal Create Stripe Customer Portal session #
POST /billing/checkout Create Stripe Checkout session #
POST /billing/webhook Stripe webhook handler #
GET /billing/validate Validate a Pro license key #
GET /billing/license-for-session Get license key for a completed checkout session #
POST /billing/verify Pro reference verification #
POST /billing/strengthen Pro paragraph Verify-and-Strengthen #
POST /billing/reflect Pro literary-reflection on the legal issue #
POST /billing/find-support Find decisions supporting a legal statement #
GET /billing/admin Pro subscriber admin stats (requires dev token) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/opencaselaw-ch:opencaselaw-ch-billing-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

opencaselaw-ch-billing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenCaseLaw Billing API
  description: Swiss court decisions, statutes, commentaries, scholarship, and citation graph. 1,040,000+ published decisions from Swiss federal, cantonal, and regulatory bodies, 5,546 federal laws, 16,400 cantonal acts, 1,100+ commentaries, 51,000+ OA scholarship records.
  version: 1.0.0
servers:
- url: https://mcp.opencaselaw.ch/api
  description: OpenCaseLaw public REST API
- url: /api
  description: Relative — for self-hosted or reverse-proxied deployments
tags:
- name: Billing
paths:
  /billing/portal:
    post:
      tags:
      - Billing
      summary: Create Stripe Customer Portal session
      description: Returns a URL where the user can manage their subscription, cancel, or update payment.
      operationId: api_billing_portal_billing_portal_post
      parameters:
      - name: key
        in: query
        required: true
        schema:
          type: string
          description: License key
          title: Key
        description: License key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /billing/checkout:
    post:
      tags:
      - Billing
      summary: Create Stripe Checkout session
      description: Returns a Stripe Checkout URL for Pro subscription (CHF 5/month).
      operationId: api_billing_checkout_billing_checkout_post
      parameters:
      - name: success_url
        in: query
        required: false
        schema:
          type: string
          description: Redirect after payment
          default: https://word.opencaselaw.ch/pro-success.html
          title: Success Url
        description: Redirect after payment
      - name: cancel_url
        in: query
        required: false
        schema:
          type: string
          description: Redirect on cancel
          default: https://word.opencaselaw.ch/
          title: Cancel Url
        description: Redirect on cancel
      - name: locale
        in: query
        required: false
        schema:
          type: string
          description: Stripe checkout locale (de, fr, it, en)
          default: ''
          title: Locale
        description: Stripe checkout locale (de, fr, it, en)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /billing/webhook:
    post:
      tags:
      - Billing
      summary: Stripe webhook handler
      description: Handles Stripe subscription events. Do not call directly.
      operationId: api_billing_webhook_billing_webhook_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
  /billing/validate:
    get:
      tags:
      - Billing
      summary: Validate a Pro license key
      description: Check if a license key is valid and active.
      operationId: api_billing_validate_billing_validate_get
      parameters:
      - name: key
        in: query
        required: true
        schema:
          type: string
          description: License key (ocl_pro_...)
          title: Key
        description: License key (ocl_pro_...)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /billing/license-for-session:
    get:
      tags:
      - Billing
      summary: Get license key for a completed checkout session
      description: After Stripe Checkout completes, retrieve the license key using the session ID.
      operationId: api_billing_license_for_session_billing_license_for_session_get
      parameters:
      - name: session_id
        in: query
        required: true
        schema:
          type: string
          description: Stripe Checkout session ID (cs_...)
          title: Session Id
        description: Stripe Checkout session ID (cs_...)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /billing/verify:
    post:
      tags:
      - Billing
      summary: Pro reference verification
      description: Server-side reference verification for Pro subscribers. Fetches the case brief and calls Claude to verify the citation.
      operationId: api_billing_verify_billing_verify_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /billing/strengthen:
    post:
      tags:
      - Billing
      summary: Pro paragraph Verify-and-Strengthen
      description: 'For a single legal paragraph: verifies cited decisions, finds leading cases not cited (ranked by citation-graph centrality), pulls scholarly commentary excerpts, and computes an argument-strength signal. Paragraph-only — multi-paragraph would dilute per-suggestion ranking. Daily cap shared with /verify (25/day per license).'
      operationId: api_billing_strengthen_billing_strengthen_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StrengthenRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /billing/reflect:
    post:
      tags:
      - Billing
      summary: Pro literary-reflection on the legal issue
      description: 'Whole-document scope. The Word add-in scans the current draft, runs js/redact.js to strip PII, and sends the redacted text here. The server: (1) refuses any payload with structurally-identifiable PII; (2) validates the license + daily cap; (3) asks Claude Sonnet to identify the central legal issue and draw ONE literary parallel (Shakespeare / Dürrenmatt / Frisch / Goethe / Kafka / etc.) that mirrors the same human dilemma. Returns a 200-400 word reflective markdown summary plus one question for the lawyer to bring back to the case. Reflective tool — explicitly NOT legal advice. Daily cap shared with /verify and /strengthen (25/day per license).'
      operationId: api_billing_reflect_billing_reflect_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReflectRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /billing/find-support:
    post:
      tags:
      - Billing
      summary: Find decisions supporting a legal statement
      description: AI parses the legal claim, searches for relevant decisions, and scores how well each supports the statement. Pro feature.
      operationId: api_billing_find_support_billing_find_support_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FindSupportRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /billing/admin:
    get:
      tags:
      - Billing
      summary: Pro subscriber admin stats (requires dev token)
      operationId: api_billing_admin_billing_admin_get
      parameters:
      - name: token
        in: query
        required: true
        schema:
          type: string
          description: Dev dashboard token
          title: Token
        description: Dev dashboard token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    FindSupportRequest:
      properties:
        license_key:
          type: string
          title: License Key
        statement:
          type: string
          maxLength: 2000
          title: Statement
        lang:
          type: string
          title: Lang
          default: de
      type: object
      required:
      - license_key
      - statement
      title: FindSupportRequest
      description: Request body for finding supporting decisions.
    StrengthenRequest:
      properties:
        license_key:
          type: string
          title: License Key
        redacted_text:
          type: string
          maxLength: 8000
          title: Redacted Text
        lang:
          type: string
          title: Lang
          default: de
        client_redactor_version:
          title: Client Redactor Version
          type:
          - string
          - 'null'
        client_redactor_summary:
          title: Client Redactor Summary
          additionalProperties: true
          type:
          - object
          - 'null'
      type: object
      required:
      - license_key
      - redacted_text
      title: StrengthenRequest
      description: 'Request body for Pro paragraph Verify-and-Strengthen.


        The Word add-in (>=v3 redactor) sends ``redacted_text``. Always

        redacted client-side; server-side redaction guard re-runs to enforce

        the contract for any non-Word caller. Paragraph-only scoping —

        multi-paragraph review would dilute the per-suggestion ranking;

        lawyers run Strengthen 3-5 times per document, not once on the

        whole thing.'
    ReflectRequest:
      properties:
        license_key:
          type: string
          title: License Key
        redacted_text:
          type: string
          maxLength: 60000
          title: Redacted Text
        lang:
          type: string
          title: Lang
          default: de
        client_redactor_version:
          title: Client Redactor Version
          type:
          - string
          - 'null'
        client_redactor_summary:
          title: Client Redactor Summary
          additionalProperties: true
          type:
          - object
          - 'null'
      type: object
      required:
      - license_key
      - redacted_text
      title: ReflectRequest
      description: 'Request body for the Pro "Reflect" feature.


        Whole-document scope: the lawyer points the add-in at their full

        draft (motion, brief, memo, opinion) and gets back a brief

        literary-philosophical mirror of the core legal issue. The Word

        add-in''s client-side redactor (>=v3) MUST run before sending —

        the server-side guard refuses any payload whose structural-PII

        scan comes back non-empty.


        The redacted whole-document budget is intentionally larger than

        the per-paragraph Strengthen/Verify budgets: the Reflect prompt

        needs enough context to identify the central issue, but is still

        bounded so a 60-page contract doesn''t get sent verbatim.'
    ValidationError:
      properties:
        loc:
          items:
            type: string
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
          type: object
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VerifyRequest:
      properties:
        license_key:
          type: string
          title: License Key
        redacted_text:
          title: Redacted Text
          type:
          - string
          - 'null'
          maxLength: 5000
        selected_text:
          title: Selected Text
          type:
          - string
          - 'null'
          maxLength: 5000
        case_ref:
          type: string
          maxLength: 200
          title: Case Ref
        lang:
          type: string
          title: Lang
          default: de
        client_redactor_version:
          title: Client Redactor Version
          type:
          - string
          - 'null'
        client_redactor_summary:
          title: Client Redactor Summary
          additionalProperties: true
          type:
          - object
          - 'null'
      type: object
      required:
      - license_key
      - case_ref
      title: VerifyRequest
      description: 'Request body for Pro reference verification.


        The Word add-in (>=v3 redactor) sends ``redacted_text``. Older

        clients sent ``selected_text`` — both are accepted during the

        transition window. The server-side redaction guard runs against

        whichever field was supplied so a missed redaction is caught

        either way; the field name is just a documentation hint to

        AppSource reviewers / security auditors that the contract is

        "this text is already redacted client-side".'