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

# Create a plan for a product

> Creates a plan under the product. Unfinished pricing fields (setup fee, trial days, rollover, tiers, etc.) are stripped from SDK input, and unsupported plan types fall back to "recurring".



## OpenAPI

````yaml /api-reference/openapi.json post /v1/sdk/products/{productRef}/plans
openapi: 3.0.0
info:
  contact: {}
  description: The SolvaPay REST API specification
  title: SolvaPay REST API
  version: '1.0'
servers: []
security: []
tags: []
paths:
  /v1/sdk/products/{productRef}/plans:
    post:
      tags:
        - Plans
      summary: Create a plan for a product
      description: >-
        Creates a plan under the product. Unfinished pricing fields (setup fee,
        trial days, rollover, tiers, etc.) are stripped from SDK input, and
        unsupported plan types fall back to "recurring".
      operationId: PlanSdkController_createPlan
      parameters:
        - description: Product reference or ID
          in: path
          name: productRef
          required: true
          schema:
            example: prd_1A2B3C4D
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePlanRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Plan'
          description: Plan created successfully
        '404':
          description: Product not found
      security:
        - SecretKey: []
components:
  schemas:
    CreatePlanRequest:
      properties:
        accessExpiryDays:
          exclusiveMinimum: false
          minimum: 0
          type: integer
        autoRenew:
          type: boolean
        basePrice:
          exclusiveMinimum: false
          minimum: 0
          type: number
        billingCycle:
          enum:
            - weekly
            - monthly
            - quarterly
            - yearly
            - custom
          type: string
        billingModel:
          enum:
            - pre-paid
            - post-paid
          type: string
        billingStrategy:
          properties:
            type:
              type: string
          type: object
        cancellationNoticeDays:
          exclusiveMinimum: false
          minimum: 0
          type: integer
        creditsPerUnit:
          exclusiveMinimum: false
          minimum: 1
          type: integer
        currency:
          type: string
        default:
          type: boolean
        description:
          maxLength: 500
          pattern: ^[\p{L}\p{N}\s.,'"&\/()+:%;?!@#_[\]\-]*$
          type: string
        features:
          additionalProperties: true
          type: object
        freeUnits:
          exclusiveMinimum: false
          minimum: 0
          type: integer
        fulfillment:
          properties:
            deliveryMethod:
              type: string
            estimatedDelivery:
              type: string
            type:
              type: string
          type: object
        hidden:
          type: boolean
        limit:
          exclusiveMinimum: false
          minimum: 0
          type: integer
        limits:
          additionalProperties: true
          type: object
        maxActiveUsers:
          exclusiveMinimum: false
          minimum: 0
          type: integer
        metadata:
          additionalProperties: true
          type: object
        name:
          maxLength: 200
          minLength: 2
          pattern: ^[\p{L}\p{N} .,'"&\/()+:\-]*$
          type: string
        overagePolicy:
          properties:
            allowOverage:
              type: boolean
            maxOverage:
              type: number
          type: object
        price:
          exclusiveMaximum: false
          exclusiveMinimum: false
          maximum: 10000000
          minimum: 0
          type: number
        pricingOptions:
          items:
            properties:
              basePrice:
                exclusiveMinimum: false
                minimum: 0
                type: number
              currency:
                maxLength: 3
                minLength: 3
                type: string
              default:
                type: boolean
              price:
                exclusiveMinimum: false
                minimum: 0
                type: number
              setupFee:
                exclusiveMinimum: false
                minimum: 0
                type: number
            required:
              - currency
              - price
            type: object
          type: array
        prorationPolicy:
          properties:
            enabled:
              type: boolean
            method:
              enum:
                - proportional
                - full
                - none
              type: string
          type: object
        returnPolicy:
          properties:
            allowed:
              type: boolean
            conditions:
              type: string
            period:
              type: number
          type: object
        rolloverUnusedUnits:
          type: boolean
        setupFee:
          exclusiveMinimum: false
          minimum: 0
          type: number
        status:
          enum:
            - active
            - inactive
            - archived
          type: string
        taxBehavior:
          enum:
            - auto
            - inclusive
            - exclusive
          type: string
        trialDays:
          exclusiveMinimum: false
          minimum: 0
          type: integer
        type:
          enum:
            - recurring
            - usage-based
            - one-time
            - hybrid
          type: string
        usageTracking:
          properties:
            granularity:
              enum:
                - hourly
                - daily
                - weekly
                - monthly
              type: string
            method:
              enum:
                - automatic
                - manual
                - hybrid
              type: string
          type: object
        warranty:
          properties:
            duration:
              type: number
            terms:
              type: string
            unit:
              type: string
          type: object
      required:
        - name
        - usageTracking
        - limits
        - metadata
        - features
        - overagePolicy
        - billingStrategy
        - prorationPolicy
        - returnPolicy
        - fulfillment
        - warranty
      type: object
    Plan:
      properties:
        accessExpiryDays:
          description: Access expiry in days
          type: number
        billingCycle:
          description: Billing cycle
          example: monthly
          type: string
        billingModel:
          description: Billing model
          enum:
            - pre-paid
            - post-paid
          example: pre-paid
          type: string
        createdAt:
          description: Creation timestamp
          type: string
        creditsPerUnit:
          description: Credits per usage unit (integer, >= 1)
          example: 1
          type: number
        currency:
          description: Currency code (ISO 4217)
          example: USD
          type: string
        currencySymbol:
          description: Currency symbol (derived from currency)
          example: $
          type: string
        description:
          description: Plan description
          example: Best for teams getting started
          type: string
        features:
          additionalProperties: true
          description: Plan features
          type: object
        freeUnits:
          description: Number of free units included
          example: 100
          type: number
        hidden:
          description: >-
            Whether the plan is hidden from customer-facing surfaces. When true,
            the plan does not appear in checkout or the SDK catalog and can only
            be granted via direct assignment (enterprise plans).
          example: false
          type: boolean
        isActive:
          description: Whether the plan is active (derived from status)
          example: true
          type: boolean
        limit:
          description: Usage limit for the meter
          example: 10000
          type: number
        limits:
          additionalProperties: true
          description: Usage limits
          type: object
        maxActiveUsers:
          description: Maximum number of active users
          type: number
        measures:
          description: What the plan measures for usage tracking
          example: requests
          type: string
        meterRef:
          description: Meter reference for usage-based plans
          example: mtr_1A2B3C4D
          type: string
        name:
          description: Plan name
          example: Starter
          type: string
        price:
          description: Plan price in cents
          example: 2999
          type: number
        pricingOptions:
          description: Per-currency price options for this plan
          items:
            $ref: '#/components/schemas/PlanPricingOptionDto'
          type: array
        reference:
          description: Plan reference
          example: pln_1A2B3C4D
          type: string
        requiresPayment:
          description: Whether payment is required
          example: true
          type: boolean
        rolloverUnusedUnits:
          description: Whether unused units roll over to next period
          example: false
          type: boolean
        setupFee:
          description: One-time setup fee
          example: 500
          type: number
        status:
          description: Plan status
          example: active
          type: string
        taxBehavior:
          description: Tax inclusion behavior for business checkout
          enum:
            - auto
            - inclusive
            - exclusive
          type: string
        trialDays:
          description: Free trial period in days
          example: 14
          type: number
        type:
          description: Plan type exposed in SDK
          enum:
            - recurring
            - one-time
            - usage-based
            - hybrid
          example: recurring
          type: string
        updatedAt:
          description: Last update timestamp
          type: string
      required:
        - type
        - reference
        - price
        - currency
        - requiresPayment
        - hidden
        - isActive
        - status
        - createdAt
        - updatedAt
      type: object
    PlanPricingOptionDto:
      properties:
        basePrice:
          description: Base price in smallest currency unit (hybrid plans)
          example: 1999
          type: number
        currency:
          description: ISO 4217 currency code
          example: USD
          type: string
        default:
          description: Whether this is the default currency option for the plan
          example: true
          type: boolean
        price:
          description: Price in smallest currency unit (e.g. cents)
          example: 2999
          type: number
        setupFee:
          description: One-time setup fee in smallest currency unit
          example: 500
          type: number
      required:
        - currency
        - price
      type: object
  securitySchemes:
    SecretKey:
      bearerFormat: JWT
      description: >-
        Provider secret API key (sk_live_… / sk_test_…) supplied as a Bearer
        token.
      scheme: bearer
      type: http

````