PUT
/
v1
/
recurring-billing
/
{recurring-billing-id}
curl --request PUT \
  --url https://api.sandbox.hit-pay.com/v1/recurring-billing/{recurring-billing-id} \
  --header 'Content-Type: application/json' \
  --data '{
  "plan_id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "cycle": "<string>",
  "cycle_repeat": 123,
  "cycle_frequency": "<string>",
  "save_card": "<string>",
  "customer_email": "<string>",
  "customer_name": "<string>",
  "start_date": "<string>",
  "redirect_url": "<string>",
  "reference": "<string>",
  "amount": 123,
  "webhook": "<string>",
  "send_email": true
}'
"{\n    \"id\": \"9741164c-06a1-4dd7-a649-72cca8f9603a\",\n    \"business_recurring_plans_id\": \"973ee344-6737-4897-9929-edbc9d7bf433\",\n    \"customer_name\": \"Paul\",\n    \"customer_email\": \"paul@newemail.com\",\n    \"name\": \"Spotify Premium\",\n    \"description\": \"Spotify Monthly Subscription\",\n    \"reference\": \"cust_id_123\",\n    \"cycle\": \"monthly\",\n    \"cycle_repeat\": null,\n    \"cycle_frequency\": null,\n    \"currency\": \"sgd\",\n    \"amount\": 12.9,\n    \"times_to_be_charged\": 9,\n    \"times_charged\": 2,\n    \"status\": \"active\",\n    \"send_email\": 0,\n    \"save_card\": 0,\n    \"redirect_url\": \"https://newexamaple.com/completed\",\n    \"payment_methods\": [\n        \"giro\",\n        \"card\"\n    ],\n    \"created_at\": \"2022-09-13T21:32:00\",\n    \"updated_at\": \"2022-09-13T21:32:00\",\n    \"expires_at\": null,\n    \"url\": \"https://securecheckout.sandbox.hit-pay.com/973ee344-6737-4897-9929-edbc9d7bf433/recurring-plan/9741164c-06a1-4dd7-a649-72cca8f9603a\",\n    \"webhook\": \"http://newwebhoo.site/test\"\n}"

Headers

X-Requested-With
string
default: XMLHttpRequest

Path Parameters

recurring-billing-id
string
required

id value from the create recurring billing API

Body

application/json
plan_id
string

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

name
string

Plan name

description
string

Plan description

cycle
string

Billing frequency (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. Min:1, Max: 999

cycle_frequency
string
default: options: [day, week, month, year]

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

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

customer_email
string
customer_name
string
start_date
string

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_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

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

amount
number

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

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
boolean
default: false

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

Response

200 - application/json
id
string
business_recurring_plans_id
string
customer_name
string
customer_email
string
name
string
description
string
reference
string
cycle
string
cycle_repeat
any
cycle_frequency
any
currency
string
amount
number
default: 0
times_to_be_charged
integer
default: 0
times_charged
integer
default: 0
status
string
send_email
integer
default: 0
save_card
integer
default: 0
redirect_url
string
payment_methods
string[]
created_at
string
updated_at
string
expires_at
any
url
string
webhook
string