Railhook Billing API

Plan catalog, usage, and subscription management

GitHub OpenAPI

Operations 10

GET /api/v1/billing/organization Get organization billing info #
PUT /api/v1/billing/organization Update organization billing info #
PUT /api/v1/billing/organization/plan Change organization plan #
POST /api/v1/billing/webhook/{providerCode} Billing provider webhook #
POST /api/v1/billing/portal Create portal session #
POST /api/v1/billing/checkout Create checkout session #
POST /api/v1/billing/cancel Cancel subscription #
GET /api/v1/billing/usage Get detailed usage #
GET /api/v1/billing/plans List available plans #
GET /api/v1/billing/invoices List invoices #

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/railhook-io:railhook-io-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

railhook-io-billing-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Railhook Billing API
  description: 'Send webhooks to the endpoints your customers register, and receive webhooks from any provider, with every attempt on record.


    ## What you can do

    - **Outgoing**: post an event once; Railhook delivers it, signed, to every subscribed endpoint and retries on its own (1m → 24h, 7 attempts). What never arrives lands in Failed Messages.

    - **Incoming**: give each provider its own ingress URL; Railhook verifies the signature and forwards the event to your destinations.

    - **Replay**: send past events again with Time Machine.


    ## Authentication

    - **API key** (`X-API-Key` header): project-scoped calls, including sending events. What the SDKs use.

    - **Bearer token**: account and organization calls made on behalf of a signed-in user.

    - **Portal session** (`Authorization: Bearer rhp_…`): the `/api/v1/portal/**` calls the embedded customer portal makes for one Consumer. Opened by your backend with an API key.


    Guides: /docs/'
  contact:
    name: Railhook
    url: https://github.com/vadymkykalo/railhook
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: 1.0.0
servers:
- url: '{baseUrl}'
  description: Your Railhook installation — the same origin the dashboard runs on
  variables:
    baseUrl:
      description: Scheme and host of your installation, without a trailing slash
      default: http://localhost:8080
security:
- bearerAuth: []
tags:
- name: Billing
  description: Plan catalog, usage, and subscription management
paths:
  /api/v1/billing/organization:
    get:
      tags:
      - Billing
      summary: Get organization billing info
      description: Returns current plan, billing status, and usage snapshot
      operationId: getOrganizationBilling
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/OrganizationBillingResponse'
      security:
      - bearerAuth: []
    put:
      tags:
      - Billing
      summary: Update organization billing info
      description: Updates billing email for the organization (owner only)
      operationId: updateBillingInfo
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBillingRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/OrganizationBillingResponse'
      security:
      - bearerAuth: []
  /api/v1/billing/organization/plan:
    put:
      tags:
      - Billing
      summary: Change organization plan
      description: Directly assigns a plan to the organization (owner only). For paid plans, use checkout instead.
      operationId: changePlan
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChangePlanRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/OrganizationBillingResponse'
      security:
      - bearerAuth: []
  /api/v1/billing/webhook/{providerCode}:
    post:
      tags:
      - Billing
      summary: Billing provider webhook
      description: Handles callbacks from billing providers. Each provider has its own endpoint. Signature verification is delegated to the BillingProvider adapter.
      operationId: handleWebhook
      parameters:
      - name: providerCode
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: string
        required: true
      responses:
        '200':
          description: Event processed
      security:
      - bearerAuth: []
  /api/v1/billing/portal:
    post:
      tags:
      - Billing
      summary: Create portal session
      description: Creates a billing provider portal session for managing subscription
      operationId: createPortal
      parameters:
      - name: returnUrl
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: object
                additionalProperties:
                  type: string
      security:
      - bearerAuth: []
  /api/v1/billing/checkout:
    post:
      tags:
      - Billing
      summary: Create checkout session
      description: Creates a billing provider checkout session for plan upgrade
      operationId: createCheckout
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutRequest'
        required: true
      responses:
        '200':
          description: Checkout URL returned
          content:
            '*/*':
              schema:
                type: object
                additionalProperties:
                  type: string
      security:
      - bearerAuth: []
  /api/v1/billing/cancel:
    post:
      tags:
      - Billing
      summary: Cancel subscription
      description: Cancels the current subscription and downgrades to free plan
      operationId: cancelSubscription
      responses:
        '200':
          description: OK
      security:
      - bearerAuth: []
  /api/v1/billing/usage:
    get:
      tags:
      - Billing
      summary: Get detailed usage
      description: Returns current resource usage vs plan limits for all quota types
      operationId: getBillingUsage
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/UsageResponse'
      security:
      - bearerAuth: []
  /api/v1/billing/plans:
    get:
      tags:
      - Billing
      summary: List available plans
      description: Returns all active plans with their limits and pricing
      operationId: listPlans
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PlanResponse'
      security:
      - bearerAuth: []
  /api/v1/billing/invoices:
    get:
      tags:
      - Billing
      summary: List invoices
      description: Returns invoice history from the billing provider. Empty when billing is disabled (self-hosted).
      operationId: listInvoices
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/InvoiceResponse'
      security:
      - bearerAuth: []
components:
  schemas:
    UsageResponse:
      type: object
      properties:
        events:
          $ref: '#/components/schemas/ResourceUsage'
        endpoints:
          $ref: '#/components/schemas/ResourceUsage'
        projects:
          $ref: '#/components/schemas/ResourceUsage'
        members:
          $ref: '#/components/schemas/ResourceUsage'
        rateLimitPerSecond:
          type: integer
          format: int32
        retentionDays:
          type: integer
          format: int32
        periodStart:
          type: string
          format: date-time
        periodEnd:
          type: string
          format: date-time
    ResourceUsage:
      type: object
      properties:
        current:
          type: integer
          format: int64
        limit:
          type: integer
          format: int64
        percentUsed:
          type: number
          format: double
    ChangePlanRequest:
      type: object
      properties:
        planName:
          type: string
          minLength: 1
      required:
      - planName
    JsonNode: {}
    InvoiceResponse:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
        amountCents:
          type: integer
          format: int32
        currency:
          type: string
        planName:
          type: string
        periodStart:
          type: string
          format: date-time
        periodEnd:
          type: string
          format: date-time
        paidAt:
          type: string
          format: date-time
        invoiceUrl:
          type: string
    OrganizationBillingResponse:
      type: object
      properties:
        organizationId:
          type: string
          format: uuid
        plan:
          $ref: '#/components/schemas/PlanResponse'
        billingStatus:
          type: string
          enum:
          - ACTIVE
          - PAST_DUE
          - GRACE_PERIOD
          - SUSPENDED
          - CANCELLED
        billingEmail:
          type: string
        usage:
          $ref: '#/components/schemas/UsageSnapshot'
    UsageSnapshot:
      type: object
      properties:
        eventsThisMonth:
          type: integer
          format: int64
        eventsLimit:
          type: integer
          format: int64
        projects:
          type: integer
          format: int64
        projectsLimit:
          type: integer
          format: int64
    UpdateBillingRequest:
      type: object
      properties:
        billingEmail:
          type: string
          format: email
    CheckoutRequest:
      type: object
      properties:
        planName:
          type: string
          minLength: 1
        successUrl:
          type: string
          minLength: 1
        cancelUrl:
          type: string
          minLength: 1
        providerCode:
          type: string
        billingInterval:
          type: string
      required:
      - cancelUrl
      - planName
      - successUrl
    PlanResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        displayName:
          type: string
        maxEventsPerMonth:
          type: integer
          format: int64
        maxEndpointsPerProject:
          type: integer
          format: int32
        maxProjects:
          type: integer
          format: int32
        maxMembers:
          type: integer
          format: int32
        maxActiveTunnels:
          type: integer
          format: int32
        rateLimitPerSecond:
          type: integer
          format: int32
        maxRetentionDays:
          type: integer
          format: int32
        features:
          $ref: '#/components/schemas/JsonNode'
        priceMonthlyCents:
          type: integer
          format: int32
        priceYearlyCents:
          type: integer
          format: int32
  securitySchemes:
    bearerAuth:
      type: http
      description: JWT token obtained from /api/v1/auth/login
      scheme: bearer
      bearerFormat: JWT
    apiKey:
      type: apiKey
      description: Project API key for event ingestion
      name: X-API-Key
      in: header
    platformAdminToken:
      type: apiKey
      description: Cluster-operator credential (PLATFORM_ADMIN_TOKEN env var), independent of tenant org membership — required for cross-tenant admin endpoints
      name: X-Platform-Admin-Token
      in: header
    portalSession:
      type: http
      description: Portal session token, returned once by POST /api/v1/projects/{projectId}/consumers/{consumerId}/portal-sessions
      scheme: bearer
      bearerFormat: rhp_…