v2

latestOpenAPI 3.1.12026-08-06856719.6 KB

Create Recurring Billing

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.

post/v1/recurring-billing

Headers

X-BUSINESS-API-KEYstring required
Example:b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d

Request body

plan_idstring uuid

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'true' | 'false'

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'true' | 'false'

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'sign_up_date' | 'no_initial_charge'

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

namestring

It's is required when save card = true or plan_id = null. By default, the name from the subscription plan will be used.

cycle'weekly' | 'monthly' | 'yearly' | 'custom'

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_repeatinteger

It is required field when cycle is custom. New cycle will only be affective at the end of the current cycle

cycle_frequency'day' | 'week' | 'month' | 'year'

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_emailstring email required

Customer's email.

customer_namestring

Customer's name.

start_datestring

Required when save_card is not true. Billing start date (YYYY-MM-DD) in SGT. Must be today or a future date.

redirect_urlstring

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

referencestring
payment_methodsstring[]

The active Payment methods to be used for the subscription: card, giro, shopee_recurring.

send_email'true' | 'false'

HitPay to send email receipts to the customer. Default value is false

times_to_be_chargednumber

It's time to be charged. Default value is 1

Example request

{
  "name": "Spotify Premium",
  "customer_email": "abc@gmail.com",
  "customer_name": "Paul",
  "start_date": "2025-12-31",
  "payment_methods": [
    "card"
  ],
  "times_to_be_charged": 1
}

Response

200