v2

latestOpenAPI 3.1.12026-08-06856719.6 KB

Update Recurring Billing

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.

put/v1/recurring-billing/{recurring_billing_id}

Path parameters

recurring_billing_idstring uuid required

id value from the create recurring billing API

Headers

X-BUSINESS-API-KEYstring required
Example:b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d

Request body

plan_idstring uuid

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

namestring

Plan name

descriptionstring

The description of subscription plan

payment_methodsstring[]

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

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

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]

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

customer_emailstring email

Customer's email.

customer_namestring

Customer's name.

start_datestring

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

redirect_urlstring url

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

Arbitrary reference number that you can map to your internal reference number. This value cannot be edited by the customer

amountnumber double

New amount, customer will be charged the new amount on the next cycle. Min: It depends on the currency, Max 999999.99

send_email'true' | 'false'

Send the email

Example request

{
  "plan_id": "973ee344-6737-4897-9929-edbc9d7bf433",
  "name": "Spotify Premium",
  "description": "Spotify Monthly Subscription",
  "payment_methods": [
    "card"
  ],
  "customer_email": "abc@gmail.com",
  "customer_name": "Paul",
  "start_date": "2025-12-31"
}

Response

200

idstring
business_recurring_plans_idstring
customer_namestring
customer_emailstring
namestring
descriptionstring
referencestring
cyclestring
{"stackTrail":"paths:/v1/recurring-billing/{recurring_billing_id}:put:responses:200:content:application/json:schema:properties:cycle_repeat","oasType":"schema","type":"unknown"}
{"stackTrail":"paths:/v1/recurring-billing/{recurring_billing_id}:put:responses:200:content:application/json:schema:properties:cycle_frequency","oasType":"schema","type":"unknown"}
currencystring
amountnumber
times_to_be_chargedinteger
times_chargedinteger
statusstring
send_emailinteger
save_cardinteger
redirect_urlstring
payment_methodsstring[]
created_atstring
updated_atstring
{"stackTrail":"paths:/v1/recurring-billing/{recurring_billing_id}:put:responses:200:content:application/json:schema:properties:expires_at","oasType":"schema","type":"unknown"}
urlstring

Example response

{
  "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",
  "currency": "sgd",
  "amount": 12.9,
  "times_to_be_charged": 9,
  "times_charged": 2,
  "status": "active",
  "redirect_url": "https://newexamaple.com/completed",
  "payment_methods": [
    "giro"
  ],
  "created_at": "2022-09-13T21:32:00",
  "updated_at": "2022-09-13T21:32:00",
  "url": "https://securecheckout.sandbox.hit-pay.com/973ee344-6737-4897-9929-edbc9d7bf433/recurring-plan/9741164c-06a1-4dd7-a649-72cca8f9603a"
}