> ## 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 Recurring Billing

> Update recurring billing amount or cycle (effective next cycle)



## OpenAPI

````yaml put /v1/recurring-billing/{recurring_billing_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/recurring-billing/{recurring_billing_id}:
    put:
      summary: Update Recurring Billing
      description: >-
        Use this API to update the recurring billing, any changes made to the
        cycle will only be effective at the end of the current cycle.
      operationId: update-recurring-billing
      parameters:
        - name: X-BUSINESS-API-KEY
          in: header
          required: true
          style: simple
          explode: false
          schema:
            type: string
            example: b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d
        - name: recurring_billing_id
          in: path
          description: id value from the create recurring billing API
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                plan_id:
                  type: string
                  format: uuid
                  description: >-
                    The plan ID, if plan_id is not null it will update [cycle,
                    cycle_repeat, cycle_frequency and amount] with the values
                    from Subscription plan. if plan_id is null you can update
                    each field individually. When save_card is true, you
                    disallow to set plan_id
                  example: 973ee344-6737-4897-9929-edbc9d7bf433
                name:
                  type: string
                  maxLength: 255
                  description: Plan name
                  example: Spotify Premium
                description:
                  type: string
                  description: The description of subscription plan
                  example: Spotify Monthly Subscription
                payment_methods:
                  type: array
                  items:
                    type: string
                    enum:
                      - card
                      - giro
                      - shopee_recurring
                  example:
                    - card
                  description: >-
                    The active Payment methods to be used for the subscription:
                    card, giro, shopee_recurring.
                cycle:
                  type: string
                  enum:
                    - weekly
                    - monthly
                    - yearly
                    - custom
                  description: Billing frequency (weekly / monthly / yearly / custom)
                cycle_repeat:
                  type: integer
                  description: >-
                    It is required field when cycle is custom. New cycle will
                    only be affective at the end of the current cycle
                  minimum: 1
                  maximum: 999
                cycle_frequency:
                  type: string
                  enum:
                    - day
                    - week
                    - month
                    - year
                  description: >-
                    It is required field when the cycle is custom. For cycle =
                    custom, set the frequency for cycle repeat field options
                    [day, week, month, year]
                save_card:
                  type: string
                  enum:
                    - 'true'
                    - 'false'
                  description: >-
                    Only set the value “true” if you wish to save the card and
                    charge the customer later on. More details in “Save Card”
                    section
                save_payment_method:
                  type: string
                  default: 'false'
                  enum:
                    - 'true'
                    - 'false'
                  description: >-
                    It's new field that will replace save_card field in the
                    future. Only set the value “true” if you wish to save the
                    payment method and charge the customer later on. More
                    details in “Save Payment Method” section
                start_date_method:
                  type: string
                  default: null
                  enum:
                    - sign_up_date
                    - no_initial_charge
                  description: >-
                    It's an optional field and only applicable when
                    save_payment_method is true. By default, the
                    start_date_method is null. Options are sign_up_date or
                    no_initial_charge
                customer_email:
                  type: string
                  format: email
                  description: Customer's email.
                  example: abc@gmail.com
                customer_name:
                  type: string
                  description: Customer's name.
                  maxLength: 255
                  example: Paul
                start_date:
                  type: string
                  description: >-
                    The start date must be a date after or equal to today and
                    Billing start date (YYYY-MM-DD) in SGT, only possible to
                    change start date for recurring billing ID with status =
                    scheduled or active
                  example: '2025-12-31'
                redirect_url:
                  type: string
                  format: url
                  description: >-
                    URL where HitPay redirects the user after the users enters
                    the card details and the subscription is active. Query
                    arguments reference (subscription id) and status are sent
                    along
                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
                amount:
                  type: number
                  description: >-
                    New amount, customer will be charged the new amount on the
                    next cycle. Min: It depends on the currency, Max 999999.99
                  format: double
                  maximum: 999999.9
                send_email:
                  type: string
                  enum:
                    - 'true'
                    - 'false'
                  description: Send the email
                  default: 'false'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "id": "9741164c-06a1-4dd7-a649-72cca8f9603a",
                        "business_recurring_plans_id": "973ee344-6737-4897-9929-edbc9d7bf433",
                        "customer_name": "Paul",
                        "customer_email": "paul@newemail.com",
                        "name": "Spotify Premium",
                        "description": "Spotify Monthly Subscription",
                        "reference": "cust_id_123",
                        "cycle": "monthly",
                        "cycle_repeat": null,
                        "cycle_frequency": null,
                        "currency": "sgd",
                        "amount": 12.9,
                        "times_to_be_charged": 9,
                        "times_charged": 2,
                        "status": "active",
                        "send_email": 0,
                        "save_card": 0,
                        "redirect_url": "https://newexamaple.com/completed",
                        "payment_methods": [
                            "giro",
                            "card"
                        ],
                        "created_at": "2022-09-13T21:32:00",
                        "updated_at": "2022-09-13T21:32:00",
                        "expires_at": null,
                        "url": "https://securecheckout.sandbox.hit-pay.com/973ee344-6737-4897-9929-edbc9d7bf433/recurring-plan/9741164c-06a1-4dd7-a649-72cca8f9603a"
                    }
              schema:
                type: object
                properties:
                  id:
                    type: string
                    examples:
                      - 9741164c-06a1-4dd7-a649-72cca8f9603a
                  business_recurring_plans_id:
                    type: string
                    examples:
                      - 973ee344-6737-4897-9929-edbc9d7bf433
                  customer_name:
                    type: string
                    examples:
                      - Paul
                  customer_email:
                    type: string
                    examples:
                      - paul@newemail.com
                  name:
                    type: string
                    examples:
                      - Spotify Premium
                  description:
                    type: string
                    examples:
                      - Spotify Monthly Subscription
                  reference:
                    type: string
                    examples:
                      - cust_id_123
                  cycle:
                    type: string
                    examples:
                      - monthly
                  cycle_repeat: {}
                  cycle_frequency: {}
                  currency:
                    type: string
                    examples:
                      - sgd
                  amount:
                    type: number
                    examples:
                      - 12.9
                    default: 0
                  times_to_be_charged:
                    type: integer
                    examples:
                      - 9
                    default: 0
                  times_charged:
                    type: integer
                    examples:
                      - 2
                    default: 0
                  status:
                    type: string
                    examples:
                      - active
                  send_email:
                    type: integer
                    examples:
                      - 0
                    default: 0
                  save_card:
                    type: integer
                    examples:
                      - 0
                    default: 0
                  redirect_url:
                    type: string
                    examples:
                      - https://newexamaple.com/completed
                  payment_methods:
                    type: array
                    items:
                      type: string
                      examples:
                        - giro
                  created_at:
                    type: string
                    examples:
                      - '2022-09-13T21:32:00'
                  updated_at:
                    type: string
                    examples:
                      - '2022-09-13T21:32:00'
                  expires_at: {}
                  url:
                    type: string
                    examples:
                      - >-
                        https://securecheckout.sandbox.hit-pay.com/973ee344-6737-4897-9929-edbc9d7bf433/recurring-plan/9741164c-06a1-4dd7-a649-72cca8f9603a
        '422':
          description: '422'
          content:
            text/plain:
              examples:
                Result:
                  value: |-
                    {
                        "message": "The given data was invalid.",
                        "errors": {
                            "save_card": [
                                "When save_card true, you disallow to set plan_id."
                            ]
                        }
                    }
              schema:
                oneOf:
                  - 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.
                  - type: object
                    properties:
                      message:
                        type: string
                        examples:
                          - The given data was invalid.
                      errors:
                        type: object
                        properties:
                          save_card:
                            type: array
                            items:
                              type: string
                              examples:
                                - >-
                                  When save_card true, you disallow to set
                                  plan_id.
      deprecated: false
      security: []

````