Hathora BillingV1 API

Account balance, invoices, payment method, and Stripe portal.

OpenAPI Specification

hathora-billingv1-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Hathora Cloud AppsV2 BillingV1 API
  description: Hathora Cloud is on-demand, globally distributed compute for multiplayer game servers. Use the Hathora Cloud API to manage applications, upload and run game server builds, configure deployments, launch and stop processes, create and manage rooms, discover ping endpoints, stream logs, read process metrics, and manage organization tokens and billing. Player-facing authentication issues short-lived player tokens for use with room and lobby endpoints.
  termsOfService: https://hathora.dev/terms-of-service
  contact:
    name: Hathora Support
    url: https://hathora.dev
    email: support@hathora.dev
  version: '3.0'
servers:
- url: https://api.hathora.dev
  description: Hathora Cloud production API
security:
- hathoraDevToken: []
tags:
- name: BillingV1
  description: Account balance, invoices, payment method, and Stripe portal.
paths:
  /billing/v1/balance:
    get:
      operationId: GetBalance
      tags:
      - BillingV1
      summary: Get the current account balance.
      responses:
        '200':
          description: Account balance.
          content:
            application/json:
              schema:
                type: object
                properties:
                  balance:
                    type: number
                    format: double
  /billing/v1/invoices:
    get:
      operationId: GetInvoices
      tags:
      - BillingV1
      summary: Retrieve invoice history.
      responses:
        '200':
          description: A list of invoices.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Invoice'
  /billing/v1/paymentmethod:
    get:
      operationId: GetPaymentMethod
      tags:
      - BillingV1
      summary: Get stored payment method details.
      responses:
        '200':
          description: Payment method.
          content:
            application/json:
              schema:
                type: object
                properties:
                  brand:
                    type: string
                  last4:
                    type: string
  /billing/v1/customerportalurl:
    post:
      operationId: InitStripeCustomerPortalUrl
      tags:
      - BillingV1
      summary: Initialize a Stripe customer portal URL.
      responses:
        '200':
          description: Stripe portal URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
components:
  schemas:
    Invoice:
      type: object
      properties:
        invoiceId:
          type: string
        amountDue:
          type: number
          format: double
        status:
          type: string
        dueDate:
          type: string
          format: date-time
        invoiceUrl:
          type: string
          format: uri
  securitySchemes:
    hathoraDevToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Organization developer/API token used for management endpoints (apps, builds, deployments, processes, rooms, logs, metrics, billing, tokens).
    playerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Short-lived player token issued by the AuthV1 login endpoints, used by game clients for room and lobby operations.