POST

/v1/subscription-plan/{plan_id}

X-BUSINESS-API-KEY*
X-Requested-With
curl --request POST \
  --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 '{
  "cycle": "<cycle>",
  "name": "<name>"
}'
{
  "status": "200",
  "example": "{\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}"
}

Authorizations

X-BUSINESS-API-KEYheaderrequired
string

Headers

X-Requested-With
Default: "XMLHttpRequest"
string

Path Parameters

plan_idrequired
string

Body

application/json
amount
number

Plan amount. It's optional field

cyclerequired
string

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_frequency
string

It's required field if cycle is custom. Options: [day, week, month, year]

cycle_repeat
integer

It's required field if cycle is custom

description
string

The description of subscription plan. It's optional field

namerequired
string

Plan name. It's optional field

redirect_url
string

Redirect URL

reference
string

Arbitrary reference number that you can map to your internal reference number. It's optional field

Response

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