POST
/
v1
/
subscription-plan
curl --request POST \
  --url https://api.sandbox.hit-pay.com/v1/subscription-plan \
  --header 'Content-Type: application/json' \
  --header 'X-BUSINESS-API-KEY: <x-business-api-key>' \
  --data '{
  "name": "<string>",
  "description": "<string>",
  "cycle": "<string>",
  "cycle_repeat": 123,
  "cycle_frequency": "<string>",
  "currency": "<string>",
  "amount": 123,
  "reference": "<string>"
}'
"{\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\": 9.90,\n    \"reference\": \"spotify_premium_2022\",\n    \"created_at\": \"2022-09-12T14:19:26\",\n    \"updated_at\": \"2022-09-12T14:19:26\"\n}"

Headers

X-BUSINESS-API-KEY
string
required

Body

application/json
name
string
required

Plan name. It's required field

description
string

The description of subscription plan

cycle
string
default: monthlyrequired

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

cycle_repeat
integer

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

cycle_frequency
string

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

currency
string
default: Plan amount currency

Example: SGD

amount
integer
required

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

reference
string

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

Response

200 - application/json
id
string
name
string
description
string
cycle
string
cycle_repeat
any
cycle_frequency
any
currency
string
amount
number
default: 0
reference
string
created_at
string
updated_at
string