> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dataraven.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Billing Portal

> Get Polar customer portal URL for billing management.

**Required Role:** ADMIN or higher

Creates a customer session on Polar and returns the portal URL.
The frontend should open this URL in a new tab.

The portal allows users to:
- View and download invoices
- Update payment method
- Cancel or resubscribe
- Update billing information

Note: Only teams with a subscription (PRO tier) can access the billing portal.



## OpenAPI

````yaml POST /v1/teams/{team_id}/billing/portal
openapi: 3.1.0
info:
  title: Data Raven API
  description: Cloud-to-cloud data transfer platform powered by RClone
  version: 0.5.0
servers: []
security: []
paths:
  /v1/teams/{team_id}/billing/portal:
    post:
      tags:
        - Subscriptions
      summary: Get Billing Portal
      description: >-
        Get Polar customer portal URL for billing management.


        **Required Role:** ADMIN or higher


        Creates a customer session on Polar and returns the portal URL.

        The frontend should open this URL in a new tab.


        The portal allows users to:

        - View and download invoices

        - Update payment method

        - Cancel or resubscribe

        - Update billing information


        Note: Only teams with a subscription (PRO tier) can access the billing
        portal.
      operationId: get_billing_portal_v1_teams__team_id__billing_portal_post
      parameters:
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Team Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingPortalResponse'
        '404':
          description: No subscription found - team must upgrade to PRO
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '502':
          description: Failed to create billing portal session
      security:
        - HTTPBearer: []
components:
  schemas:
    BillingPortalResponse:
      properties:
        customer_portal_url:
          type: string
          title: Customer Portal Url
          description: URL to Polar customer portal
      type: object
      required:
        - customer_portal_url
      title: BillingPortalResponse
      description: |-
        Response containing billing portal URL.

        The frontend should open this URL in a new tab for the user
        to manage their subscription, payment methods, and invoices.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````