> ## Documentation Index
> Fetch the complete documentation index at: https://omniflow-vpn.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Post v1adminplans



## OpenAPI

````yaml https://raw.githubusercontent.com/kewldan/omniflow/main/api/openapi.yaml post /v1/admin/plans
openapi: 3.0.3
info:
  title: Omniflow API
  version: 1.0.0
  description: >-
    Customer, commerce, payment, wallet, fulfillment, and operations API for
    Omniflow.
servers: []
security: []
paths:
  /v1/admin/plans:
    post:
      tags:
        - catalog
      operationId: createPlan
      requestBody:
        $ref: '#/components/requestBodies/Plan'
      responses:
        '201':
          description: Plan created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanMutation'
        '422':
          $ref: '#/components/responses/Problem'
      security:
        - operatorToken: []
components:
  requestBodies:
    Plan:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlanInput'
  schemas:
    PlanMutation:
      type: object
      properties:
        id:
          type: string
          format: uuid
        code:
          type: string
        kind:
          type: string
        versionId:
          type: string
          format: uuid
        version:
          type: integer
    PlanInput:
      type: object
      required:
        - code
        - kind
        - localizations
        - version
      properties:
        code:
          type: string
          pattern: ^[a-z][a-z0-9_-]{1,63}$
        kind:
          type: string
          enum:
            - trial
            - one_time
            - recurring
            - free
            - manual
        visible:
          type: boolean
          default: false
        sortOrder:
          type: integer
        localizations:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Localization'
        version:
          $ref: '#/components/schemas/PlanVersionInput'
    Problem:
      type: object
      required:
        - type
        - title
        - status
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        request_id:
          type: string
    Localization:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 120
        description:
          type: string
          maxLength: 2000
    PlanVersionInput:
      type: object
      required:
        - billingPeriod
        - durationSeconds
        - upgradePolicy
        - downgradePolicy
        - cancellationPolicy
        - prices
      properties:
        billingPeriod:
          type: string
          enum:
            - none
            - day
            - week
            - month
            - quarter
            - half_year
            - year
            - custom
        durationSeconds:
          type: integer
          format: int64
          minimum: 1
        trafficAllowanceBytes:
          type: integer
          format: int64
          minimum: 0
          nullable: true
        deviceLimit:
          type: integer
          minimum: 0
          nullable: true
        squadIDs:
          type: array
          items:
            type: string
            format: uuid
        upgradePolicy:
          type: string
          enum:
            - forbid
            - replace
            - extend
        downgradePolicy:
          type: string
          enum:
            - forbid
            - immediate
            - at_expiry
        cancellationPolicy:
          type: string
          enum:
            - forbid
            - immediate
            - at_expiry
        recurringCapable:
          type: boolean
        gracePeriodSeconds:
          type: integer
          format: int64
          minimum: 0
          default: 0
          description: Access retained after expiry so a customer can still renew
        trialEligibility:
          type: string
          enum:
            - new_customer
            - never_trialled
            - any
          default: new_customer
          description: Who may activate this version when the plan kind is trial
        prices:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Money'
    Money:
      type: object
      required:
        - amountMinor
        - currency
      properties:
        amountMinor:
          type: integer
          format: int64
          minimum: 0
        currency:
          type: string
          pattern: ^[A-Z]{3}$
  responses:
    Problem:
      description: Request failed
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    operatorToken:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.