POST
/
v1
/
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": "<string>",
  "save_card": "<string>",
  "name": "<string>",
  "amount": "<string>",
  "cycle": "<string>",
  "customer_email": "<string>",
  "customer_name": "<string>",
  "start_date": "<string>",
  "redirect_url": "<string>",
  "reference": "<string>",
  "payment_methods": [
    "<string>"
  ],
  "webhook": "<string>",
  "send_email": "<string>",
  "times_to_be_charged": 123
}'

Headers

X-BUSINESS-API-KEY
string
required

Body

application/json
plan_id
string

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
string

Only set the value “true” if you wish to save the card and charge the customer later on. More details in “Save Card” section

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.

amount
string

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.

cycle
string

It's is required when plan_id = null. By default, the cycle from the subscription plan will be used.

customer_email
string
required

Customer email. It's required field

customer_name
string

It's optional field. Customer name

start_date
string
required

Billing start date (YYYY-MM-DD) in SGT

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
payment_methods
string[]

Payment methods to be used for the subscription. Options: [card, giro]

webhook
string

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

send_email
string

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

times_to_be_charged
integer

It's optional field. if you wish to save the card.