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

# Update Subscription Plan

> Update a subscription plan's name, amount, or frequency



## OpenAPI

````yaml put /v1/subscription-plan/{plan_id}
openapi: 3.1.1
info:
  title: HitPay API
  description: >-
    Accept PayNow, FPX, QRIS, GrabPay, cards, and 40+ payment methods with a
    single API. Production base URL: https://api.hit-pay.com, Sandbox:
    https://api.sandbox.hit-pay.com
  version: '1.0'
servers:
  - url: https://api.hit-pay.com
    description: Production
  - url: https://api.sandbox.hit-pay.com
    description: Sandbox
security: []
paths:
  /v1/subscription-plan/{plan_id}:
    put:
      summary: Update Subscription Plan
      description: >-
        Use this API to update the subscription plan, changes made to the plan
        will not affect current subscription. If you would like to make changes
        to the current subscriptions use the Update Recurring Billing API.
      operationId: update-recurring-billing-plan
      parameters:
        - name: X-BUSINESS-API-KEY
          in: header
          required: true
          style: simple
          explode: false
          schema:
            type: string
            example: b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d
        - name: plan_id
          in: path
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - cycle
                - amount
              properties:
                name:
                  type: string
                  description: Plan name. It's required field
                amount:
                  type: integer
                  description: >-
                    Min: Depend on the currency, Max: 999999.99. It's required
                    field
                  maximum: 999999.99
                  format: int32
                description:
                  type: string
                  description: The description of subscription plan
                cycle:
                  type: string
                  description: >-
                    Billing frequency (weekly / monthly / yearly / custom /
                    save_card). If cycle = custom then the user has to send the
                    fields cycle_repeat and cycle_frequency
                  enum:
                    - weekly
                    - monthly
                    - yearly
                    - custom
                    - save_card
                  default: monthly
                cycle_frequency:
                  type: string
                  description: >-
                    [This field is only applicable when cycle = custom] It's the
                    frequency of the cycle [day / week / month / year]
                  enum:
                    - day
                    - week
                    - month
                    - year
                cycle_repeat:
                  type: integer
                  description: >-
                    [This field is only applicable when cycle = custom] It's the
                    number of times the cycle will repeat.
                  format: int32
                currency:
                  type: string
                  example: SGD
                reference:
                  type: string
                  maxLength: 255
                  description: >-
                    Arbitrary reference number that you can map to your internal
                    reference number. This value cannot be edited by the
                    customer
                redirect_url:
                  type: string
                  description: The redirected URL after the payment
                start_date_method:
                  type: string
                  enum:
                    - sign_up_date
                    - customer_select_date
                    - fixed_date
                fixed_date:
                  type: number
                  minimum: 1
                  maximum: 28
                  description: it's required if start_date_method = fixed_date
                times_to_be_charged:
                  type: number
                  minimum: 1
                  maximum: 100
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "id": "973ee344-6737-4897-9929-edbc9d7bf433",
                        "name": "Spotify Premium",
                        "description": "Spotify Monthly Subscription",
                        "cycle": "monthly",
                        "cycle_repeat": null,
                        "cycle_frequency": null,
                        "currency": "sgd",
                        "amount": 12.9,
                        "reference": "spotify_premium_2022",
                        "created_at": "2022-09-13T12:34:13",
                        "updated_at": "2022-09-13T12:34:13"
                    }
              schema:
                type: object
                properties:
                  id:
                    type: string
                    examples:
                      - 973ee344-6737-4897-9929-edbc9d7bf433
                  name:
                    type: string
                    examples:
                      - Spotify Premium
                  description:
                    type: string
                    examples:
                      - Spotify Monthly Subscription
                  cycle:
                    type: string
                    examples:
                      - monthly
                  cycle_repeat: {}
                  cycle_frequency: {}
                  currency:
                    type: string
                    examples:
                      - sgd
                  amount:
                    type: number
                    examples:
                      - 12.9
                    default: 0
                  reference:
                    type: string
                    examples:
                      - spotify_premium_2022
                  created_at:
                    type: string
                    examples:
                      - '2022-09-13T12:34:13'
                  updated_at:
                    type: string
                    examples:
                      - '2022-09-13T12:34:13'
        '422':
          description: '422'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "message": "The given data was invalid.",
                        "errors": {
                            "name": [
                                "The name may not be greater than 128 characters."
                            ]
                        }
                    }
              schema:
                type: object
                properties:
                  message:
                    type: string
                    examples:
                      - The given data was invalid.
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        items:
                          type: string
                          examples:
                            - The name may not be greater than 128 characters.
            text/plain:
              examples:
                Result:
                  value: |-
                    {
                        "message": "The given data was invalid.",
                        "errors": {
                            "cycle_repeat": [
                                "The cycle repeat field is required when cycle is custom."
                            ],
                            "cycle_frequency": [
                                "The cycle frequency field is required when cycle is custom."
                            ]
                        }
                    }
              schema:
                type: object
                properties:
                  message:
                    type: string
                    examples:
                      - The given data was invalid.
                  errors:
                    type: object
                    properties:
                      cycle_repeat:
                        type: array
                        items:
                          type: string
                          examples:
                            - >-
                              The cycle repeat field is required when cycle is
                              custom.
                      cycle_frequency:
                        type: array
                        items:
                          type: string
                          examples:
                            - >-
                              The cycle frequency field is required when cycle
                              is custom.
      deprecated: false
      security: []

````