PUT
/
v1
/
subscription-plan
/
{plan_id}
curl --request PUT \
  --url https://api.sandbox.hit-pay.com/v1/subscription-plan/{plan_id} \
  --header 'Content-Type: application/json' \
  --header 'X-BUSINESS-API-KEY: <x-business-api-key>' \
  --data '{
  "name": "<string>",
  "amount": 500000,
  "description": "<string>",
  "cycle": "monthly",
  "cycle_frequency": "day",
  "cycle_repeat": 123,
  "currency": "SGD",
  "reference": "<string>",
  "redirect_url": "<string>",
  "start_date_method": "sign_up_date",
  "fixed_date": 14.5,
  "times_to_be_charged": 50.5
}'
"{\n    \"id\": \"973ee344-6737-4897-9929-edbc9d7bf433\",\n    \"name\": \"Spotify Premium\",\n    \"description\": \"Spotify Monthly Subscription\",\n    \"cycle\": \"monthly\",\n    \"cycle_repeat\": null,\n    \"cycle_frequency\": null,\n    \"currency\": \"sgd\",\n    \"amount\": 12.9,\n    \"reference\": \"spotify_premium_2022\",\n    \"created_at\": \"2022-09-13T12:34:13\",\n    \"updated_at\": \"2022-09-13T12:34:13\"\n}"

Headers

X-BUSINESS-API-KEY
string
required
Example:

"b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d"

Path Parameters

plan_id
string
required

Body

application/json
name
string
required

Plan name. It's required field

amount
integer
required

Min: 1, Max: 999999.99. It's required field

Required range: 1 <= x <= 999999.99
cycle
enum<string>
default:monthly
required

Billing frequency (weekly / monthly / yearly / custom / save_card). If cycle = custom then the user has to send the fields cycle_repeat and cycle_frequency

Available options:
weekly,
monthly,
yearly,
custom,
save_card
description
string

The description of subscription plan

cycle_frequency
enum<string>

[This field is only applicable when cycle = custom] It's the frequency of the cycle [day / week / month / year]

Available options:
day,
week,
month,
year
cycle_repeat
integer

[This field is only applicable when cycle = custom] It's the number of times the cycle will repeat.

currency
string
Example:

"SGD"

reference
string

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

Maximum length: 255
redirect_url
string

The redirected URL after the payment

start_date_method
enum<string>
Available options:
sign_up_date,
customer_select_date,
fixed_date
fixed_date
number

it's required if start_date_method = fixed_date

Required range: 1 <= x <= 28
times_to_be_charged
number
Required range: 1 <= x <= 100

Response

200
application/json
200
id
string
Example:

"973ee344-6737-4897-9929-edbc9d7bf433"

name
string
Example:

"Spotify Premium"

description
string
Example:

"Spotify Monthly Subscription"

cycle
string
Example:

"monthly"

cycle_repeat
any
cycle_frequency
any
currency
string
Example:

"sgd"

amount
number
default:0
Example:

12.9

reference
string
Example:

"spotify_premium_2022"

created_at
string
Example:

"2022-09-13T12:34:13"

updated_at
string
Example:

"2022-09-13T12:34:13"