POST
/
v1
/
recurring-billing
Create Recurring Billing
curl --request POST \
  --url https://api.sandbox.hit-pay.com/v1/recurring-billing \
  --header 'Content-Type: application/json' \
  --header 'X-BUSINESS-API-KEY: <x-business-api-key>' \
  --data '{
  "plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "save_card": "false",
  "name": "Spotify Premium",
  "amount": 9.9,
  "cycle": "weekly",
  "cycle_repeat": 500,
  "cycle_frequency": "day",
  "customer_email": "abc@gmail.com",
  "customer_name": "Paul",
  "start_date": "2025-12-31",
  "redirect_url": "<string>",
  "reference": "<string>",
  "payment_methods": [
    "card"
  ],
  "webhook": "https://webhook.site/test",
  "send_email": "false",
  "times_to_be_charged": 1
}'

Headers

X-BUSINESS-API-KEY
string
required
Example:

"b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d"

Body

application/json
customer_email
string<email>
required

Customer's email.

Example:

"abc@gmail.com"

customer_name
string
required

Customer's name.

Maximum length: 255
Example:

"Paul"

start_date
string
required

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"

plan_id
string<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
enum<string>
default: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

Available options:
true,
false
name
string

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

Maximum length: 255
Example:

"Spotify Premium"

amount
integer

It's is required when save card = true and plan_id = null. This is an optional value. By default, the amount from the subscription plan will be used. You can use this parameter for discounts for specific customers. Min: It depends on the currency, Max: 999999.99.

Required range: x <= 999999.99
Example:

9.9

cycle
enum<string>

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)

Available options:
weekly,
monthly,
yearly,
custom
cycle_repeat
integer

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

Required range: 1 <= x <= 999
cycle_frequency
enum<string>

It is required field when the cycle is custom. For cycle = custom, set the frequency for cycle repeat field options [day, week, month, year]

Available options:
day,
week,
month,
year
redirect_url
string

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
string
Maximum length: 255
payment_methods
enum<string>[]

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

Example:
["card"]
webhook
string<url>

Optional URL value to which HitPay will send a POST request when there is a new charge or if there is an error charging the card

Example:

"https://webhook.site/test"

send_email
enum<string>
default:false

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

Available options:
true,
false
times_to_be_charged
number
default:1

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

Required range: 1 <= x <= 100
Example:

1