NetBird Checkout API

Manage checkout sessions for plan subscriptions.

OpenAPI Specification

netbird-checkout-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: NetBird REST Accounts Checkout API
  description: API to manipulate groups, rules, policies and retrieve information about peers and users
  version: 0.0.1
servers:
- url: https://api.netbird.io
  description: Default server
security:
- BearerAuth: []
- TokenAuth: []
tags:
- name: Checkout
  description: Manage checkout sessions for plan subscriptions.
  x-cloud-only: true
paths:
  /api/integrations/billing/checkout:
    post:
      summary: Create checkout session
      tags:
      - Checkout
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                baseURL:
                  type: string
                  description: The base URL for the redirect after checkout.
                  example: https://app.netbird.io/plans/success
                priceID:
                  type: string
                  description: The Price ID for checkout.
                  example: price_1HhxOpBzq4JbCqRmJxkpzL2V
                enableTrial:
                  type: boolean
                  description: Enables a 14-day trial for the account.
              required:
              - baseURL
              - priceID
      responses:
        '200':
          description: Checkout session URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutResponse'
        '400':
          $ref: '#/components/responses/bad_request'
        '401':
          $ref: '#/components/responses/requires_authentication'
        '500':
          $ref: '#/components/responses/internal_error'
components:
  responses:
    internal_error:
      description: Internal Server Error
      content: {}
    requires_authentication:
      description: Requires authentication
      content: {}
    bad_request:
      description: Bad Request
      content: {}
  schemas:
    CheckoutResponse:
      type: object
      properties:
        session_id:
          type: string
          description: The unique identifier for the checkout session.
          example: cs_test_a1b2c3d4e5f6g7h8i9j0
        url:
          type: string
          description: URL to redirect the user to the checkout session.
          example: https://checkout.stripe.com/pay/cs_test_a1b2c3d4e5f6g7h8i9j0
      required:
      - session_id
      - url
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    TokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Enter the token with the `Token` prefix, e.g. "Token nbp_F3f0d.....".