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

# Create Recurring Billing

> Create a recurring billing subscription for a customer



## OpenAPI

````yaml post /v1/recurring-billing
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:
    post:
      summary: Create Recurring Billing
      description: >-
        Once your customer has decided to start the subscription this endpoint
        will create the recurring billing request.

        Since this is a server-to-server communication, if you have a mobile or
        Web client that communicates with your REST API, you must have a new
        endpoint E.g. /create-subscription or reuse an existing endpoint. This
        endpoint will be responsible for making the recurring billing API call
        to HitPay.
      operationId: create-a-recurring-billing
      parameters:
        - name: X-BUSINESS-API-KEY
          in: header
          required: true
          style: simple
          explode: false
          schema:
            type: string
            example: b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - customer_email
              properties:
                plan_id:
                  type: string
                  format: uuid
                  description: >-
                    Subscription plan id created from Create a Subscription Plan
                    API. If you would like to create a subscription without a
                    plan, plan_id should be null
                save_card:
                  type: string
                  default: 'false'
                  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
                name:
                  type: string
                  maxLength: 255
                  description: >-
                    It's is required when save card = true or plan_id = null. 
                    By default, the name from the subscription plan will be
                    used.
                  example: Spotify Premium
                amount:
                  type: integer
                  format: double
                  maximum: 999999.99
                  example: 9.9
                  description: >-
                    Required when save_card = true and plan_id = null for cards.
                    By default, the amount from the subscription plan will be
                    used. Optional when payment_methods contains only APMs
                    (zalopay, shopee_pay, grabpay_direct, touch_n_go) and
                    save_payment_method is true. Min: It depends on the
                    currency, Max: 999999.99.
                cycle:
                  type: string
                  enum:
                    - weekly
                    - monthly
                    - yearly
                    - custom
                  description: >-
                    It's is required when plan_id = null. By default, the cycle
                    from the subscription plan will be used. 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]
                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: >-
                    Required when save_card is not true. Billing start date
                    (YYYY-MM-DD) in SGT. Must be today or a future date.
                  example: '2025-12-31'
                redirect_url:
                  type: string
                  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
                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.
                send_email:
                  type: string
                  default: 'false'
                  enum:
                    - 'true'
                    - 'false'
                  description: >-
                    HitPay to send email receipts to the customer. Default value
                    is false
                times_to_be_charged:
                  type: number
                  description: It's time to be charged. Default value is 1
                  default: 1
                  minimum: 1
                  maximum: 100
                  example: 1
      responses:
        '200':
          description: '200'
          content: {}
        '422':
          description: '422'
          content: {}
      deprecated: false
      security: []

````