> ## 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.

# Update a plan for a product

> Updates a plan under the product. Provided `options[]` replace the plan pricing and are validated for cross-option coherence (400 if invalid); money fields are integer minor units.



## OpenAPI

````yaml /api-reference/openapi.json put /v1/sdk/products/{productRef}/plans/{planRef}
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/{planRef}:
    put:
      tags:
        - Plans
      summary: Update a plan for a product
      description: >-
        Updates a plan under the product. Provided `options[]` replace the plan
        pricing and are validated for cross-option coherence (400 if invalid);
        money fields are integer minor units.
      operationId: PlanSdkController_updatePlan
      parameters:
        - description: Product reference or ID
          in: path
          name: productRef
          required: true
          schema:
            example: prd_1A2B3C4D
            type: string
        - description: Plan reference or ID
          in: path
          name: planRef
          required: true
          schema:
            example: pln_1A2B3C4D
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePlanRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Plan'
          description: Plan updated successfully
        '404':
          description: Plan or product not found
      security:
        - SecretKey: []
components:
  schemas:
    UpdatePlanRequest:
      properties:
        accessExpiryDays:
          exclusiveMinimum: false
          minimum: 0
          type: integer
        currency:
          maxLength: 3
          minLength: 3
          type: string
        description:
          maxLength: 500
          pattern: ^[\p{L}\p{N}\s.,'"&\/()+:%;?!@#_[\]\-]*$
          type: string
        features:
          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
        options:
          items:
            oneOf:
              - properties:
                  amountMinor:
                    exclusiveMinimum: false
                    minimum: 0
                    type: integer
                  currency:
                    type: string
                  kind:
                    enum:
                      - charge
                    type: string
                  label:
                    type: string
                  meter:
                    minLength: 1
                    type: string
                  oneTime:
                    type: boolean
                  per:
                    enum:
                      - unit
                      - seat
                      - flat
                    type: string
                required:
                  - amountMinor
                  - currency
                  - per
                  - kind
                type: object
              - properties:
                  anchor:
                    format: date-time
                    type: string
                  count:
                    exclusiveMinimum: false
                    minimum: 1
                    type: integer
                  interval:
                    enum:
                      - week
                      - month
                      - year
                    type: string
                  kind:
                    enum:
                      - billingCycle
                    type: string
                required:
                  - kind
                  - interval
                type: object
              - properties:
                  charge:
                    properties:
                      amountMinor:
                        exclusiveMinimum: false
                        minimum: 0
                        type: integer
                      currency:
                        type: string
                      label:
                        type: string
                      meter:
                        minLength: 1
                        type: string
                      per:
                        enum:
                          - unit
                          - seat
                          - flat
                        type: string
                    required:
                      - amountMinor
                      - currency
                      - per
                    type: object
                  from:
                    exclusiveMinimum: false
                    minimum: 0
                    type: integer
                  kind:
                    enum:
                      - tier
                    type: string
                  label:
                    type: string
                  mode:
                    enum:
                      - graduated
                      - volume
                    type: string
                  to:
                    exclusiveMinimum: false
                    minimum: 0
                    nullable: true
                    type: integer
                required:
                  - kind
                  - from
                  - to
                  - mode
                  - charge
                type: object
              - properties:
                  cap:
                    exclusiveMinimum: false
                    minimum: 0
                    type: integer
                  kind:
                    enum:
                      - limit
                    type: string
                  label:
                    type: string
                  meter:
                    minLength: 1
                    type: string
                  onExceed:
                    enum:
                      - block
                      - throttle
                      - charge
                      - notify
                      - top_up
                      - auto_upgrade
                    type: string
                  onExceedPricingId:
                    type: string
                  scope:
                    enum:
                      - billing_period
                      - lifetime
                      - rolling_window
                    type: string
                  uiHint:
                    enum:
                      - upgrade_prompt
                      - soft_warning
                    type: string
                  windowDays:
                    exclusiveMinimum: false
                    minimum: 1
                    type: integer
                required:
                  - kind
                  - cap
                  - scope
                  - meter
                  - onExceed
                type: object
              - properties:
                  feature:
                    minLength: 1
                    type: string
                  kind:
                    enum:
                      - entitlement
                    type: string
                  label:
                    type: string
                  scope:
                    type: string
                  value:
                    oneOf:
                      - type: boolean
                      - type: number
                      - type: string
                required:
                  - kind
                  - feature
                  - value
                type: object
              - properties:
                  days:
                    exclusiveMinimum: false
                    minimum: 1
                    type: integer
                  downgradeToPricingId:
                    type: string
                  kind:
                    enum:
                      - trial
                    type: string
                  label:
                    type: string
                  onEnd:
                    enum:
                      - convert
                      - cancel
                      - downgrade
                    type: string
                  requireCard:
                    type: boolean
                required:
                  - kind
                  - days
                  - onEnd
                type: object
              - properties:
                  kind:
                    enum:
                      - prepaid
                    type: string
                  label:
                    type: string
                  lowBalanceUnits:
                    exclusiveMinimum: false
                    minimum: 0
                    type: integer
                  minTopUpMinor:
                    exclusiveMinimum: false
                    minimum: 0
                    type: integer
                required:
                  - kind
                type: object
              - properties:
                  appliesTo:
                    enum:
                      - recurring
                      - setup
                      - usage
                      - all
                    type: string
                  currency:
                    type: string
                  cycles:
                    exclusiveMinimum: false
                    minimum: 1
                    type: integer
                  duration:
                    enum:
                      - once
                      - repeating
                      - forever
                    type: string
                  kind:
                    enum:
                      - discount
                    type: string
                  label:
                    type: string
                  mode:
                    enum:
                      - percentage
                      - fixed
                    type: string
                  value:
                    exclusiveMinimum: true
                    minimum: 0
                    type: integer
                required:
                  - kind
                  - mode
                  - value
                  - duration
                type: object
              - properties:
                  capUnits:
                    exclusiveMinimum: false
                    minimum: 1
                    type: integer
                  currency:
                    type: string
                  kind:
                    enum:
                      - rollover
                    type: string
                  label:
                    type: string
                  maxCycles:
                    exclusiveMinimum: false
                    minimum: 1
                    type: integer
                  meter:
                    minLength: 1
                    type: string
                  rateMinor:
                    exclusiveMinimum: false
                    minimum: 0
                    type: integer
                  treatment:
                    enum:
                      - forfeit
                      - carry_forward
                      - credit_units
                      - credit_money
                    type: string
                required:
                  - kind
                  - meter
                  - treatment
                type: object
              - properties:
                  kind:
                    enum:
                      - autoAssigned
                    type: string
                  label:
                    type: string
                required:
                  - kind
                type: object
              - properties:
                  kind:
                    enum:
                      - hidden
                    type: string
                  label:
                    type: string
                required:
                  - kind
                type: object
          type: array
        status:
          enum:
            - active
            - inactive
            - archived
          type: string
        taxBehavior:
          enum:
            - auto
            - inclusive
            - exclusive
          type: string
      type: object
    Plan:
      properties:
        accessExpiryDays:
          description: Access expiry in days
          type: number
        createdAt:
          description: Creation timestamp
          type: string
        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
        isActive:
          description: Whether the plan is active (derived from status)
          example: true
          type: boolean
        maxActiveUsers:
          description: Maximum number of active users
          type: number
        name:
          description: Plan name
          example: Starter
          type: string
        options:
          description: Composable pricing options (money as integer minor units)
          items:
            additionalProperties: true
            type: object
          type: array
        price:
          description: Derived headline price in minor units (the base or one-time charge)
          example: 2999
          type: number
        reference:
          description: Plan reference
          example: pln_1A2B3C4D
          type: string
        requiresPayment:
          description: Whether payment is required
          example: true
          type: boolean
        status:
          description: Plan status
          example: active
          type: string
        type:
          description: Derived plan type (read from options)
          enum:
            - recurring
            - one-time
            - usage-based
            - hybrid
          example: recurring
          type: string
        updatedAt:
          description: Last update timestamp
          type: string
      required:
        - type
        - reference
        - options
        - isActive
        - status
        - createdAt
        - updatedAt
      type: object
  securitySchemes:
    SecretKey:
      bearerFormat: JWT
      description: >-
        Provider secret API key (sk_live_… / sk_test_…) supplied as a Bearer
        token.
      scheme: bearer
      type: http

````